From f7df2f6c7993f89388304b2abdc79f0da484a089 Mon Sep 17 00:00:00 2001 From: maqiao <625215135@qq.com> Date: Fri, 29 Nov 2024 08:44:36 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=99=BB=E5=BD=95=E8=B7=B3?= =?UTF-8?q?=E8=BD=AC=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DM_Weight/ViewModels/HomeWindowViewModel.cs | 2 +- DM_Weight/ViewModels/LoginWindowViewModel.cs | 38 ++++++++++---------- DM_Weight/ViewModels/MainWindowViewModel.cs | 11 +++--- 3 files changed, 25 insertions(+), 26 deletions(-) diff --git a/DM_Weight/ViewModels/HomeWindowViewModel.cs b/DM_Weight/ViewModels/HomeWindowViewModel.cs index 4c08c17..a661a8d 100644 --- a/DM_Weight/ViewModels/HomeWindowViewModel.cs +++ b/DM_Weight/ViewModels/HomeWindowViewModel.cs @@ -596,7 +596,7 @@ namespace DM_Weight.ViewModels // }; // timer.Start(); //} - logger.Info($"当前时间:{DateTime.Now}\r\n获取录像机的时间"); + //logger.Info($"当前时间:{DateTime.Now}\r\n获取录像机的时间"); //获取录像机的时间 //_chkFunction.HIK_DVR_TIME(); //_chkFunction.HIKStartDVRRecord(); diff --git a/DM_Weight/ViewModels/LoginWindowViewModel.cs b/DM_Weight/ViewModels/LoginWindowViewModel.cs index 2539ee5..6a4310c 100644 --- a/DM_Weight/ViewModels/LoginWindowViewModel.cs +++ b/DM_Weight/ViewModels/LoginWindowViewModel.cs @@ -96,12 +96,12 @@ namespace DM_Weight.ViewModels // get => !_portUtil.fridgeSerial.IsOpen; //} //录像机登录状态 - private bool _hikMsg; - public bool HIKMsg - { - get=>_hikMsg; - set=>SetProperty(ref _hikMsg, value); - } + //private bool _hikMsg; + //public bool HIKMsg + //{ + // get=>_hikMsg; + // set=>SetProperty(ref _hikMsg, value); + //} //public LoginWindowViewModel(IRegionManager regionManager, IEventAggregator eventAggregator, PortUtil portUtil, FingerprintUtil fingerprintUtil) //{ @@ -255,10 +255,10 @@ _exitCommand ??= new DelegateCommand(Exit); { //添加参数,键值对格式 keys.Add("operator", user); - System.Windows.Application.Current.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Send, new Action(() => - { + //System.Windows.Application.Current.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Send, new Action(() => + //{ _regionManager.RequestNavigate("MainRegion", "HomeWindow", keys); - })); + //})); } // 双人登录模式 else @@ -271,10 +271,10 @@ _exitCommand ??= new DelegateCommand(Exit); keys.Add("reviewer", user); Reviewer = user; RaisePropertyChanged("Reviewer"); - System.Windows.Application.Current.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Send, new Action(() => - { + //System.Windows.Application.Current.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Send, new Action(() => + //{ _regionManager.RequestNavigate("MainRegion", "HomeWindow", keys); - })); + //})); } else @@ -295,10 +295,10 @@ _exitCommand ??= new DelegateCommand(Exit); keys.Add("operator", user); Operator = user; RaisePropertyChanged("Operator"); - System.Windows.Application.Current.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Send, new Action(() => - { + //System.Windows.Application.Current.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Send, new Action(() => + //{ _regionManager.RequestNavigate("MainRegion", "HomeWindow", keys); - })); + //})); } else @@ -364,10 +364,10 @@ _exitCommand ??= new DelegateCommand(Exit); void LoginEvent(FingerprintMsg msg) { logger.Info(msg.ToString()); - //if (msg.Message.Equals("CONNECT")) - //{ - // FingerMsg = !msg.Result; - //} + if (msg.Message.Equals("CONNECT")) + { + FingerMsg = !msg.Result; + } if (LoginBtnEnable) { if (msg.Message.Equals("LOGIN")) diff --git a/DM_Weight/ViewModels/MainWindowViewModel.cs b/DM_Weight/ViewModels/MainWindowViewModel.cs index fa4d1ff..a7196b9 100644 --- a/DM_Weight/ViewModels/MainWindowViewModel.cs +++ b/DM_Weight/ViewModels/MainWindowViewModel.cs @@ -64,23 +64,22 @@ namespace DM_Weight.ViewModels IRegionManager _regionManager; IUnityContainer _container; //private CHKFunction _cHKFunction; - public MainWindowViewModel(IRegionManager regionManager, IUnityContainer container, IEventAggregator eventAggregator, ScreenUtil screenUtil) + public MainWindowViewModel(IRegionManager regionManager, IUnityContainer container, IEventAggregator eventAggregator) { //_portUtil = portUtil; this.eventAggregator = eventAggregator; this.eventAggregator.GetEvent().Subscribe(doMyPrismEvent2); - _screenUtil = screenUtil; //_fingerprintUtil = fingerprintUtil; _regionManager = regionManager; _container = container; //_cHKFunction = cHKFunction; - System.Windows.Application.Current.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Send, new Action(() => - { + //System.Windows.Application.Current.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Send, new Action(() => + //{ _container.RegisterType("LoginWindow"); - _regionManager.RequestNavigate("MainRegion", "LoginWindow"); + _regionManager.RegisterViewWithRegion("MainRegion", "LoginWindow"); - })); + //})); } void doMyPrismEvent2(AlertMsg msg)