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"
|
2025-09-06 12:03:39 +08:00
|
|
|
xmlns:hc="https://handyorg.github.io/handycontrol"
|
2025-07-04 22:39:44 +08:00
|
|
|
xmlns:ui="http://schemas.inkore.net/lib/ui/wpf/modern"
|
2025-07-26 10:05:43 +08:00
|
|
|
xmlns:vmd="clr-namespace:DMS.WPF.ViewModels.Dialogs"
|
2025-07-18 19:56:00 +08:00
|
|
|
xmlns:ex="clr-namespace:DMS.Extensions"
|
2025-07-26 10:05:43 +08:00
|
|
|
xmlns:enums="clr-namespace:DMS.Core.Enums;assembly=DMS.Core"
|
2025-07-27 22:35:07 +08:00
|
|
|
xmlns:valueConverts="clr-namespace:DMS.WPF.ValueConverts"
|
2025-07-04 22:39:44 +08:00
|
|
|
Title="{Binding Title}"
|
|
|
|
|
CloseButtonText="取消"
|
|
|
|
|
DefaultButton="Primary"
|
2025-08-23 16:01:30 +08:00
|
|
|
PrimaryButtonText="{Binding PrimaryButText}"
|
2025-09-06 12:03:39 +08:00
|
|
|
PrimaryButtonCommand="{Binding PrimaryButtonCommand}"
|
|
|
|
|
CloseButtonCommand="{Binding CancelButtonCommand}"
|
2025-07-04 22:39:44 +08:00
|
|
|
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"
|
2025-07-26 10:05:43 +08:00
|
|
|
EnumType="{x:Type enums:MqttPlatform}" />
|
2025-07-27 22:35:07 +08:00
|
|
|
<valueConverts:EnumDescriptionConverter x:Key="EnumDescriptionConverter" />
|
2025-09-06 12:03:39 +08:00
|
|
|
|
|
|
|
|
<Style x:Key="LabelStyle" TargetType="TextBlock">
|
|
|
|
|
<Setter Property="VerticalAlignment" Value="Center" />
|
|
|
|
|
<Setter Property="HorizontalAlignment" Value="Right" />
|
|
|
|
|
<Setter Property="Margin" Value="0,0,10,0" />
|
|
|
|
|
</Style>
|
2025-07-04 22:39:44 +08:00
|
|
|
</ui:ContentDialog.Resources>
|
|
|
|
|
|
2025-09-06 12:03:39 +08:00
|
|
|
<StackPanel Margin="16">
|
|
|
|
|
<!-- 基本信息 -->
|
|
|
|
|
<Grid>
|
|
|
|
|
<Grid.ColumnDefinitions>
|
|
|
|
|
<ColumnDefinition Width="*" />
|
|
|
|
|
<ColumnDefinition Width="20" />
|
|
|
|
|
<ColumnDefinition Width="*" />
|
|
|
|
|
</Grid.ColumnDefinitions>
|
|
|
|
|
<Grid.RowDefinitions>
|
|
|
|
|
<RowDefinition Height="Auto" />
|
|
|
|
|
<RowDefinition Height="Auto" />
|
|
|
|
|
<RowDefinition Height="Auto" />
|
|
|
|
|
<RowDefinition Height="Auto" />
|
|
|
|
|
<RowDefinition Height="Auto" />
|
|
|
|
|
</Grid.RowDefinitions>
|
2025-07-04 22:39:44 +08:00
|
|
|
|
2025-09-06 12:03:39 +08:00
|
|
|
<!-- Row 0 -->
|
|
|
|
|
<hc:TextBox
|
|
|
|
|
Grid.Row="0"
|
|
|
|
|
Grid.Column="0"
|
|
|
|
|
hc:InfoElement.Title="MQTT名称:"
|
|
|
|
|
Text="{Binding MqttServer.ServerName, UpdateSourceTrigger=PropertyChanged}" />
|
2025-07-04 22:39:44 +08:00
|
|
|
|
2025-09-06 12:03:39 +08:00
|
|
|
<hc:TextBox
|
|
|
|
|
Grid.Row="0"
|
|
|
|
|
Grid.Column="2"
|
|
|
|
|
hc:InfoElement.Title="客户端ID:"
|
|
|
|
|
Text="{Binding MqttServer.ClientId, UpdateSourceTrigger=PropertyChanged}" />
|
2025-07-04 22:39:44 +08:00
|
|
|
|
2025-09-06 12:03:39 +08:00
|
|
|
<hc:TextBox
|
|
|
|
|
Grid.Row="1"
|
|
|
|
|
Grid.Column="0"
|
|
|
|
|
Margin="0,15,0,0"
|
2025-09-06 13:19:20 +08:00
|
|
|
hc:InfoElement.Title="服务器地址:"
|
2025-09-06 12:03:39 +08:00
|
|
|
Text="{Binding MqttServer.ServerUrl, UpdateSourceTrigger=PropertyChanged}" />
|
2025-07-04 23:53:15 +08:00
|
|
|
|
2025-09-06 12:03:39 +08:00
|
|
|
<hc:TextBox
|
|
|
|
|
Grid.Row="1"
|
|
|
|
|
Grid.Column="2"
|
|
|
|
|
Margin="0,15,0,0"
|
|
|
|
|
hc:InfoElement.Title="端口:"
|
|
|
|
|
Text="{Binding MqttServer.Port, UpdateSourceTrigger=PropertyChanged}" />
|
2025-07-04 22:39:44 +08:00
|
|
|
|
2025-09-06 12:03:39 +08:00
|
|
|
<!-- Row 2 -->
|
|
|
|
|
<hc:TextBox
|
|
|
|
|
Grid.Row="2"
|
|
|
|
|
Grid.Column="0"
|
|
|
|
|
Margin="0,15,0,0"
|
|
|
|
|
hc:InfoElement.Title="用户名:"
|
|
|
|
|
Text="{Binding MqttServer.Username, UpdateSourceTrigger=PropertyChanged}" />
|
2025-07-04 22:39:44 +08:00
|
|
|
|
2025-09-06 12:03:39 +08:00
|
|
|
<hc:TextBox
|
|
|
|
|
Grid.Row="2"
|
|
|
|
|
Grid.Column="2"
|
|
|
|
|
Margin="0,15,0,0"
|
|
|
|
|
hc:InfoElement.Title="密码:"
|
|
|
|
|
Text="{Binding MqttServer.Password, UpdateSourceTrigger=PropertyChanged}" />
|
2025-07-04 22:39:44 +08:00
|
|
|
|
2025-09-06 12:03:39 +08:00
|
|
|
<!-- Row 3 -->
|
|
|
|
|
<hc:TextBox
|
|
|
|
|
Grid.Row="3"
|
|
|
|
|
Grid.Column="0"
|
|
|
|
|
Margin="0,15,0,0"
|
|
|
|
|
hc:InfoElement.Title="发布主题:"
|
|
|
|
|
Text="{Binding MqttServer.PublishTopic, UpdateSourceTrigger=PropertyChanged}" />
|
2025-07-04 22:39:44 +08:00
|
|
|
|
2025-09-06 12:03:39 +08:00
|
|
|
<hc:TextBox
|
|
|
|
|
Grid.Row="3"
|
|
|
|
|
Grid.Column="2"
|
|
|
|
|
Margin="0,15,0,0"
|
|
|
|
|
hc:InfoElement.Title="订阅主题:"
|
|
|
|
|
Text="{Binding MqttServer.SubscribeTopic, UpdateSourceTrigger=PropertyChanged}" />
|
2025-07-04 22:39:44 +08:00
|
|
|
|
2025-09-06 12:03:39 +08:00
|
|
|
<!-- Row 4 -->
|
|
|
|
|
<CheckBox
|
|
|
|
|
Grid.Row="4"
|
|
|
|
|
Grid.Column="0"
|
|
|
|
|
Margin="0,20,0,0"
|
|
|
|
|
Content="是否启用"
|
|
|
|
|
IsChecked="{Binding MqttServer.IsActive}" />
|
|
|
|
|
</Grid>
|
|
|
|
|
</StackPanel>
|
2025-07-04 22:39:44 +08:00
|
|
|
</ui:ContentDialog>
|