From f1c1c8b3a289c5c5581b015d22d700276fedf277 Mon Sep 17 00:00:00 2001 From: fyf <11621@LAPTOP-04QQU0AO> Date: Fri, 18 Mar 2022 13:11:01 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E8=AE=A2=E5=8D=95=E5=AE=9E?= =?UTF-8?q?=E6=97=B6=E7=8A=B6=E6=80=81=E7=95=8C=E9=9D=A2=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- HBLConsole/View/MainView.xaml.cs | 4 +++- HBLConsole/View/OrderStatusView.xaml | 20 ++++++++++---------- HBLConsole/View/OrderStatusView.xaml.cs | 4 +++- HBLConsole/ViewModel/OrderStatusViewModel.cs | 9 +++++++++ 4 files changed, 25 insertions(+), 12 deletions(-) diff --git a/HBLConsole/View/MainView.xaml.cs b/HBLConsole/View/MainView.xaml.cs index 1ccc759..28e9dec 100644 --- a/HBLConsole/View/MainView.xaml.cs +++ b/HBLConsole/View/MainView.xaml.cs @@ -1,4 +1,5 @@ -using System; +using HBLConsole.ViewModel; +using System; using System.Collections.Generic; using System.Linq; using System.Text; @@ -38,6 +39,7 @@ namespace HBLConsole.View } this.DragMove(); }; + OrderStatusViewModel.GetInstance(); } } } diff --git a/HBLConsole/View/OrderStatusView.xaml b/HBLConsole/View/OrderStatusView.xaml index d5debd6..e919bf6 100644 --- a/HBLConsole/View/OrderStatusView.xaml +++ b/HBLConsole/View/OrderStatusView.xaml @@ -12,9 +12,9 @@ Background="{x:Null}" mc:Ignorable="d"> - + @@ -142,13 +142,13 @@ Grid.Column="0" Foreground="{Binding OrderStatus, Converter={StaticResource ColorConverter}}" Style="{StaticResource TextBlockStyle}" - Text="{Binding SortNo}" /> + Text="{Binding OrderPush.SortNum}" /> + Text="{Binding OrderPush.GoodsName}" /> @@ -157,13 +157,13 @@ Grid.Column="2" Foreground="{Binding OrderStatus, Converter={StaticResource ColorConverter}}" Style="{StaticResource TextBlockStyle}" - Text="开始时间" /> + Text="{Binding StartDate}" /> + Text="{Binding EndDate}" /> @@ -297,13 +297,13 @@ Grid.Column="0" Foreground="{Binding OrderStatus, Converter={StaticResource ColorConverter}}" Style="{StaticResource TextBlockStyle}" - Text="{Binding SortNo}" /> + Text="{Binding OrderPush.SortNum}" /> + Text="{Binding OrderPush.GoodsName}" /> @@ -312,13 +312,13 @@ Grid.Column="2" Foreground="{Binding OrderStatus, Converter={StaticResource ColorConverter}}" Style="{StaticResource TextBlockStyle}" - Text="开始时间" /> + Text="{Binding StartDate}" /> + Text="{Binding EndDate}" /> diff --git a/HBLConsole/View/OrderStatusView.xaml.cs b/HBLConsole/View/OrderStatusView.xaml.cs index aa66e03..943da12 100644 --- a/HBLConsole/View/OrderStatusView.xaml.cs +++ b/HBLConsole/View/OrderStatusView.xaml.cs @@ -1,4 +1,5 @@ -using System; +using HBLConsole.ViewModel; +using System; using System.Collections.Generic; using System.Linq; using System.Text; @@ -23,6 +24,7 @@ namespace HBLConsole.View public OrderStatusView() { InitializeComponent(); + this.DataContext = OrderStatusViewModel.GetInstance(); } } } diff --git a/HBLConsole/ViewModel/OrderStatusViewModel.cs b/HBLConsole/ViewModel/OrderStatusViewModel.cs index e3a7103..1df7a72 100644 --- a/HBLConsole/ViewModel/OrderStatusViewModel.cs +++ b/HBLConsole/ViewModel/OrderStatusViewModel.cs @@ -9,10 +9,19 @@ namespace HBLConsole.ViewModel { public class OrderStatusViewModel : ViewModelBase { + #region 不需要监听 + private static OrderStatusViewModel _instance; + public static OrderStatusViewModel GetInstance() + { + if (_instance == null) + _instance = new OrderStatusViewModel(); + return _instance; + } public OrderStatusViewModel() { MqttReceive(); WindowName = "订单状态"; } + #endregion } }