|
@@ -0,0 +1,46 @@
|
|
|
+<UserControl x:Class="PixiEditor.Views.UserControls.Palettes.CompactPaletteViewer"
|
|
|
+ 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:PixiEditor.Views.UserControls.Palettes" xmlns:b="http://schemas.microsoft.com/expression/2010/interactivity" xmlns:converters="clr-namespace:PixiEditor.Helpers.Converters"
|
|
|
+ mc:Ignorable="d" Name="compactPaletteViewer"
|
|
|
+ d:DesignHeight="900" d:DesignWidth="30">
|
|
|
+ <Grid Background="{StaticResource AccentColor}">
|
|
|
+ <ScrollViewer Grid.Row="2" HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Auto">
|
|
|
+ <ItemsControl ItemsSource="{Binding Colors, ElementName=compactPaletteViewer}" AlternationCount="9999">
|
|
|
+ <d:ItemsControl.ItemsSource>
|
|
|
+ <x:Array Type="{x:Type Color}">
|
|
|
+ <Color R="0" G="0" B="0" A="255"/>
|
|
|
+ <Color R="255" G="255" B="255" A="255"/>
|
|
|
+ <Color R="255" G="255" B="255" A="150"/>
|
|
|
+ <Color R="255" G="255" B="255" A="0"/>
|
|
|
+ <Color R="255" G="0" B="0" A="255"/>
|
|
|
+ <Color R="0" G="255" B="0" A="255"/>
|
|
|
+ <Color R="0" G="0" B="255" A="255"/>
|
|
|
+ </x:Array>
|
|
|
+ </d:ItemsControl.ItemsSource>
|
|
|
+ <ItemsControl.ItemsPanel>
|
|
|
+ <ItemsPanelTemplate>
|
|
|
+ <WrapPanel Orientation="Horizontal"
|
|
|
+ HorizontalAlignment="Center" VerticalAlignment="Top"/>
|
|
|
+ </ItemsPanelTemplate>
|
|
|
+ </ItemsControl.ItemsPanel>
|
|
|
+ <ItemsControl.ItemTemplate>
|
|
|
+ <DataTemplate>
|
|
|
+ <local:PaletteColor ToolTip="Click to select as main color. Drag and drop onto another palette color to swap them."
|
|
|
+ Color="{Binding}" Width="20" Height="20" CornerRadius="0">
|
|
|
+ <b:Interaction.Triggers>
|
|
|
+ <b:EventTrigger EventName="MouseLeftButtonUp">
|
|
|
+ <b:InvokeCommandAction
|
|
|
+ Command="{Binding SelectColorCommand, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:CompactPaletteViewer}}}"
|
|
|
+ CommandParameter="{Binding}" />
|
|
|
+ </b:EventTrigger>
|
|
|
+ </b:Interaction.Triggers>
|
|
|
+ </local:PaletteColor>
|
|
|
+ </DataTemplate>
|
|
|
+ </ItemsControl.ItemTemplate>
|
|
|
+ </ItemsControl>
|
|
|
+ </ScrollViewer>
|
|
|
+ </Grid>
|
|
|
+</UserControl>
|