From 1c5abf3484eade80e849360aa6491fbf23286a1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A6=82=E6=84=8F=20=E5=BD=AD?= <2417589739@qq.com> Date: Wed, 16 Nov 2022 11:06:45 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B6=88=E6=81=AF=E6=97=A5=E5=BF=97=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Pages/ViewModel/MainViewModel.cs | 34 +++++++++++++++++++ .../App.xaml.cs | 2 +- 2 files changed, 35 insertions(+), 1 deletion(-) diff --git a/BPASmartClient.CustomResource/Pages/ViewModel/MainViewModel.cs b/BPASmartClient.CustomResource/Pages/ViewModel/MainViewModel.cs index e2d6bde9..a1a4ddf9 100644 --- a/BPASmartClient.CustomResource/Pages/ViewModel/MainViewModel.cs +++ b/BPASmartClient.CustomResource/Pages/ViewModel/MainViewModel.cs @@ -20,6 +20,40 @@ namespace BPASmartClient.CustomResource.Pages.ViewModel public MainViewModel() { NavChangedCommand = new RelayCommand(DoNavChanged); + BPASmartClient.Message. MessageLog.GetInstance.InfoNotify = new Action((o) => + { + Application.Current?.Dispatcher?.Invoke(() => + { + //ff20aefe + var temp = new MessageModel() + { + LogInfo = o, + Forground = new SolidColorBrush(Color.FromArgb(255, 32, 174, 254)) + }; + if (DebugLogViewModel.MessageModels.Count > 0) + DebugLogViewModel.MessageModels.Insert(0, temp); + else + DebugLogViewModel.MessageModels.Add(temp); + }); + }); + + BPASmartClient.Message.MessageLog.GetInstance.ExInfoNotify = new Action((o) => + { + Application.Current?.Dispatcher?.Invoke(() => + { + //FFF53F62 + var temp = new MessageModel() + { + LogInfo = o, + Forground = new SolidColorBrush(Color.FromArgb(255, 245, 63, 98)) + }; + if (DebugLogViewModel.MessageModels.Count > 0) + DebugLogViewModel.MessageModels.Insert(0, temp); + else + DebugLogViewModel.MessageModels.Add(temp); + }); + }); + BPA.Helper.MessageLog.GetInstance.NotifyShow = new Action((o) => { Application.Current?.Dispatcher?.Invoke(() => diff --git a/BPASmartClient.JXJFoodSmallStation/App.xaml.cs b/BPASmartClient.JXJFoodSmallStation/App.xaml.cs index e5787289..c658c57b 100644 --- a/BPASmartClient.JXJFoodSmallStation/App.xaml.cs +++ b/BPASmartClient.JXJFoodSmallStation/App.xaml.cs @@ -29,8 +29,8 @@ namespace BPASmartClient.JXJFoodSmallStation MenuInit(); DataInit(); //DeviceInquire.GetInstance.Init();//配料机设备上线监听,设备列表初始化 - ProcessControl.GetInstance.Init(); MainView mv = new MainView(); + ProcessControl.GetInstance.Init(); LoginView lv = new LoginView(); var res = lv.ShowDialog(); if (res != null && res == true)