update view

master
ZGGSONG 3 years ago
parent 0041664d20
commit a33894e8c3

@ -28,6 +28,7 @@
<tb:TaskbarIcon.ContextMenu> <tb:TaskbarIcon.ContextMenu>
<ContextMenu> <ContextMenu>
<MenuItem Header="显示窗口" Command="{Binding ShowWindowCommand}" /> <MenuItem Header="显示窗口" Command="{Binding ShowWindowCommand}" />
<MenuItem Header="关闭窗口" Command="{Binding HidenApplicationCommand}" />
<Separator /> <Separator />
<MenuItem Header="退出" Command="{Binding ExitApplicationCommand}" /> <MenuItem Header="退出" Command="{Binding ExitApplicationCommand}" />
</ContextMenu> </ContextMenu>

@ -16,6 +16,7 @@ namespace ScadaTool.ViewModel
public MainViewModel() public MainViewModel()
{ {
#region 图标闪烁
bool tmp = false; bool tmp = false;
var timer = new System.Timers.Timer(1000); var timer = new System.Timers.Timer(1000);
timer.Elapsed += new System.Timers.ElapsedEventHandler((obj, args) => timer.Elapsed += new System.Timers.ElapsedEventHandler((obj, args) =>
@ -24,6 +25,7 @@ namespace ScadaTool.ViewModel
tmp = tmp == true ? false : true; tmp = tmp == true ? false : true;
}); });
timer.Start(); timer.Start();
#endregion
#region Command #region Command
ExitApplicationCommand = new RelayCommand((_) => ExitApplicationCommand = new RelayCommand((_) =>
@ -49,6 +51,17 @@ namespace ScadaTool.ViewModel
}); });
}); });
HidenApplicationCommand = new RelayCommand((_) =>
{
return true;
}, (_) =>
{
ViewModelHelper.Instance().UpdateUI(() =>
{
Application.Current.MainWindow.Hide();
});
});
// 服务 // 服务
StartServiceCommand = new RelayCommand((_) => StartServiceCommand = new RelayCommand((_) =>
{ {

Loading…
Cancel
Save