|
@@ -1,4 +1,5 @@
|
|
|
using AutoMapper;
|
|
|
+using AutoUpdaterDotNET;
|
|
|
using BizService;
|
|
|
using BlankApp1.Common;
|
|
|
using BlankApp1.Events;
|
|
@@ -18,6 +19,7 @@ using System;
|
|
|
using System.Collections.Generic;
|
|
|
using System.Collections.ObjectModel;
|
|
|
using System.IO;
|
|
|
+using System.Reflection;
|
|
|
using System.Threading.Tasks;
|
|
|
using System.Windows;
|
|
|
|
|
@@ -49,13 +51,21 @@ namespace BlankApp1.ViewModels
|
|
|
BreadChangedCommand = new DelegateCommand<object>(BreadChangedC);
|
|
|
LoginOutCommand = new DelegateCommand<object>(LoginOut);
|
|
|
OnLoadCommand = new DelegateCommand(OnLoad);
|
|
|
+ VersisonCommand = new DelegateCommand(UpdateVersion);
|
|
|
JudgePLC();
|
|
|
logger.LogInformation("info");
|
|
|
logger.LogError("error");
|
|
|
|
|
|
aggregator.GetEvent<BreadEvent>().Subscribe(RecvBreadMsg);
|
|
|
aggregator.GetEvent<MaskEvent>().Subscribe(DisplayMask);
|
|
|
-
|
|
|
+ //检查更新版本
|
|
|
+ AutoUpdater.Start("http://127.0.0.1/Updates/AutoUpdaterStarter.xml");
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ private void UpdateVersion()
|
|
|
+ {
|
|
|
+ AutoUpdater.Start("http://127.0.0.1/Updates/AutoUpdaterStarter.xml");
|
|
|
}
|
|
|
|
|
|
private void OnLoad()
|
|
@@ -163,6 +173,8 @@ namespace BlankApp1.ViewModels
|
|
|
public DelegateCommand OnLoadCommand { set; get; }
|
|
|
public DelegateCommand<object> BreadChangedCommand { set; get; }
|
|
|
public DelegateCommand<object> LoginOutCommand { set; get; }
|
|
|
+
|
|
|
+ public DelegateCommand VersisonCommand { set; get; }
|
|
|
|
|
|
|
|
|
#endregion
|
|
@@ -203,7 +215,12 @@ namespace BlankApp1.ViewModels
|
|
|
get { return userName; }
|
|
|
set { userName = value; RaisePropertyChanged(); }
|
|
|
}
|
|
|
-
|
|
|
+ private string? version = Assembly.GetExecutingAssembly()?.GetName()?.Version?.ToString();
|
|
|
+ public string Version
|
|
|
+ {
|
|
|
+ get { return $"版本:V{version}"; }
|
|
|
+ set { version = value; RaisePropertyChanged(); }
|
|
|
+ }
|
|
|
|
|
|
#endregion
|
|
|
}
|