0

so what i am trying to make is a program when minimized will go to system tray, and then apon double clicking the icon in the system try the program will reopen up its window. now the oroblem i am running in to is in the xaml at it says "the name "test" does not exist in the namespace "clr-namespace:alarm.test".

<Window
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:tb="http://www.hardcodet.net/taskbar"
xmlns:local="clr-namespace:alarm.test"
x:Class="alarm.MainWindow"
Height="300"
Width="300">

<Grid>

    <Grid.Resources>
        <local:test
            x:Key="MessageCommand" />
    </Grid.Resources>
    <tb:TaskbarIcon
        x:Name="MyNotifyIcon"
        IconSource="/Icons/Error.ico"
        ToolTipText="Balloon Sample Icon"
        PopupActivation="LeftClick"
        DoubleClickCommand=""
        />

    <Button
        x:Name="btnShowStandardBalloon"
        Click="btnShowStandardBalloon_Click"
        Margin="26,74,29,0"
        Content="Show Standard Balloon" Height="29" VerticalAlignment="Top" />
    <Button
        x:Name="btnHideStandardBalloon"
        Click="btnHideStandardBalloon_Click"
        Margin="26,113,29,122"
        Content="Hide Standard Balloon" />


</Grid>

and this is wear "test" is located

 namespace alarm.test
    {
    public class test : ICommand
    {
        public void Execute(object parameter)
        {
            MessageBox.Show(parameter.ToString());
        }

        public bool CanExecute(object parameter)
        {
            return true;
        }

        public event EventHandler CanExecuteChanged;
    }
}
hurnhu
  • 888
  • 2
  • 11
  • 30
  • how would i go about making sure it is? – hurnhu Jan 16 '14 at 04:06
  • No, the namespace does exist in the assembly (otherwise, you would get an error about the namespace not found). But if you comment out/remove the from the XAML, does the project build without other errors (including the test class)? –  Jan 16 '14 at 04:08
  • yes no errors what so ever – hurnhu Jan 16 '14 at 04:09
  • in the source file declaring the test class, is there also something more written, or only the class test? (It smells like the namespace alarm.test{} is surrounded by another namespace, something like `namespace something { ... namespace alarm.test { public class test ... } ... }` –  Jan 16 '14 at 04:11
  • Or, you have the class test declared in another assembly (a-ka project), while your main project incidentally also has an alarm.test namespace (which could also explain why the namespace is found, but not the class test). –  Jan 16 '14 at 04:14
  • only the class test like seen above, although the .cs is named something different. but it does auto complete test when i start typing it after local.. – hurnhu Jan 16 '14 at 04:16
  • i checked to see if i had another projects opened, and i did not. – hurnhu Jan 16 '14 at 04:21
  • let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/45332/discussion-between-elgonzo-and-michael-lapan) –  Jan 16 '14 at 04:21

0 Answers0