将PollLevelType类型改为int类型

This commit is contained in:
2025-09-05 19:59:21 +08:00
parent 8b86f079e5
commit 6e123b47cc
16 changed files with 88 additions and 146 deletions

View File

@@ -24,7 +24,7 @@
SelectedItem="{Binding SelectedPollLevelType}">
<ComboBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding Converter={StaticResource EnumDescriptionConverter}}" />
<TextBlock Text="{Binding}" />
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>

View File

@@ -24,7 +24,6 @@
<valueConverts:EnumToStringConverter x:Key="EnumToStringConverter" />
<ex:EnumBindingSource x:Key="ProtocolType" EnumType="{x:Type en:ProtocolType}" />
<ex:EnumBindingSource x:Key="SignalType" EnumType="{x:Type enums:SignalType}" />
<ex:EnumBindingSource x:Key="PollLevelType" EnumType="{x:Type enums:PollLevelType}" />
<ex:EnumBindingSource x:Key="CSharpDataType" EnumType="{x:Type enums:DataType}" />
</ui:ContentDialog.Resources>
@@ -145,19 +144,15 @@
</ComboBox.ItemTemplate>
</hc:ComboBox>
<hc:ComboBox
<hc:TextBox
Grid.Row="2"
Grid.Column="0"
Margin="0,15,0,0"
hc:InfoElement.Title="轮询级别:"
ItemsSource="{Binding Source={StaticResource PollLevelType}}"
SelectedItem="{Binding Variable.PollLevel, UpdateSourceTrigger=PropertyChanged}">
<ComboBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding Converter={StaticResource EnumDescriptionConverter}}" />
</DataTemplate>
</ComboBox.ItemTemplate>
</hc:ComboBox>
Text="{Binding PollLevel}"
>
</hc:TextBox>
<hc:ComboBox
Grid.Row="2"

View File

@@ -22,7 +22,6 @@
<ex:BindingProxy x:Key="proxy" Data="{Binding}" />
<ex:EnumBindingSource x:Key="signalType" EnumType="{x:Type enums:SignalType}" />
<valueConverts:EnumDescriptionConverter x:Key="EnumDescriptionConverter" />
<ex:EnumBindingSource x:Key="pollLevelType" EnumType="{x:Type enums:PollLevelType}" />
<BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />
<!-- 标签字体的样式 -->
@@ -269,23 +268,12 @@
</DataTemplate>
</DataGridTemplateColumn.CellEditingTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn Header="轮询频率" SortMemberPath="PollLevelType">
<DataGridTemplateColumn Header="轮询频率" SortMemberPath="PollLevel">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock Text="{Binding PollLevel, Converter={StaticResource EnumDescriptionConverter}}" />
<TextBlock Text="{Binding PollLevel}" />
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
<DataGridTemplateColumn.CellEditingTemplate>
<DataTemplate>
<ComboBox ItemsSource="{Binding Source={StaticResource pollLevelType}}" SelectedItem="{Binding PollLevel}">
<ComboBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding Converter={StaticResource EnumDescriptionConverter}}" />
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
</DataTemplate>
</DataGridTemplateColumn.CellEditingTemplate>
</DataGridTemplateColumn>
<DataGridTextColumn