调整wpf的界面显示样式

This commit is contained in:
wule committed 2026-06-15 01:25:14 +08:00
1 parent e3027e5fa8
commit d03a1e1466
5 files changed
+191 -24

No files matched your search

+1
View File
@@ -126,6 +126,7 @@
<Compile Include="DouYinModel\Result\DouSubAccountModel.cs" />
<Compile Include="DouYinModel\Result\DouYinAfterSaleOrderModel.cs" />
<Compile Include="DouYinModel\Result\DouYinOrderModel.cs" />
<Compile Include="Extension\SortExtension.cs" />
<Compile Include="FileBase.cs" />
<Compile Include="GetHtml.cs" />
<Compile Include="Helper\GlobalConfig.cs" />
+36
View File
@@ -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<T>(this ObservableCollection<T> collection, Func<T, object> 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<T>(this ObservableCollection<T> collection, Func<T, object> 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);
}
}
}
}
}
+1
View File
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;