This commit is contained in:
sc committed 2024-08-23 23:13:47 +08:00
commit 7a1dc7b9e0
12 files changed
+154 -28

No files matched your search

+32
View File
@@ -0,0 +1,32 @@
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Controls;
using System.Windows.Data;
namespace DyeingComputer.ConvertMoels
{
/// <summary>
/// 序号转换器
/// 获取DataGrid的行号 , 转换为对应的序号
/// </summary>
internal class RowToIndexConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
DataGridRow row = value as DataGridRow;
if (row != null)
return row.GetIndex() + 1;
else
return -1;
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
}