2025-07-19 11:11:01 +08:00
|
|
|
<ui:ContentDialog x:Class="DMS.WPF.Views.Dialogs.MqttDialog"
|
2025-07-04 22:39:44 +08:00
|
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
|
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
|
|
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
|
|
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
|
|
|
xmlns:ikw="http://schemas.inkore.net/lib/ui/wpf"
|
|
|
|
|
xmlns:ui="http://schemas.inkore.net/lib/ui/wpf/modern"
|
2025-07-18 19:56:00 +08:00
|
|
|
xmlns:vmd="clr-namespace:DMS.ViewModels.Dialogs"
|
|
|
|
|
xmlns:vc="clr-namespace:DMS.ValueConverts"
|
|
|
|
|
xmlns:ex="clr-namespace:DMS.Extensions"
|
2025-07-18 22:21:16 +08:00
|
|
|
xmlns:en="clr-namespace:DMS.Core.Enums"
|
2025-07-04 22:39:44 +08:00
|
|
|
Title="{Binding Title}"
|
|
|
|
|
CloseButtonText="取消"
|
|
|
|
|
DefaultButton="Primary"
|
|
|
|
|
PrimaryButtonText="{Binding PrimaryButContent}"
|
|
|
|
|
Background="#fff"
|
|
|
|
|
d:DataContext="{d:DesignInstance vmd:MqttDialogViewModel}"
|
|
|
|
|
mc:Ignorable="d">
|
|
|
|
|
<ui:ContentDialog.Resources>
|
2025-07-04 23:53:15 +08:00
|
|
|
<ex:EnumBindingSource x:Key="mqttPlatform"
|
|
|
|
|
EnumType="{x:Type en:MqttPlatform}" />
|
2025-07-04 22:39:44 +08:00
|
|
|
<vc:EnumDescriptionConverter x:Key="EnumDescriptionConverter" />
|
|
|
|
|
</ui:ContentDialog.Resources>
|
|
|
|
|
|
2025-07-04 23:53:15 +08:00
|
|
|
<Grid Width="480"
|
|
|
|
|
Margin="10">
|
2025-07-04 22:39:44 +08:00
|
|
|
<Grid.ColumnDefinitions>
|
|
|
|
|
<ColumnDefinition Width="1*" />
|
|
|
|
|
<ColumnDefinition Width="1*" />
|
|
|
|
|
</Grid.ColumnDefinitions>
|
|
|
|
|
<!-- 左边列 -->
|
2025-07-04 23:53:15 +08:00
|
|
|
<ikw:SimpleStackPanel Grid.Column="0"
|
|
|
|
|
Margin="10 10 20 10 "
|
|
|
|
|
Spacing="12">
|
2025-07-04 22:39:44 +08:00
|
|
|
<!-- MQTT名称 -->
|
2025-07-04 23:53:15 +08:00
|
|
|
<TextBlock Text="MQTT名称"
|
|
|
|
|
HorizontalAlignment="Left"
|
|
|
|
|
Style="{StaticResource TextBlockSubTitle}" />
|
2025-07-04 22:39:44 +08:00
|
|
|
<TextBox Text="{Binding Mqtt.Name, UpdateSourceTrigger=PropertyChanged}" />
|
|
|
|
|
<!-- MQTT IP地址 -->
|
2025-07-04 23:53:15 +08:00
|
|
|
<TextBlock Text="MQTT IP地址"
|
|
|
|
|
HorizontalAlignment="Left"
|
|
|
|
|
Style="{StaticResource TextBlockSubTitle}" />
|
|
|
|
|
<TextBox AcceptsReturn="True"
|
|
|
|
|
Text="{Binding Mqtt.Host, UpdateSourceTrigger=PropertyChanged}" />
|
2025-07-04 22:39:44 +08:00
|
|
|
|
|
|
|
|
<!-- Mqtt平台 -->
|
2025-07-04 23:53:15 +08:00
|
|
|
<TextBlock Text="Mqtt平台"
|
|
|
|
|
HorizontalAlignment="Left"
|
|
|
|
|
Style="{StaticResource TextBlockSubTitle}" />
|
|
|
|
|
<ComboBox SelectedItem="{Binding Mqtt.Platform}"
|
|
|
|
|
ItemsSource="{Binding Source={StaticResource mqttPlatform} }">
|
2025-07-04 22:39:44 +08:00
|
|
|
<ComboBox.ItemTemplate>
|
|
|
|
|
<DataTemplate>
|
|
|
|
|
<TextBlock Text="{Binding Converter={StaticResource EnumDescriptionConverter}}" />
|
|
|
|
|
</DataTemplate>
|
|
|
|
|
</ComboBox.ItemTemplate>
|
|
|
|
|
</ComboBox>
|
|
|
|
|
|
|
|
|
|
|
2025-07-04 23:53:15 +08:00
|
|
|
<!-- PublishTopic -->
|
|
|
|
|
<TextBlock Text="发布主题"
|
|
|
|
|
HorizontalAlignment="Left"
|
|
|
|
|
Style="{StaticResource TextBlockSubTitle}" />
|
|
|
|
|
<TextBox Text="{Binding Mqtt.PublishTopic, UpdateSourceTrigger=PropertyChanged}" />
|
|
|
|
|
|
|
|
|
|
<!-- SubTopics -->
|
|
|
|
|
<TextBlock Text="订阅主题"
|
|
|
|
|
HorizontalAlignment="Left"
|
|
|
|
|
Style="{StaticResource TextBlockSubTitle}" />
|
2025-07-15 11:03:33 +08:00
|
|
|
<TextBox Text="{Binding Mqtt.SubTopic, UpdateSourceTrigger=PropertyChanged}" />
|
2025-07-04 23:53:15 +08:00
|
|
|
<CheckBox FontSize="16"
|
|
|
|
|
Content="是否设为默认"
|
|
|
|
|
Margin="0 30 0 0"
|
|
|
|
|
IsChecked="{Binding Mqtt.IsDefault}" />
|
2025-07-04 22:39:44 +08:00
|
|
|
</ikw:SimpleStackPanel>
|
|
|
|
|
<!-- 右边列 -->
|
2025-07-04 23:53:15 +08:00
|
|
|
<ikw:SimpleStackPanel Margin="10"
|
|
|
|
|
Grid.Column="1"
|
|
|
|
|
Spacing="12">
|
2025-07-04 22:39:44 +08:00
|
|
|
|
|
|
|
|
<!-- MQTT备注 -->
|
2025-07-04 23:53:15 +08:00
|
|
|
<TextBlock Text="MQTT备注"
|
|
|
|
|
HorizontalAlignment="Left"
|
|
|
|
|
Style="{StaticResource TextBlockSubTitle}" />
|
2025-07-04 22:39:44 +08:00
|
|
|
<TextBox Text="{Binding Mqtt.Remark, UpdateSourceTrigger=PropertyChanged}" />
|
|
|
|
|
<!-- MQTT端口 -->
|
2025-07-04 23:53:15 +08:00
|
|
|
<TextBlock Text="MQTT端口"
|
|
|
|
|
HorizontalAlignment="Left"
|
|
|
|
|
Style="{StaticResource TextBlockSubTitle}" />
|
|
|
|
|
<TextBox AcceptsReturn="True"
|
|
|
|
|
Text="{Binding Mqtt.Port, UpdateSourceTrigger=PropertyChanged}" />
|
2025-07-04 22:39:44 +08:00
|
|
|
|
|
|
|
|
<!-- 用户名 -->
|
2025-07-04 23:53:15 +08:00
|
|
|
<TextBlock Text="用户名"
|
|
|
|
|
HorizontalAlignment="Left"
|
|
|
|
|
Style="{StaticResource TextBlockSubTitle}" />
|
2025-07-04 22:39:44 +08:00
|
|
|
<TextBox Text="{Binding Mqtt.UserName, UpdateSourceTrigger=PropertyChanged}" />
|
|
|
|
|
|
|
|
|
|
<!-- 密码 -->
|
2025-07-04 23:53:15 +08:00
|
|
|
<TextBlock Text="密码"
|
|
|
|
|
HorizontalAlignment="Left"
|
|
|
|
|
Style="{StaticResource TextBlockSubTitle}" />
|
2025-07-04 22:39:44 +08:00
|
|
|
<TextBox Text="{Binding Mqtt.PassWord, UpdateSourceTrigger=PropertyChanged}" />
|
|
|
|
|
|
2025-07-04 23:53:15 +08:00
|
|
|
<!-- ClientID -->
|
|
|
|
|
<TextBlock Text="ClientID"
|
|
|
|
|
HorizontalAlignment="Left"
|
|
|
|
|
Style="{StaticResource TextBlockSubTitle}" />
|
|
|
|
|
<TextBox Text="{Binding Mqtt.ClientID, UpdateSourceTrigger=PropertyChanged}" />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<CheckBox FontSize="16"
|
|
|
|
|
Content="是否启用"
|
|
|
|
|
Margin="0 30 0 0"
|
|
|
|
|
IsChecked="{Binding Mqtt.IsActive}" />
|
2025-07-04 22:39:44 +08:00
|
|
|
|
|
|
|
|
</ikw:SimpleStackPanel>
|
|
|
|
|
</Grid>
|
|
|
|
|
|
|
|
|
|
</ui:ContentDialog>
|