2025-08-15 15:25:44 +08:00

105 lines
5.5 KiB
XML

<UserControl x:Class="DI_Electrical.Views.Dialog.DialogSignalManagements.DialogSignalSelect"
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:prism="http://prismlibrary.com/"
xmlns:local="clr-namespace:DI_Electrical.Views"
xmlns:CustomControl ="clr-namespace:DI_Electrical.Views.CustomControl"
xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
Background="White">
<prism:Dialog.WindowStyle>
<Style TargetType="Window">
<!-- 关键:设置窗口根据内容自动调整尺寸 -->
<Setter Property="SizeToContent" Value="WidthAndHeight"/>
<Setter Property="WindowState" Value="Normal"/>
<Setter Property="WindowStyle" Value="None"/>
<Setter Property="ResizeMode" Value="NoResize"/>
</Style>
</prism:Dialog.WindowStyle>
<Grid>
<StackPanel>
<local:customWindowTitleBar/>
<StackPanel>
<TextBlock Margin="10 0" Text="请选择要将这个虚拟点放在哪个信号下"/>
<Border Width="250" Grid.Row="1"
BorderBrush="SlateBlue"
BorderThickness="1"
CornerRadius="5"
Margin="10">
<ListBox ItemsSource="{Binding listSignal}" SelectedItem="{Binding SelectedSignal,Mode=TwoWay}" >
<ListBox.ItemTemplate>
<DataTemplate>
<Border>
<TextBlock Text="{Binding SignalName}"
FontSize="14"
Margin="5"/>
</Border>
</DataTemplate>
</ListBox.ItemTemplate>
<ListBox.Style>
<Style TargetType="ListBox">
<Setter Property="Focusable" Value="False"/>
<Setter Property="Padding" Value="0"/>
<Setter Property="Margin" Value="0"/>
<Setter Property="Height" Value="500"/>
<Setter Property="Background" Value="SlateGray"/>
<Setter Property="BorderBrush" Value="Transparent"/>
<Setter Property="ItemContainerStyle">
<Setter.Value>
<Style TargetType="ListBoxItem">
<Setter Property="Height" Value="30"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ListBoxItem">
<Border Height="{TemplateBinding Height}"
BorderThickness="0 0 0 1"
BorderBrush="#DFDFDF"
Background="{TemplateBinding Background}">
<ContentPresenter VerticalAlignment="Center"/>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="LightBlue"/>
</Trigger>
<Trigger Property="IsSelected" Value="True">
<Setter Property="Background" Value="DeepSkyBlue"/>
</Trigger>
</Style.Triggers>
</Style>
</Setter.Value>
</Setter>
</Style>
</ListBox.Style>
</ListBox>
</Border>
</StackPanel>
<Border
Grid.Row="2"
Height="30"
Background="{StaticResource ColorPrimary}">
<StackPanel HorizontalAlignment="Right" Orientation="Horizontal">
<telerik:RadButton
Margin="5"
Command="{Binding OKCommand}"
CommandParameter="{Binding RelativeSource={RelativeSource AncestorType=Window}}"
Content="确定"
Style="{StaticResource sysBtn}" />
<telerik:RadButton
Margin="5"
Command="{Binding CloseCommand}"
CommandParameter="{Binding RelativeSource={RelativeSource AncestorType=Window}}"
Content="取消"
Style="{StaticResource sysBtn2}" />
</StackPanel>
</Border>
</StackPanel>
</Grid>
</UserControl>