2025-09-06 19:10:25 +08:00
|
|
|
|
<ui:ContentDialog x:Class="DMS.WPF.Views.Dialogs.MqttAliasBatchEditDialog"
|
|
|
|
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
|
|
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
|
|
|
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
|
|
|
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
|
|
|
|
xmlns:ui="http://schemas.inkore.net/lib/ui/wpf/modern"
|
|
|
|
|
|
xmlns:vm="clr-namespace:DMS.WPF.ViewModels.Dialogs"
|
|
|
|
|
|
d:DataContext="{d:DesignInstance vm:MqttAliasBatchEditDialogViewModel}"
|
|
|
|
|
|
Title="批量编辑MQTT别名"
|
|
|
|
|
|
PrimaryButtonText="确定"
|
|
|
|
|
|
CloseButtonText="取消"
|
|
|
|
|
|
PrimaryButtonCommand="{Binding ConfirmCommand}"
|
|
|
|
|
|
CloseButtonCommand="{Binding CloseCommand}"
|
|
|
|
|
|
DefaultButton="Primary"
|
|
|
|
|
|
Background="White"
|
|
|
|
|
|
mc:Ignorable="d"
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
|
|
|
|
<Grid>
|
|
|
|
|
|
<Grid.RowDefinitions>
|
|
|
|
|
|
<RowDefinition Height="Auto" />
|
|
|
|
|
|
<RowDefinition Height="Auto" />
|
|
|
|
|
|
<RowDefinition Height="*" />
|
|
|
|
|
|
<RowDefinition Height="Auto" />
|
|
|
|
|
|
</Grid.RowDefinitions>
|
|
|
|
|
|
|
|
|
|
|
|
<TextBlock Grid.Row="0"
|
|
|
|
|
|
Text="为目标MQTT服务器设置变量别名:"
|
|
|
|
|
|
Margin="0,0,0,10"
|
|
|
|
|
|
Style="{StaticResource BodyTextBlockStyle}" />
|
|
|
|
|
|
|
|
|
|
|
|
<StackPanel Grid.Row="1" Orientation="Horizontal" Margin="0,0,0,10">
|
|
|
|
|
|
<TextBlock Text="MQTT服务器:" VerticalAlignment="Center" />
|
|
|
|
|
|
<TextBlock Text="{Binding SelectedMqttServer.ServerName}"
|
|
|
|
|
|
FontWeight="Bold"
|
2025-09-06 19:41:28 +08:00
|
|
|
|
FontSize="16"
|
2025-09-06 19:10:25 +08:00
|
|
|
|
Margin="5,0,0,0"
|
|
|
|
|
|
VerticalAlignment="Center" />
|
|
|
|
|
|
</StackPanel>
|
|
|
|
|
|
|
|
|
|
|
|
<DataGrid Grid.Row="2"
|
2025-10-07 19:04:30 +08:00
|
|
|
|
ItemsSource="{Binding CurrentMqttAliases}"
|
2025-07-17 17:27:16 +08:00
|
|
|
|
AutoGenerateColumns="False"
|
|
|
|
|
|
CanUserAddRows="False"
|
|
|
|
|
|
CanUserDeleteRows="False"
|
2025-09-06 19:10:25 +08:00
|
|
|
|
Margin="0,0,0,10"
|
|
|
|
|
|
MinHeight="300"
|
|
|
|
|
|
MaxHeight="500">
|
2025-07-17 17:27:16 +08:00
|
|
|
|
<DataGrid.Columns>
|
2025-09-06 19:10:25 +08:00
|
|
|
|
<DataGridTextColumn Header="变量名称"
|
2025-09-06 19:41:28 +08:00
|
|
|
|
Binding="{Binding Variable.Name}"
|
2025-09-06 19:10:25 +08:00
|
|
|
|
IsReadOnly="True"
|
|
|
|
|
|
Width="*" />
|
|
|
|
|
|
<DataGridTextColumn Header="别名"
|
|
|
|
|
|
Binding="{Binding Alias}"
|
|
|
|
|
|
Width="*" />
|
2025-07-17 17:27:16 +08:00
|
|
|
|
</DataGrid.Columns>
|
|
|
|
|
|
</DataGrid>
|
2025-09-06 19:10:25 +08:00
|
|
|
|
|
|
|
|
|
|
<StackPanel Grid.Row="3" Orientation="Horizontal" HorizontalAlignment="Right">
|
|
|
|
|
|
<TextBox x:Name="PrefixTextBox"
|
|
|
|
|
|
Width="150"
|
|
|
|
|
|
Margin="0,0,10,0">
|
|
|
|
|
|
<TextBox.Resources>
|
|
|
|
|
|
<VisualBrush x:Key="HintText" AlignmentX="Left" AlignmentY="Center" Stretch="None">
|
|
|
|
|
|
<VisualBrush.Visual>
|
|
|
|
|
|
<TextBlock Text="输入前缀" Foreground="Gray" Margin="5,0,0,0" />
|
|
|
|
|
|
</VisualBrush.Visual>
|
|
|
|
|
|
</VisualBrush>
|
|
|
|
|
|
</TextBox.Resources>
|
|
|
|
|
|
<TextBox.Style>
|
|
|
|
|
|
<Style TargetType="TextBox">
|
|
|
|
|
|
<Setter Property="Background" Value="White" />
|
|
|
|
|
|
<Style.Triggers>
|
|
|
|
|
|
<Trigger Property="Text" Value="">
|
|
|
|
|
|
<Setter Property="Background" Value="{StaticResource HintText}" />
|
|
|
|
|
|
</Trigger>
|
|
|
|
|
|
</Style.Triggers>
|
|
|
|
|
|
</Style>
|
|
|
|
|
|
</TextBox.Style>
|
|
|
|
|
|
</TextBox>
|
|
|
|
|
|
<Button Content="应用前缀"
|
|
|
|
|
|
Command="{Binding ApplySamePrefixCommand}"
|
|
|
|
|
|
CommandParameter="{Binding Text, ElementName=PrefixTextBox}" />
|
|
|
|
|
|
</StackPanel>
|
|
|
|
|
|
</Grid>
|
2025-07-17 17:27:16 +08:00
|
|
|
|
</ui:ContentDialog>
|