This commit is contained in:
sc committed 2024-09-05 22:51:41 +08:00
commit 1dfe10e93b
8 files changed
+186 -32

No files matched your search

+1 -1
View File
@@ -6,7 +6,7 @@
xmlns:local="clr-namespace:DyeingComputer.View"
xmlns:lang="clr-namespace:DyeingComputer.Properties"
xmlns:ConvertMoels="clr-namespace:DyeingComputer.ConvertMoels"
mc:Ignorable="d"
mc:Ignorable="d" Loaded="UserControl_Loaded"
d:DesignHeight="630" d:DesignWidth="1280" HorizontalAlignment="Left">
<UserControl.Resources>
<ConvertMoels:RowToIndexConverter x:Key="RowToIndexConverter"/>
+26
View File
@@ -15,6 +15,7 @@ using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Controls.Primitives;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
@@ -97,6 +98,31 @@ namespace DyeingComputer.View
}
}
private void UserControl_Loaded(object sender, RoutedEventArgs e)//打开页面时的操作
{
if (ID == null) ID = sql.Tables[0].Rows.Count.ToString();
Grid.SelectedIndex = StrToInt.To16Convert10(ID)-1;
}
public static T GetVisualChild<T>(Visual parent) where T : Visual
{
T child = default(T);
int numVisuals = VisualTreeHelper.GetChildrenCount(parent);
for (int i = 0; i < numVisuals; i++)
{
Visual v = (Visual)VisualTreeHelper.GetChild(parent, i);
child = v as T;
if (child == null)
{
child = GetVisualChild<T>(v);
}
if (child != null)
{
break;
}
}
return child;
}
private void ProgramgroupView_edit_Click(object sender, RoutedEventArgs e)//编辑
{
if(ID == null) ID = sql.Tables[0].Rows.Count.ToString();