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 } }