重命名
This commit is contained in:
145
NeoUI/Melskin/Controls/Chip.xaml
Normal file
145
NeoUI/Melskin/Controls/Chip.xaml
Normal file
@@ -0,0 +1,145 @@
|
||||
<ResourceDictionary
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:controls="clr-namespace:VariaStudio.Controls"
|
||||
xmlns:decorations="clr-namespace:VariaStudio.Controls.Decorations"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
|
||||
|
||||
<Style TargetType="{x:Type controls:Chip}" x:Key="EmbossChipStyle">
|
||||
<Setter Property="Background" Value="{DynamicResource PrimaryVariantBrush}" />
|
||||
<Setter Property="BorderBrush" Value="Transparent" />
|
||||
<Setter Property="Cursor" Value="Hand" />
|
||||
<Setter Property="Foreground" Value="{DynamicResource TextAccentBrush}" />
|
||||
<Setter Property="HeadBackground" Value="{DynamicResource PrimaryNormalBrush}" />
|
||||
<Setter Property="HeadForeground" Value="{DynamicResource TextAccentBrush}" />
|
||||
<Setter Property="VerticalContentAlignment" Value="Center" />
|
||||
<Setter Property="SnapsToDevicePixels" Value="True" />
|
||||
<Setter Property="Padding" Value="5,3" />
|
||||
<Setter Property="FocusVisualStyle" Value="{DynamicResource FocusVisual}" />
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type controls:Chip}">
|
||||
<decorations:EmbossBorder
|
||||
CornerRadius="3"
|
||||
Margin="-4"
|
||||
Padding="0"
|
||||
ToolTip="{TemplateBinding Url}"
|
||||
x:Name="rootBorder">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Border
|
||||
Background="{TemplateBinding HeadBackground}"
|
||||
CornerRadius="3,0,0,3"
|
||||
Padding="{TemplateBinding Padding}"
|
||||
TextBlock.FontWeight="Bold"
|
||||
TextBlock.Foreground="{TemplateBinding HeadForeground}"
|
||||
x:Name="headBorder">
|
||||
<ContentPresenter
|
||||
ContentSource="Header"
|
||||
Focusable="False"
|
||||
RecognizesAccessKey="True"
|
||||
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
|
||||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
|
||||
</Border>
|
||||
<Border
|
||||
Background="{TemplateBinding Background}"
|
||||
CornerRadius="0,3,3,0"
|
||||
Grid.Column="1"
|
||||
Padding="{TemplateBinding Padding}"
|
||||
TextBlock.FontWeight="Bold"
|
||||
TextBlock.Foreground="{TemplateBinding Foreground}"
|
||||
x:Name="contentBorder">
|
||||
<ContentPresenter
|
||||
Focusable="False"
|
||||
RecognizesAccessKey="True"
|
||||
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
|
||||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
|
||||
</Border>
|
||||
</Grid>
|
||||
</decorations:EmbossBorder>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="Url" Value="{x:Null}">
|
||||
<Setter Property="Cursor" Value="Arrow" />
|
||||
</Trigger>
|
||||
<Trigger Property="Header" Value="{x:Null}">
|
||||
<Setter Property="CornerRadius" TargetName="contentBorder" Value="3" />
|
||||
<Setter Property="Padding" TargetName="headBorder" Value="0" />
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<Style TargetType="{x:Type controls:Chip}">
|
||||
<Setter Property="Background" Value="{DynamicResource PrimaryVariantBrush}" />
|
||||
<Setter Property="Cursor" Value="Hand" />
|
||||
<Setter Property="Foreground" Value="{DynamicResource TextAccentBrush}" />
|
||||
<Setter Property="VerticalAlignment" Value="Center" />
|
||||
<Setter Property="HeadBackground" Value="{DynamicResource PrimaryNormalBrush}" />
|
||||
<Setter Property="HeadForeground" Value="{DynamicResource TextAccentBrush}" />
|
||||
<Setter Property="VerticalContentAlignment" Value="Center" />
|
||||
<Setter Property="HorizontalAlignment" Value="Center" />
|
||||
<Setter Property="SnapsToDevicePixels" Value="True" />
|
||||
<Setter Property="Padding" Value="5,3" />
|
||||
<Setter Property="FocusVisualStyle" Value="{DynamicResource FocusVisual}" />
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type controls:Chip}">
|
||||
<Border
|
||||
CornerRadius="3"
|
||||
Padding="0"
|
||||
ToolTip="{TemplateBinding Url}"
|
||||
x:Name="rootBorder">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Border
|
||||
Background="{TemplateBinding HeadBackground}"
|
||||
CornerRadius="3,0,0,3"
|
||||
Padding="{TemplateBinding Padding}"
|
||||
TextBlock.FontWeight="Bold"
|
||||
TextBlock.Foreground="{TemplateBinding HeadForeground}"
|
||||
x:Name="headBorder">
|
||||
<ContentPresenter
|
||||
ContentSource="Header"
|
||||
Focusable="False"
|
||||
RecognizesAccessKey="True"
|
||||
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
|
||||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
|
||||
</Border>
|
||||
<Border
|
||||
Background="{TemplateBinding Background}"
|
||||
CornerRadius="0,3,3,0"
|
||||
Grid.Column="1"
|
||||
Padding="{TemplateBinding Padding}"
|
||||
TextBlock.FontWeight="Bold"
|
||||
TextBlock.Foreground="{TemplateBinding Foreground}"
|
||||
x:Name="contentBorder">
|
||||
<ContentPresenter
|
||||
Focusable="False"
|
||||
RecognizesAccessKey="True"
|
||||
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
|
||||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
|
||||
</Border>
|
||||
</Grid>
|
||||
</Border>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="Url" Value="{x:Null}">
|
||||
<Setter Property="Cursor" Value="Arrow" />
|
||||
</Trigger>
|
||||
<Trigger Property="Header" Value="{x:Null}">
|
||||
<Setter Property="CornerRadius" TargetName="contentBorder" Value="3" />
|
||||
<Setter Property="Padding" TargetName="headBorder" Value="0" />
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
</ResourceDictionary>
|
||||
Reference in New Issue
Block a user