diff --git a/29WxOrderWpf/MainWindow.xaml b/29WxOrderWpf/MainWindow.xaml
index a610684..118a27e 100644
--- a/29WxOrderWpf/MainWindow.xaml
+++ b/29WxOrderWpf/MainWindow.xaml
@@ -4,22 +4,59 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:_29WxOrderWpf"
- mc:Ignorable="d" WindowStyle="None" AllowsTransparency="True" Background="Transparent"
+ mc:Ignorable="d" WindowStyle="None" AllowsTransparency="True" Background="Transparent" FontSize="12" Foreground="#FF666666"
Title="MainWindow" Height="450" Width="800" WindowStartupLocation="CenterScreen" Loaded="Window_Loaded">
+
+
-
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
+
+
+
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -65,9 +103,91 @@
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/29WxOrderWpf/MainWindow.xaml.cs b/29WxOrderWpf/MainWindow.xaml.cs
index a1bfe4f..00681a9 100644
--- a/29WxOrderWpf/MainWindow.xaml.cs
+++ b/29WxOrderWpf/MainWindow.xaml.cs
@@ -1,6 +1,8 @@
using AllBase;
+using AllBase.Extension;
using AllBase.Model;
using NaiBa.Util;
+using NaiBa.Util.Extension;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
@@ -24,11 +26,13 @@ namespace _29WxOrderWpf
///
public partial class MainWindow : Window
{
- public ObservableCollection lstOrder = new ObservableCollection();
+ public ObservableCollection lstOrder { get; set; } = new ObservableCollection();
+ public List lstOrder1 { get; set; } = new List();
public MainWindow()
{
InitializeComponent();
+ //DataContext = this;
this.Height = 800;
this.Width = 1600;
@@ -42,10 +46,14 @@ namespace _29WxOrderWpf
//dgOrder.Items.Add(1111111);
dgOrder.ItemsSource = lstOrder;
+
+ lbxOrder.ItemsSource = lstOrder;
for (int i = 0; i < 10000; i++)
{
- lstOrder.Add(new oms_wei_order_info() { id = 1, is_select = false, order_id = "3737033423685556736 " + Randomx.GetId(1000, 10000), shop_name = "媛卡曦工厂优选" });
+ //lstOrder.Add(new oms_wei_order_info() { id = 1, is_select = false, order_id = ("3737033423685556736".ParseToLong() + Randomx.GetId(0,100)).ParseToString(), shop_name = "媛卡曦工厂优选" });
+ lstOrder.Add(new oms_wei_order_info() { id = 1, is_select = false, order_id = Randomx.GetId(1000,10000).ParseToString(), shop_name = "媛卡曦工厂优选" });
}
+ lstOrder.SortDesc(o => o.order_id.ParseToLong());
}
private void btnClose_Click(object sender, RoutedEventArgs e)
@@ -53,9 +61,10 @@ namespace _29WxOrderWpf
this.Close();
}
- private void Button_Click(object sender, RoutedEventArgs e)
+ private void Path_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
-
+ var orderId = ((sender as Border)?.Tag).ParseToString();
+ Clipboard.SetText(orderId);
}
}
}
diff --git a/AllBase/29WxOrderAllBase.csproj b/AllBase/29WxOrderAllBase.csproj
index 1fd21d3..f8f39ea 100644
--- a/AllBase/29WxOrderAllBase.csproj
+++ b/AllBase/29WxOrderAllBase.csproj
@@ -126,6 +126,7 @@
+
diff --git a/AllBase/Extension/SortExtension.cs b/AllBase/Extension/SortExtension.cs
new file mode 100644
index 0000000..b230236
--- /dev/null
+++ b/AllBase/Extension/SortExtension.cs
@@ -0,0 +1,36 @@
+using System;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace AllBase.Extension
+{
+ public static class SortExtension
+ {
+ public static void Sort(this ObservableCollection collection, Func keySelector)
+ {
+ var sortedList = collection.OrderBy(keySelector).ToList();
+ for (int i = 0; i < collection.Count; i++)
+ {
+ if (!Equals(collection[i], sortedList[i]))
+ {
+ collection.Move(collection.IndexOf(sortedList[i]), i);
+ }
+ }
+ }
+
+ public static void SortDesc(this ObservableCollection collection, Func keySelector)
+ {
+ var sortedList = collection.OrderByDescending(keySelector).ToList();
+ for (int i = 0; i < collection.Count; i++)
+ {
+ if (!Equals(collection[i], sortedList[i]))
+ {
+ collection.Move(collection.IndexOf(sortedList[i]), i);
+ }
+ }
+ }
+ }
+}
diff --git a/AllBase/Model/oms_wei_order_info.cs b/AllBase/Model/oms_wei_order_info.cs
index 2e12ccb..f5640a3 100644
--- a/AllBase/Model/oms_wei_order_info.cs
+++ b/AllBase/Model/oms_wei_order_info.cs
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
+using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;