update view

master
ZGGSONG 3 years ago
parent 0041664d20
commit a33894e8c3

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

@ -16,6 +16,7 @@ namespace ScadaTool.ViewModel
public MainViewModel()
{
#region 图标闪烁
bool tmp = false;
var timer = new System.Timers.Timer(1000);
timer.Elapsed += new System.Timers.ElapsedEventHandler((obj, args) =>
@ -24,6 +25,7 @@ namespace ScadaTool.ViewModel
tmp = tmp == true ? false : true;
});
timer.Start();
#endregion
#region Command
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((_) =>
{

Loading…
Cancel
Save