You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
90 lines
3.9 KiB
90 lines
3.9 KiB
<UserControl x:Name="root" |
|
x:Class="SharpDevelop.XamlDesigner.PropertyGrid.Editors.BrushEditor.GradientSlider" |
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|
xmlns:BrushEditor="clr-namespace:SharpDevelop.XamlDesigner.PropertyGrid.Editors.BrushEditor"> |
|
|
|
<UserControl.Resources> |
|
|
|
<Style TargetType="{x:Type BrushEditor:GradientThumb}"> |
|
<Setter Property="BrushEditor:NormalizedPanel.X" |
|
Value="{Binding Offset}" /> |
|
<Setter Property="Template"> |
|
<Setter.Value> |
|
<ControlTemplate TargetType="{x:Type BrushEditor:GradientThumb}"> |
|
<StackPanel> |
|
<Path x:Name="thumb" |
|
Data="m 0 0 l 6 -5 l 6 5" |
|
Stroke="Black" |
|
Fill="White" /> |
|
<Border BorderBrush="Black" |
|
BorderThickness="1" |
|
Width="12" |
|
Height="12"> |
|
<Border BorderThickness="1" |
|
BorderBrush="White" |
|
Background="{DynamicResource ChessBrush}"> |
|
<Border> |
|
<Border.Background> |
|
<SolidColorBrush Color="{Binding Color}" /> |
|
</Border.Background> |
|
</Border> |
|
</Border> |
|
</Border> |
|
</StackPanel> |
|
<ControlTemplate.Triggers> |
|
<Trigger Property="Selector.IsSelected" |
|
Value="True"> |
|
<Setter TargetName="thumb" |
|
Property="Fill" |
|
Value="Orange" /> |
|
</Trigger> |
|
</ControlTemplate.Triggers> |
|
</ControlTemplate> |
|
</Setter.Value> |
|
</Setter> |
|
</Style> |
|
|
|
<Style x:Key="StripStyle" |
|
TargetType="Thumb"> |
|
<Setter Property="Template"> |
|
<Setter.Value> |
|
<ControlTemplate TargetType="Thumb"> |
|
<Border BorderThickness="1" |
|
BorderBrush="{DynamicResource BackgroundBrush}" |
|
Background="{DynamicResource ChessBrush}"> |
|
<Border> |
|
<Border.Background> |
|
<LinearGradientBrush EndPoint="1 0" |
|
GradientStops="{Binding InternalValue.GradientStops}" /> |
|
</Border.Background> |
|
</Border> |
|
</Border> |
|
</ControlTemplate> |
|
</Setter.Value> |
|
</Setter> |
|
</Style> |
|
|
|
</UserControl.Resources> |
|
|
|
<Grid> |
|
|
|
<Thumb x:Name="strip" |
|
Style="{StaticResource StripStyle}" |
|
VerticalAlignment="Top" |
|
Height="20" |
|
Margin="6 0 6 0" /> |
|
|
|
<BrushEditor:GradientItemsControl x:Name="itemsControl" |
|
ItemsSource="{Binding GradientStops, ElementName=root}" |
|
Margin="6 28 6 10"> |
|
<ItemsControl.ItemsPanel> |
|
<ItemsPanelTemplate> |
|
<BrushEditor:NormalizedPanel /> |
|
</ItemsPanelTemplate> |
|
</ItemsControl.ItemsPanel> |
|
</BrushEditor:GradientItemsControl> |
|
|
|
</Grid> |
|
|
|
</UserControl>
|
|
|