2025-08-15 15:38:37 +08:00

103 lines
5.4 KiB
XML

<UserControl
x:Class="SWS.WPF.Views.DialogSignalSelect"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:CustomControl="clr-namespace:SWS.CustomControl;assembly=SWS.CustomControl"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:SWS.WPF.Views"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
Background="White">
<UserControl.Resources>
<ResourceDictionary Source="pack://application:,,,/SWS.WPF;component/Style/CustomStyles.xaml" />
</UserControl.Resources>
<Grid>
<StackPanel>
<CustomControl:customWindowTitleBar />
<StackPanel>
<TextBlock Margin="10,0" Text="{Binding Info}" />
<Border
Grid.Row="1"
Width="250"
Margin="10"
BorderBrush="SlateBlue"
BorderThickness="1"
CornerRadius="5">
<ListBox ItemsSource="{Binding listSignal}" SelectedItem="{Binding SelectedSignal, Mode=TwoWay}">
<ListBox.ItemTemplate>
<DataTemplate>
<Border>
<TextBlock
Margin="5"
FontSize="14"
Text="{Binding SignalName}" />
</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}"
Background="{TemplateBinding Background}"
BorderBrush="#DFDFDF"
BorderThickness="0,0,0,1">
<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>