Merge branch 'master' of http://www.scserverddns.top:13000/sc/SunlightCentralizedControlManagement
This commit is contained in:
commit
772a466384
3 files changed
+80
-2
No files matched your search
@@ -14,5 +14,35 @@
|
||||
Height="1080" Width="1920" Background="#FF003640" >
|
||||
<Grid>
|
||||
<ContentControl x:Name="container" Margin="10,0,0,0"/>
|
||||
|
||||
<StatusBar VerticalAlignment="Bottom" Height="30" Padding="5,0,5,0">
|
||||
<StatusBarItem>
|
||||
<TextBlock Text="系统时间:" />
|
||||
</StatusBarItem>
|
||||
<StatusBarItem>
|
||||
<TextBlock Text="{Binding Sys_Time}" Width="200"/>
|
||||
</StatusBarItem>
|
||||
<Separator />
|
||||
<StatusBarItem>
|
||||
<TextBlock Text="用户:" />
|
||||
</StatusBarItem>
|
||||
<StatusBarItem>
|
||||
<TextBlock Text="{Binding Sys_User}" Width="200"/>
|
||||
</StatusBarItem>
|
||||
<Separator />
|
||||
<StatusBarItem>
|
||||
<TextBlock Text="染色机:" />
|
||||
</StatusBarItem>
|
||||
<StatusBarItem>
|
||||
<TextBlock Text="{Binding Sys_MachineN}" Width="100"/>
|
||||
</StatusBarItem>
|
||||
<Separator />
|
||||
<StatusBarItem>
|
||||
<TextBlock Text="扩展:" />
|
||||
</StatusBarItem>
|
||||
<StatusBarItem>
|
||||
<TextBlock Text="{Binding Sys_EX}" Width="auto"/>
|
||||
</StatusBarItem>
|
||||
</StatusBar>
|
||||
</Grid>
|
||||
</Fluent:RibbonWindow>
|
||||
+1
-1
@@ -23,7 +23,7 @@ namespace SunlightCentralizedControlManagement_SCCM_
|
||||
{
|
||||
public MainWindow()
|
||||
{
|
||||
// DataContext = new MainWindowViewModel();
|
||||
DataContext = new MainWindowViewModel();
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
|
||||
@@ -1,9 +1,13 @@
|
||||
using System;
|
||||
using DyeingComputer.UserClass;
|
||||
using SunlightCentralizedControlManagement_SCCM_.Properties;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Web.Util;
|
||||
using System.Windows.Threading;
|
||||
|
||||
namespace SunlightCentralizedControlManagement_SCCM_.ViewModel
|
||||
{
|
||||
@@ -31,5 +35,49 @@ namespace SunlightCentralizedControlManagement_SCCM_.ViewModel
|
||||
}
|
||||
public class MainWindowViewModel : ViewModelBase
|
||||
{
|
||||
public string sys_Time; //显示系统时间
|
||||
public string Sys_Time //通知UI控件参数改变
|
||||
{
|
||||
get { return sys_Time; }
|
||||
set { sys_Time = value; OnPropertyChanged("Sys_Time"); }
|
||||
}
|
||||
public void CountDown()
|
||||
{
|
||||
DispatcherTimer timer1s = new DispatcherTimer//初始化循环,每1秒调用一次Tick
|
||||
{
|
||||
Interval = TimeSpan.FromSeconds(1)//秒
|
||||
};
|
||||
timer1s.Tick += Tick_Event_1S;
|
||||
timer1s.Start();
|
||||
|
||||
DispatcherTimer timer5s = new DispatcherTimer//初始化循环,每1秒调用一次Tick
|
||||
{
|
||||
Interval = TimeSpan.FromSeconds(5)//秒
|
||||
};
|
||||
timer5s.Tick += Tick_Event_5S;
|
||||
timer5s.Start();
|
||||
|
||||
//设置定时器
|
||||
DispatcherTimer disTimer = new DispatcherTimer
|
||||
{
|
||||
Interval = TimeSpan.FromMilliseconds(500) //毫秒
|
||||
};
|
||||
disTimer.Tick += new EventHandler(DisTimer_500MS);//每一秒执行的方法
|
||||
disTimer.Start();//计时开始
|
||||
}//时间周期初始化
|
||||
void Tick_Event_1S(object sender, EventArgs e)//Tick_Event周期执行事件1S
|
||||
{
|
||||
Sys_Time = DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss");
|
||||
}
|
||||
void Tick_Event_5S(object sender, EventArgs e)//Tick_Event周期执行事件5S
|
||||
{
|
||||
}
|
||||
void DisTimer_500MS(object sender, EventArgs e)//Tick_Event周期执行事件500MS
|
||||
{
|
||||
}
|
||||
public MainWindowViewModel()
|
||||
{
|
||||
CountDown();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user