加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
Resource.xaml 14.94 KB
一键复制 编辑 原始数据 按行查看 历史
root 提交于 2017-03-14 14:17 . test
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:library="clr-namespace:Dasic.Library"
xmlns:local="clr-namespace:Dasic">
<!--按钮上下布局时的样式-->
<ControlTemplate x:Key="BtnVertical" TargetType="library:ExtendButton">
<Border Padding="5" Cursor="Hand" x:Name="ButBorder" BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="1" Background="{TemplateBinding Background}" SnapsToDevicePixels="True">
<StackPanel x:Name="StackPanel" Orientation="Vertical" HorizontalAlignment="Center"
VerticalAlignment="Center">
<Image x:Name="Image" Source="{Binding OutImage,RelativeSource={RelativeSource TemplatedParent}}"
Margin="4" />
<TextBlock x:Name="TextBlock" Text="{TemplateBinding Content}"
Foreground="{TemplateBinding Foreground}" FontSize="{TemplateBinding FontSize}" />
</StackPanel>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="true">
<Setter TargetName="Image" Property="Source"
Value="{Binding MoveImage,RelativeSource={RelativeSource TemplatedParent}}" />
</Trigger>
<Trigger Property="IsEnabled" Value="false">
<Setter Property="Cursor" TargetName="ButBorder" Value="No" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
<!--按钮左右布局时的样式-->
<ControlTemplate x:Key="BtnHorizon" TargetType="library:ExtendButton">
<Border Padding="5" Cursor="Hand" x:Name="ButBorder" BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="1" Background="{TemplateBinding Background}" SnapsToDevicePixels="True">
<StackPanel x:Name="StackPanel" Orientation="Horizontal" HorizontalAlignment="Center"
VerticalAlignment="Center">
<Image x:Name="Image" Source="{Binding OutImage,RelativeSource={RelativeSource TemplatedParent}}"
Margin="0,0,4,0" />
<TextBlock x:Name="TextBlock" Text="{TemplateBinding Content}"
Foreground="{TemplateBinding Foreground}" FontSize="{TemplateBinding FontSize}" />
</StackPanel>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="true">
<Setter TargetName="Image" Property="Source"
Value="{Binding MoveImage,RelativeSource={RelativeSource TemplatedParent}}" />
<Setter TargetName="TextBlock" Property="Foreground"
Value="{Binding MoveFontColor,RelativeSource={RelativeSource TemplatedParent}}" />
<Setter TargetName="ButBorder" Property="BorderBrush"
Value="{Binding MoveBorderColor,RelativeSource={RelativeSource TemplatedParent}}" />
<Setter TargetName="ButBorder" Property="Background"
Value="{Binding MoveBgColor,RelativeSource={RelativeSource TemplatedParent}}" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
<!--菜单树父节点样式-->
<ControlTemplate x:Key="TreeViewParentTpl" TargetType="library:TreeViewParent">
<Grid x:Name="ParentGrid">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="18" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition />
</Grid.RowDefinitions>
<ToggleButton x:Name="BeforIco" HorizontalContentAlignment="Center" VerticalContentAlignment="Center"
Grid.Column="0" Grid.Row="0" ClickMode="Press"
IsChecked="{Binding IsExpanded,RelativeSource={RelativeSource TemplatedParent}}"
Background="Transparent" BorderBrush="Transparent" BorderThickness="0">
<Image x:Name="BeforIcoImg" Width="16" Height="16" Source="Images/folder_1.png"
HorizontalAlignment="Stretch" VerticalAlignment="Stretch" />
</ToggleButton>
<Border x:Name="BorderParent" BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}"
Grid.Column="1" Grid.Row="0" Padding="{TemplateBinding Padding}" SnapsToDevicePixels="true">
<StackPanel x:Name="StackPanel" Orientation="Horizontal" HorizontalAlignment="Center"
VerticalAlignment="Center">
<Image x:Name="Image" Source="{Binding IcoImage, RelativeSource={RelativeSource TemplatedParent}}"
Width="16" Height="16" Margin="0,0,4,0" />
<TextBlock x:Name="TextBlock" Text="{TemplateBinding Header}"
Foreground="{TemplateBinding Foreground}" FontSize="{TemplateBinding FontSize}" />
</StackPanel>
</Border>
<ItemsPresenter x:Name="ItemsHost" Grid.ColumnSpan="2" Grid.Column="1" Grid.Row="1" />
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsExpanded" Value="false">
<Setter Property="Visibility" TargetName="ItemsHost" Value="Collapsed" />
</Trigger>
<Trigger Property="IsExpanded" Value="True">
<Setter Property="Source" TargetName="BeforIcoImg"
Value="{Binding ExpandImage, RelativeSource={RelativeSource TemplatedParent}}" />
</Trigger>
<Trigger Property="IsSelected" Value="true">
<Setter Property="Background" TargetName="BorderParent" Value="#00BFFF" />
<Setter Property="Background" TargetName="BeforIco" Value="#00BFFF" />
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.HighlightTextBrushKey}}" />
</Trigger>
<Trigger Property="IsEnabled" Value="false">
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
<!--菜单树子节点头样式-->
<ControlTemplate x:Key="TreeViewChildHeader" TargetType="TreeViewItem">
<Border Height="35" BorderBrush="#DEDEDE" Background="#F5F5F5" BorderThickness="1" Margin="4,4,4,0">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="150" />
<ColumnDefinition Width="150" />
<ColumnDefinition Width="180" />
<ColumnDefinition Width="100" />
<ColumnDefinition Width="100" />
<ColumnDefinition Width="150" />
<ColumnDefinition Width="150" />
<ColumnDefinition Width="100*" MinWidth="200" />
</Grid.ColumnDefinitions>
<Label Grid.Column="0" Content="Feild" FontSize="14" Foreground="#00BFFF"
HorizontalContentAlignment="Center" VerticalContentAlignment="Center" HorizontalAlignment="Left"
VerticalAlignment="Stretch" />
<Label Grid.Column="1" Content="Collation" FontSize="14" Foreground="#00BFFF"
HorizontalContentAlignment="Center" VerticalContentAlignment="Center" HorizontalAlignment="Left"
VerticalAlignment="Stretch" />
<Label Grid.Column="2" Content="Type" FontSize="14" Foreground="#00BFFF"
HorizontalContentAlignment="Center" VerticalContentAlignment="Center" HorizontalAlignment="Left"
VerticalAlignment="Stretch" />
<Label Grid.Column="3" Content="Null" FontSize="14" Foreground="#00BFFF"
HorizontalContentAlignment="Center" VerticalContentAlignment="Center" HorizontalAlignment="Left"
VerticalAlignment="Stretch" />
<Label Grid.Column="4" Content="Key" FontSize="14" Foreground="#00BFFF"
HorizontalContentAlignment="Center" VerticalContentAlignment="Center" HorizontalAlignment="Left"
VerticalAlignment="Stretch" />
<Label Grid.Column="5" Content="Default" FontSize="14" Foreground="#00BFFF"
HorizontalContentAlignment="Center" VerticalContentAlignment="Center" HorizontalAlignment="Left"
VerticalAlignment="Stretch" />
<Label Grid.Column="6" Content="Extra" FontSize="14" Foreground="#00BFFF"
HorizontalContentAlignment="Center" VerticalContentAlignment="Center" HorizontalAlignment="Left"
VerticalAlignment="Stretch" />
<Label Grid.Column="7" Content="Comment" FontSize="14" Foreground="#00BFFF"
HorizontalContentAlignment="Center" VerticalContentAlignment="Center" HorizontalAlignment="Left"
VerticalAlignment="Stretch" />
</Grid>
</Border>
</ControlTemplate>
<!--菜单树子节点样式-->
<ControlTemplate x:Key="TreeViewChildTpl" TargetType="library:TreeViewChild">
<Border x:Name="BorderChild" Height="32" BorderBrush="#DEDEDE" Background="Transparent"
BorderThickness="1,0,1,1" Margin="4,0,4,0">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="150" />
<ColumnDefinition Width="150" />
<ColumnDefinition Width="180" />
<ColumnDefinition Width="100" />
<ColumnDefinition Width="100" />
<ColumnDefinition Width="150" />
<ColumnDefinition Width="150" />
<ColumnDefinition Width="100*" MinWidth="200" />
</Grid.ColumnDefinitions>
<Label Grid.Column="0" Content="{Binding StrField, RelativeSource={RelativeSource TemplatedParent}}"
ToolTip="{Binding StrField, RelativeSource={RelativeSource TemplatedParent}}"
Foreground="{Binding StrFieldColor, RelativeSource={RelativeSource TemplatedParent}}"
HorizontalContentAlignment="Center" VerticalContentAlignment="Center" HorizontalAlignment="Left"
VerticalAlignment="Stretch" />
<Label Grid.Column="1" Content="{Binding StrColl, RelativeSource={RelativeSource TemplatedParent}}"
ToolTip="{Binding StrColl, RelativeSource={RelativeSource TemplatedParent}}"
Foreground="{Binding StrCollColor, RelativeSource={RelativeSource TemplatedParent}}"
HorizontalContentAlignment="Center" VerticalContentAlignment="Center" HorizontalAlignment="Left"
VerticalAlignment="Stretch" />
<Label Grid.Column="2" Content="{Binding StrType, RelativeSource={RelativeSource TemplatedParent}}"
ToolTip="{Binding StrType, RelativeSource={RelativeSource TemplatedParent}}"
Foreground="{Binding StrTypeColor, RelativeSource={RelativeSource TemplatedParent}}"
HorizontalContentAlignment="Center" VerticalContentAlignment="Center" HorizontalAlignment="Left"
VerticalAlignment="Stretch" />
<Label Grid.Column="3" Content="{Binding StrNull, RelativeSource={RelativeSource TemplatedParent}}"
ToolTip="{Binding StrNull, RelativeSource={RelativeSource TemplatedParent}}"
Foreground="{Binding StrNullColor, RelativeSource={RelativeSource TemplatedParent}}"
HorizontalContentAlignment="Center" VerticalContentAlignment="Center" HorizontalAlignment="Left"
VerticalAlignment="Stretch" />
<Label Grid.Column="4" Content="{Binding StrKey, RelativeSource={RelativeSource TemplatedParent}}"
ToolTip="{Binding StrKey, RelativeSource={RelativeSource TemplatedParent}}"
Foreground="{Binding StrKeyColor, RelativeSource={RelativeSource TemplatedParent}}"
HorizontalContentAlignment="Center" VerticalContentAlignment="Center" HorizontalAlignment="Left"
VerticalAlignment="Stretch" />
<Label Grid.Column="5" Content="{Binding StrDefault, RelativeSource={RelativeSource TemplatedParent}}"
ToolTip="{Binding StrDefault, RelativeSource={RelativeSource TemplatedParent}}"
Foreground="{Binding StrDefaultColor, RelativeSource={RelativeSource TemplatedParent}}"
HorizontalContentAlignment="Center" VerticalContentAlignment="Center" HorizontalAlignment="Left"
VerticalAlignment="Stretch" />
<Label Grid.Column="6" Content="{Binding StrExtra, RelativeSource={RelativeSource TemplatedParent}}"
ToolTip="{Binding StrExtra, RelativeSource={RelativeSource TemplatedParent}}"
Foreground="{Binding StrExtraColor, RelativeSource={RelativeSource TemplatedParent}}"
HorizontalContentAlignment="Center" VerticalContentAlignment="Center" HorizontalAlignment="Left"
VerticalAlignment="Stretch" />
<Label Grid.Column="7" Content="{Binding StrComment, RelativeSource={RelativeSource TemplatedParent}}"
ToolTip="{Binding StrComment, RelativeSource={RelativeSource TemplatedParent}}"
Foreground="{Binding StrCommentColor, RelativeSource={RelativeSource TemplatedParent}}"
HorizontalContentAlignment="Center" VerticalContentAlignment="Center" HorizontalAlignment="Left"
VerticalAlignment="Stretch" />
</Grid>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsSelected" Value="true">
<Setter Property="Background" TargetName="BorderChild" Value="#00BFFF" />
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.HighlightTextBrushKey}}" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
<!--菜单树子节点底部样式-->
<ControlTemplate x:Key="TreeViewFoodTpl" TargetType="TreeViewItem">
<Border Height="4" BorderBrush="Transparent" Background="Transparent" BorderThickness="0" Margin="0,0,0,4" />
</ControlTemplate>
</ResourceDictionary>
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化