20230201_145_upperpc/InSituLaboratory/Views/Pages/Dialogs/SelectUserView.xaml
2024-04-10 17:50:54 +08:00

95 lines
4.8 KiB
XML

<UserControl x:Class="InSituLaboratory.Views.Pages.Dialogs.SelectUserView"
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:local="clr-namespace:InSituLaboratory.Views.Pages.Dialogs"
FontFamily="{StaticResource DigitalDisplay}"
mc:Ignorable="d" Template="{StaticResource DialogViewTemplate}"
Height="550" Width="400">
<UserControl.Resources>
<Style TargetType="CheckBox">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="CheckBox">
<Border BorderBrush="#409EFE" BorderThickness="1"
CornerRadius="4" Background="White"
Name="border">
<TextBlock Text="&#xe608;" FontFamily="{StaticResource Icons}"
VerticalAlignment="Center" HorizontalAlignment="Center"
Foreground="White"/>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsChecked" Value="True">
<Setter TargetName="border" Property="Background" Value="#409EFE"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</UserControl.Resources>
<Grid Margin="10">
<Grid.RowDefinitions>
<RowDefinition Height="40"/>
<RowDefinition/>
</Grid.RowDefinitions>
<!--搜索用户-->
<Border Background="#EEE" Height="1" VerticalAlignment="Bottom"/>
<TextBox Text="{Binding FilterText,UpdateSourceTrigger=PropertyChanged}"
Style="{StaticResource NormalTextBoxStyle}"
VerticalContentAlignment="Center"
Margin="0,3" VerticalAlignment="Top" Height="30"/>
<ListBox ItemsSource="{Binding Users}" Grid.Row="1" Margin="5" BorderThickness="0" Background="Transparent" SelectionMode="Multiple">
<ListBox.ItemContainerStyle>
<Style TargetType="ListBoxItem">
<Setter Property="IsSelected" Value="{Binding IsSelected}"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ListBoxItem">
<Border Background="Transparent" Name="border">
<ContentPresenter/>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="border" Property="Background" Value="#F7F9FA"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ListBox.ItemContainerStyle>
<ListBox.ItemTemplate>
<DataTemplate>
<Grid Background="Transparent" Height="40">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="30"/>
<ColumnDefinition Width="50"/>
<ColumnDefinition Width="80"/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Border Height="1" Background="#EEE" VerticalAlignment="Bottom" Grid.ColumnSpan="4"/>
<CheckBox IsChecked="{Binding IsSelected}" VerticalAlignment="Center"
HorizontalAlignment="Center" Width="16" Height="16"/>
<Border Width="30" Height="30" CornerRadius="5" Grid.Column="1">
<Border.Background>
<ImageBrush ImageSource="{Binding UserIcon}"/>
</Border.Background>
</Border>
<TextBlock Text="{Binding UserName}" Grid.Column="2"
VerticalAlignment="Center"
Foreground="#666"/>
<TextBlock Text="{Binding RealName}" Grid.Column="3"
VerticalAlignment="Center" Foreground="#AAA"/>
</Grid>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</Grid>
</UserControl>