Browse Source

更新订单实时状态界面显示问题

master
fyf 2 years ago
parent
commit
f1c1c8b3a2
4 changed files with 25 additions and 12 deletions
  1. +3
    -1
      HBLConsole/View/MainView.xaml.cs
  2. +10
    -10
      HBLConsole/View/OrderStatusView.xaml
  3. +3
    -1
      HBLConsole/View/OrderStatusView.xaml.cs
  4. +9
    -0
      HBLConsole/ViewModel/OrderStatusViewModel.cs

+ 3
- 1
HBLConsole/View/MainView.xaml.cs View File

@@ -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();
}
}
}

+ 10
- 10
HBLConsole/View/OrderStatusView.xaml View File

@@ -12,9 +12,9 @@
Background="{x:Null}"
mc:Ignorable="d">

<UserControl.DataContext>
<!--<UserControl.DataContext>
<vm:OrderStatusViewModel />
</UserControl.DataContext>
</UserControl.DataContext>-->

<UserControl.Resources>
<SolidColorBrush x:Key="BorderSolid" Color="#5523CACA" />
@@ -142,13 +142,13 @@
Grid.Column="0"
Foreground="{Binding OrderStatus, Converter={StaticResource ColorConverter}}"
Style="{StaticResource TextBlockStyle}"
Text="{Binding SortNo}" />
Text="{Binding OrderPush.SortNum}" />

<Grid Grid.Column="1">
<TextBlock
Foreground="{Binding OrderStatus, Converter={StaticResource ColorConverter}}"
Style="{StaticResource TextBlockStyle}"
Text="{Binding GoodName}" />
Text="{Binding OrderPush.GoodsName}" />
<Border BorderBrush="{StaticResource BorderSolid}" BorderThickness="1,0,1,0" />
</Grid>

@@ -157,13 +157,13 @@
Grid.Column="2"
Foreground="{Binding OrderStatus, Converter={StaticResource ColorConverter}}"
Style="{StaticResource TextBlockStyle}"
Text="开始时间" />
Text="{Binding StartDate}" />

<Grid Grid.Column="3">
<TextBlock
Foreground="{Binding OrderStatus, Converter={StaticResource ColorConverter}}"
Style="{StaticResource TextBlockStyle}"
Text="结束时间" />
Text="{Binding EndDate}" />
<Border BorderBrush="{StaticResource BorderSolid}" BorderThickness="1,0,1,0" />
</Grid>

@@ -297,13 +297,13 @@
Grid.Column="0"
Foreground="{Binding OrderStatus, Converter={StaticResource ColorConverter}}"
Style="{StaticResource TextBlockStyle}"
Text="{Binding SortNo}" />
Text="{Binding OrderPush.SortNum}" />

<Grid Grid.Column="1">
<TextBlock
Foreground="{Binding OrderStatus, Converter={StaticResource ColorConverter}}"
Style="{StaticResource TextBlockStyle}"
Text="{Binding GoodName}" />
Text="{Binding OrderPush.GoodsName}" />
<Border BorderBrush="{StaticResource BorderSolid}" BorderThickness="1,0,1,0" />
</Grid>

@@ -312,13 +312,13 @@
Grid.Column="2"
Foreground="{Binding OrderStatus, Converter={StaticResource ColorConverter}}"
Style="{StaticResource TextBlockStyle}"
Text="开始时间" />
Text="{Binding StartDate}" />

<Grid Grid.Column="3">
<TextBlock
Foreground="{Binding OrderStatus, Converter={StaticResource ColorConverter}}"
Style="{StaticResource TextBlockStyle}"
Text="结束时间" />
Text="{Binding EndDate}" />
<Border BorderBrush="{StaticResource BorderSolid}" BorderThickness="1,0,1,0" />
</Grid>



+ 3
- 1
HBLConsole/View/OrderStatusView.xaml.cs View File

@@ -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();
}
}
}

+ 9
- 0
HBLConsole/ViewModel/OrderStatusViewModel.cs View File

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

Loading…
Cancel
Save