2025-08-15 16:34:31 +08:00

102 lines
5.2 KiB
XML

<UserControl
x:Class="SWS.CAD.Views.DialogUnitSelect"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
xmlns:local="clr-namespace:SWS.CAD.Views.CustomControl"
xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
Background="White">
<UserControl.Resources>
<ResourceDictionary Source="pack://application:,,,/SWS.CAD;component/Views/Style/CustomStyles.xaml" />
</UserControl.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="auto" />
<RowDefinition Height="auto" />
<RowDefinition Height="auto" />
</Grid.RowDefinitions>
<local:customWindowTitleBar />
<!--<Border Grid.Row="1" Background="{StaticResource ColorPrimary}">
<StackPanel HorizontalAlignment="Right" Orientation="Horizontal">
<ListBox ItemsSource="{Binding listUnit}" SelectedItem="{Binding SelectedUnit,Mode=TwoWay}" Width="250" Height="200"/>
</StackPanel>
</Border>-->
<Border Width="250" Grid.Row="1"
BorderBrush="SlateBlue"
BorderThickness="1"
CornerRadius="5"
Margin="10">
<ListBox ItemsSource="{Binding listUnit}" SelectedItem="{Binding SelectedUnit,Mode=TwoWay}" >
<ListBox.ItemTemplate>
<DataTemplate>
<Border>
<TextBlock Text="{Binding UnitName}"
FontSize="14"
Margin="10 5 10 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="Background" Value="SlateGray"/>
<Setter Property="BorderBrush" Value="Transparent"/>
<Setter Property="ItemContainerStyle">
<Setter.Value>
<Style TargetType="ListBoxItem">
<Setter Property="Height" Value="40"/>
<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>
<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>
</Grid>
</UserControl>