<Window x:Class="DataLoader.ResWin"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
Loaded="Window_Loaded" Closing="Window_Closing"
|
xmlns:model="clr-namespace:DataLoader.Model" Background="Transparent"
|
Title="请选择资源" Height="750" Width="600" WindowStartupLocation="CenterScreen">
|
<Window.Resources>
|
<Style x:Key="CheckBoxStyle" TargetType="{x:Type CheckBox}">
|
<Setter Property="SnapsToDevicePixels" Value="true" />
|
<Setter Property="OverridesDefaultStyle" Value="False" />
|
<Setter Property="Height" Value="52"/>
|
<Setter Property="IsChecked" Value="False"/>
|
<Setter Property="Template">
|
<Setter.Value>
|
<ControlTemplate TargetType="CheckBox">
|
<Grid>
|
<Grid.ColumnDefinitions>
|
<ColumnDefinition Width="Auto"/>
|
<ColumnDefinition Width="*"/>
|
</Grid.ColumnDefinitions>
|
<Grid Height="{TemplateBinding Height}" Width="{TemplateBinding Height}">
|
<Rectangle x:Name="CheckBoxRectangle" Fill="#00446F" Opacity="1" RadiusY="0" RadiusX="0"/>
|
<Rectangle x:Name="CheckBoxRectangleOut" Stroke="#00A0E9" StrokeThickness="1" RadiusY="0" RadiusX="0"/>
|
<Grid x:Name="CheckedMark" Height="{TemplateBinding Height}" Width="{TemplateBinding Height}" Visibility="Collapsed" >
|
<Viewbox>
|
<Grid>
|
<Path SnapsToDevicePixels="True" StrokeThickness="4" Data="M1,9 L10,17" Stroke="#F6A411"/>
|
<Path SnapsToDevicePixels="True" StrokeThickness="4" Data="M8,17 L20,4" Stroke="#F6A411"/>
|
</Grid>
|
</Viewbox>
|
</Grid>
|
</Grid>
|
<ContentPresenter Grid.Column="1" VerticalAlignment="Center" Margin="8,0,0,0"/>
|
</Grid>
|
<ControlTemplate.Triggers>
|
<Trigger Property="IsChecked" Value="True">
|
<Setter TargetName="CheckedMark" Property="Visibility" Value="Visible"></Setter>
|
</Trigger>
|
</ControlTemplate.Triggers>
|
</ControlTemplate>
|
</Setter.Value>
|
</Setter>
|
</Style>
|
</Window.Resources>
|
<Grid>
|
<Grid.Background>
|
<SolidColorBrush Color="#0B498F" Opacity="0.3"/>
|
</Grid.Background>
|
<ScrollViewer Grid.Row="0" Grid.Column="0" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto" Margin="5" Background="Transparent">
|
<TreeView x:Name="tvResTree" FontSize="13" Background="Transparent" Foreground="White" BorderThickness="0">
|
<TreeView.ItemTemplate>
|
<HierarchicalDataTemplate DataType="{x:Type model:TreeItem}" ItemsSource="{Binding Path=Child}">
|
<StackPanel Orientation="Horizontal" Margin="0 10" Background="Transparent">
|
<CheckBox IsChecked="{Binding IsChecked}" Tag="{Binding ID}" Style="{StaticResource CheckBoxStyle}" Click="CheckBox_Click" Cursor="Hand" Margin="0 0 10 0" VerticalAlignment="Center" BorderBrush="#00A0E9" BorderThickness="1" Background="#00446F" Width="20" Height="20" VerticalContentAlignment='Center'/>
|
<Border Tag="{Binding ID}" Height="32" VerticalAlignment="Center" BorderBrush="#1A63B5" BorderThickness="1" Padding="15 2 15 0" Cursor="Hand" MouseLeftButtonDown="Border_MouseLeftButtonDown">
|
<Border.Background>
|
<SolidColorBrush Color="#0B498F" Opacity="0.3"/>
|
</Border.Background>
|
<TextBlock VerticalAlignment="Center" Text="{Binding Name}" FontSize="16" FontFamily="MicrosoftYaHei" Foreground="White" HorizontalAlignment="Center"/>
|
</Border>
|
</StackPanel>
|
</HierarchicalDataTemplate>
|
</TreeView.ItemTemplate>
|
</TreeView>
|
</ScrollViewer>
|
</Grid>
|
</Window>
|