所以我想要的是一个程序,当最小化将进入系统托盘,然后双击系统中的图标尝试该程序将重新打开它的窗口。现在,我正在运行的oroblem在xaml中,它说“名称”测试“在命名空间中不存在”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>
这就是磨损“测试”所在位置
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;
}
}