修复添加设备时选择通讯协议,界面也跟着跟新
This commit is contained in:
@@ -6,7 +6,6 @@
|
||||
xmlns:ikw="http://schemas.inkore.net/lib/ui/wpf"
|
||||
xmlns:ui="http://schemas.inkore.net/lib/ui/wpf/modern"
|
||||
xmlns:vmd="clr-namespace:DMS.WPF.ViewModels.Dialogs"
|
||||
xmlns:vc="clr-namespace:DMS.ValueConverts"
|
||||
xmlns:ex="clr-namespace:DMS.Extensions"
|
||||
xmlns:en="clr-namespace:DMS.Core.Enums"
|
||||
Title="{Binding Title}"
|
||||
|
||||
@@ -6,10 +6,10 @@
|
||||
xmlns:ikw="http://schemas.inkore.net/lib/ui/wpf"
|
||||
xmlns:ui="http://schemas.inkore.net/lib/ui/wpf/modern"
|
||||
xmlns:vmd="clr-namespace:DMS.WPF.ViewModels.Dialogs"
|
||||
xmlns:vc="clr-namespace:DMS.ValueConverts"
|
||||
xmlns:ex="clr-namespace:DMS.Extensions"
|
||||
xmlns:enums="clr-namespace:DMS.Core.Enums;assembly=DMS.Core"
|
||||
xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
|
||||
xmlns:vc="clr-namespace:DMS.WPF.ValueConverts"
|
||||
Title="{Binding Title}"
|
||||
CloseButtonText="取消"
|
||||
DefaultButton="Primary"
|
||||
@@ -34,6 +34,7 @@
|
||||
<ex:EnumBindingSource x:Key="cpuType"
|
||||
EnumType="{x:Type enums:CpuType}" />
|
||||
<vc:EnumDescriptionConverter x:Key="EnumDescriptionConverter" />
|
||||
<vc:EnumToStringConverter x:Key="EnumToStringConverter" />
|
||||
|
||||
|
||||
</ui:ContentDialog.Resources>
|
||||
@@ -61,17 +62,17 @@
|
||||
Text="{Binding Device.IpAddress, UpdateSourceTrigger=PropertyChanged}" />
|
||||
|
||||
<!-- 设备类型 -->
|
||||
<!-- <TextBlock Text="设备类型" -->
|
||||
<!-- HorizontalAlignment="Left" -->
|
||||
<!-- Style="{StaticResource TextBlockSubTitle}" /> -->
|
||||
<!-- <ComboBox SelectedItem="{Binding Device}" -->
|
||||
<!-- ItemsSource="{Binding Source={StaticResource deviceType} }"> -->
|
||||
<!-- <ComboBox.ItemTemplate> -->
|
||||
<!-- <DataTemplate> -->
|
||||
<!-- <TextBlock Text="{Binding Converter={StaticResource EnumDescriptionConverter}}" /> -->
|
||||
<!-- </DataTemplate> -->
|
||||
<!-- </ComboBox.ItemTemplate> -->
|
||||
<!-- </ComboBox> -->
|
||||
<TextBlock Text="设备类型"
|
||||
HorizontalAlignment="Left"
|
||||
Style="{StaticResource TextBlockSubTitle}" />
|
||||
<ComboBox SelectedItem="{Binding Device}"
|
||||
ItemsSource="{Binding Source={StaticResource deviceType} }">
|
||||
<ComboBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding Converter={StaticResource EnumDescriptionConverter}}" />
|
||||
</DataTemplate>
|
||||
</ComboBox.ItemTemplate>
|
||||
</ComboBox>
|
||||
|
||||
<CheckBox FontSize="16"
|
||||
Content="是否添加默认变量表"
|
||||
@@ -101,7 +102,7 @@
|
||||
<TextBlock Text="设备通信协议"
|
||||
HorizontalAlignment="Left"
|
||||
Style="{StaticResource TextBlockSubTitle}" />
|
||||
<ComboBox SelectedItem="{Binding Device.Protocol}"
|
||||
<ComboBox x:Name="ProtocolComboBox" SelectedItem="{Binding Device.Protocol}"
|
||||
ItemsSource="{Binding Source={StaticResource protocolType} }">
|
||||
<ComboBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
@@ -109,14 +110,15 @@
|
||||
</DataTemplate>
|
||||
</ComboBox.ItemTemplate>
|
||||
</ComboBox>
|
||||
|
||||
|
||||
<!-- S7 Specific Properties -->
|
||||
<StackPanel x:Name="S7PropertiesPanel" Visibility="Visible" Background="LightGray">
|
||||
<StackPanel x:Name="S7PropertiesPanel" Background="LightGray">
|
||||
<StackPanel.Style>
|
||||
<Style TargetType="StackPanel">
|
||||
<Setter Property="Visibility" Value="Collapsed" />
|
||||
<Style.Triggers>
|
||||
<DataTrigger Binding="{Binding Device.Protocol}"
|
||||
Value="{x:Static enums:ProtocolType.S7}">
|
||||
<DataTrigger Binding="{Binding ElementName=ProtocolComboBox, Path=SelectedItem, Converter={StaticResource EnumToStringConverter}}"
|
||||
Value="S7">
|
||||
<Setter Property="Visibility" Value="Visible" />
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:controls="http://schemas.inkore.net/lib/ui/wpf/modern"
|
||||
xmlns:vm="clr-namespace:DMS.WPF.ViewModels.Dialogs"
|
||||
xmlns:vc="clr-namespace:DMS.ValueConverts"
|
||||
xmlns:valueConverts="clr-namespace:DMS.WPF.ValueConverts"
|
||||
mc:Ignorable="d"
|
||||
d:DataContext="{d:DesignInstance vm:IsActiveDialogViewModel}"
|
||||
Title="修改激活状态"
|
||||
@@ -14,7 +14,7 @@
|
||||
PrimaryButtonClick="ContentDialog_PrimaryButtonClick"
|
||||
SecondaryButtonClick="ContentDialog_SecondaryButtonClick">
|
||||
<controls:ContentDialog.Resources>
|
||||
<vc:NullableBooleanConverter x:Key="NullableBooleanConverter" />
|
||||
<valueConverts:NullableBooleanConverter x:Key="NullableBooleanConverter" />
|
||||
</controls:ContentDialog.Resources>
|
||||
<Grid>
|
||||
<StackPanel Orientation="Vertical" Margin="10">
|
||||
|
||||
@@ -6,10 +6,10 @@
|
||||
xmlns:ikw="http://schemas.inkore.net/lib/ui/wpf"
|
||||
xmlns:ui="http://schemas.inkore.net/lib/ui/wpf/modern"
|
||||
xmlns:vmd="clr-namespace:DMS.WPF.ViewModels.Dialogs"
|
||||
xmlns:vc="clr-namespace:DMS.ValueConverts"
|
||||
xmlns:ex="clr-namespace:DMS.Extensions"
|
||||
xmlns:en="clr-namespace:DMS.Core.Enums"
|
||||
xmlns:enums="clr-namespace:DMS.Core.Enums;assembly=DMS.Core"
|
||||
xmlns:valueConverts="clr-namespace:DMS.WPF.ValueConverts"
|
||||
Title="{Binding Title}"
|
||||
CloseButtonText="取消"
|
||||
DefaultButton="Primary"
|
||||
@@ -20,7 +20,7 @@
|
||||
<ui:ContentDialog.Resources>
|
||||
<ex:EnumBindingSource x:Key="mqttPlatform"
|
||||
EnumType="{x:Type enums:MqttPlatform}" />
|
||||
<vc:EnumDescriptionConverter x:Key="EnumDescriptionConverter" />
|
||||
<valueConverts:EnumDescriptionConverter x:Key="EnumDescriptionConverter" />
|
||||
</ui:ContentDialog.Resources>
|
||||
|
||||
<Grid Width="480"
|
||||
|
||||
@@ -6,14 +6,14 @@
|
||||
xmlns:enums="clr-namespace:DMS.Core.Enums"
|
||||
xmlns:extensions="clr-namespace:DMS.Extensions"
|
||||
xmlns:ui="http://schemas.inkore.net/lib/ui/wpf/modern"
|
||||
xmlns:vc="clr-namespace:DMS.ValueConverts"
|
||||
xmlns:valueConverts="clr-namespace:DMS.WPF.ValueConverts"
|
||||
mc:Ignorable="d"
|
||||
Title="修改轮询频率"
|
||||
PrimaryButtonText="确定"
|
||||
CloseButtonText="取消"
|
||||
d:DesignHeight="150" d:DesignWidth="300">
|
||||
<ui:ContentDialog.Resources>
|
||||
<vc:EnumDescriptionConverter x:Key="EnumDescriptionConverter" />
|
||||
<valueConverts:EnumDescriptionConverter x:Key="EnumDescriptionConverter" />
|
||||
</ui:ContentDialog.Resources>
|
||||
<Grid>
|
||||
<ComboBox
|
||||
|
||||
@@ -6,11 +6,11 @@
|
||||
xmlns:ikw="http://schemas.inkore.net/lib/ui/wpf"
|
||||
xmlns:ui="http://schemas.inkore.net/lib/ui/wpf/modern"
|
||||
xmlns:vmd="clr-namespace:DMS.WPF.ViewModels.Dialogs"
|
||||
xmlns:vc="clr-namespace:DMS.ValueConverts"
|
||||
xmlns:ex="clr-namespace:DMS.Extensions"
|
||||
xmlns:en="clr-namespace:DMS.Core.Enums"
|
||||
xmlns:sockets="clr-namespace:System.Net.Sockets;assembly=System.Net.Sockets"
|
||||
xmlns:enums="clr-namespace:DMS.Core.Enums;assembly=DMS.Core"
|
||||
xmlns:valueConverts="clr-namespace:DMS.WPF.ValueConverts"
|
||||
Title="{Binding Title}"
|
||||
CloseButtonText="取消"
|
||||
DefaultButton="Primary"
|
||||
@@ -19,7 +19,7 @@
|
||||
d:DataContext="{d:DesignInstance vmd:VarDataDialogViewModel}"
|
||||
mc:Ignorable="d">
|
||||
<ui:ContentDialog.Resources>
|
||||
<vc:EnumDescriptionConverter x:Key="EnumDescriptionConverter" />
|
||||
<valueConverts:EnumDescriptionConverter x:Key="EnumDescriptionConverter" />
|
||||
</ui:ContentDialog.Resources>
|
||||
|
||||
<Grid Margin="10" Width="480">
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
xmlns:ikw="http://schemas.inkore.net/lib/ui/wpf"
|
||||
xmlns:ui="http://schemas.inkore.net/lib/ui/wpf/modern"
|
||||
xmlns:vmd="clr-namespace:DMS.WPF.ViewModels.Dialogs"
|
||||
xmlns:vc="clr-namespace:DMS.ValueConverts"
|
||||
xmlns:ex="clr-namespace:DMS.Extensions"
|
||||
xmlns:en="clr-namespace:DMS.Core.Enums"
|
||||
Title="{Binding Title}"
|
||||
|
||||
Reference in New Issue
Block a user