|
@@ -9,99 +9,99 @@
|
|
|
xmlns:helpers="clr-namespace:PixiEditor.Helpers"
|
|
|
mc:Ignorable="d"
|
|
|
d:DesignHeight="450" d:DesignWidth="300" Name="paletteControl">
|
|
|
- <Grid AllowDrop="True" PreviewDragEnter="Grid_PreviewDragEnter" PreviewDragLeave="Grid_PreviewDragLeave"
|
|
|
+ <DockPanel>
|
|
|
+ <palettes:ColorReplacer Grid.Row="3" VerticalAlignment="Bottom" x:Name="Replacer" DockPanel.Dock="Bottom"
|
|
|
+ ReplaceColorsCommand="{Binding ElementName=paletteControl, Path=ReplaceColorsCommand}"
|
|
|
+ HintColor="{Binding ElementName=paletteControl, Path=HintColor}"/>
|
|
|
+ <Grid AllowDrop="True" PreviewDragEnter="Grid_PreviewDragEnter" PreviewDragLeave="Grid_PreviewDragLeave"
|
|
|
Drop="Grid_Drop">
|
|
|
- <Grid.RowDefinitions>
|
|
|
- <RowDefinition Height="37.5"/>
|
|
|
- <RowDefinition Height="5"/>
|
|
|
- <RowDefinition Height="*"/>
|
|
|
- <RowDefinition Height="50"/>
|
|
|
- </Grid.RowDefinitions>
|
|
|
- <StackPanel Orientation="Vertical" Grid.Row="0" Background="{StaticResource MainColor}">
|
|
|
- <DockPanel VerticalAlignment="Center" Margin="0 5 0 0">
|
|
|
- <palettes:PaletteColorAdder DockPanel.Dock="Left" Margin="5 0 0 0"
|
|
|
+ <Grid.RowDefinitions>
|
|
|
+ <RowDefinition Height="37.5"/>
|
|
|
+ <RowDefinition Height="5"/>
|
|
|
+ <RowDefinition Height="*"/>
|
|
|
+ </Grid.RowDefinitions>
|
|
|
+ <StackPanel Orientation="Vertical" Grid.Row="0" Background="{StaticResource MainColor}">
|
|
|
+ <DockPanel VerticalAlignment="Center" Margin="0 5 0 0">
|
|
|
+ <palettes:PaletteColorAdder DockPanel.Dock="Left" Margin="5 0 0 0"
|
|
|
Swatches="{Binding ElementName=paletteControl, Path=Swatches}"
|
|
|
HintColor="{Binding ElementName=paletteControl, Path=HintColor}"
|
|
|
Colors="{Binding ElementName=paletteControl, Path=Colors}"/>
|
|
|
- <StackPanel Margin="0, 0, 5, 0" HorizontalAlignment="Right" Width="85" VerticalAlignment="Center" Orientation="Horizontal">
|
|
|
- <Button Margin="0, 0, 5, 0" Style="{StaticResource ToolButtonStyle}" Click="BrowsePalettes_Click"
|
|
|
+ <StackPanel Margin="0, 0, 5, 0" HorizontalAlignment="Right" Width="85" VerticalAlignment="Center" Orientation="Horizontal">
|
|
|
+ <Button Margin="0, 0, 5, 0" Style="{StaticResource ToolButtonStyle}" Click="BrowsePalettes_Click"
|
|
|
Cursor="Hand" Height="24" Width="24" ToolTip="Browse Palettes">
|
|
|
- <Button.Background>
|
|
|
- <ImageBrush ImageSource="/Images/Database.png"/>
|
|
|
- </Button.Background>
|
|
|
- </Button>
|
|
|
- <Button Margin="0, 0, 5, 0" Style="{StaticResource ToolButtonStyle}"
|
|
|
+ <Button.Background>
|
|
|
+ <ImageBrush ImageSource="/Images/Database.png"/>
|
|
|
+ </Button.Background>
|
|
|
+ </Button>
|
|
|
+ <Button Margin="0, 0, 5, 0" Style="{StaticResource ToolButtonStyle}"
|
|
|
Cursor="Hand" Height="24" Width="24" ToolTip="Load Palette" Click="ImportPalette_OnClick">
|
|
|
- <Button.Background>
|
|
|
- <ImageBrush ImageSource="/Images/Folder.png"/>
|
|
|
- </Button.Background>
|
|
|
- </Button>
|
|
|
- <Button Height="24" Width="24" Margin="0" Style="{StaticResource ToolButtonStyle}"
|
|
|
+ <Button.Background>
|
|
|
+ <ImageBrush ImageSource="/Images/Folder.png"/>
|
|
|
+ </Button.Background>
|
|
|
+ </Button>
|
|
|
+ <Button Height="24" Width="24" Margin="0" Style="{StaticResource ToolButtonStyle}"
|
|
|
Cursor="Hand" ToolTip="Save Palette" Click="SavePalette_OnClick">
|
|
|
- <Button.Background>
|
|
|
- <ImageBrush ImageSource="/Images/Save.png"/>
|
|
|
- </Button.Background>
|
|
|
- </Button>
|
|
|
- </StackPanel>
|
|
|
- </DockPanel>
|
|
|
- </StackPanel>
|
|
|
- <Separator Grid.Row="1" Margin="0, 0, 0, 0" BorderBrush="{StaticResource DarkerAccentColor}" BorderThickness="2" />
|
|
|
- <Grid Visibility="Hidden" Background="{StaticResource AccentColor}" Opacity="0.7" Grid.Row="2" Name="dragDropGrid">
|
|
|
- <TextBlock Text="Drop palette here" Foreground="White" FontSize="32" HorizontalAlignment="Center" VerticalAlignment="Center"/>
|
|
|
- </Grid>
|
|
|
- <ScrollViewer Grid.Row="2" Grid.RowSpan="{Binding ElementName=Replacer, Path=IsCollapsed,
|
|
|
- Converter={converters:IsCollapsedToRowSpanConverter}}" HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Auto">
|
|
|
- <ItemsControl ItemsSource="{Binding Colors, ElementName=paletteControl}" 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 Margin="10" Orientation="Horizontal"
|
|
|
+ <Button.Background>
|
|
|
+ <ImageBrush ImageSource="/Images/Save.png"/>
|
|
|
+ </Button.Background>
|
|
|
+ </Button>
|
|
|
+ </StackPanel>
|
|
|
+ </DockPanel>
|
|
|
+ </StackPanel>
|
|
|
+ <Separator Grid.Row="1" Margin="0, 0, 0, 0" BorderBrush="{StaticResource DarkerAccentColor}" BorderThickness="2" />
|
|
|
+ <Grid Visibility="Hidden" Background="{StaticResource AccentColor}" Opacity="0.7" Grid.Row="2" Name="dragDropGrid">
|
|
|
+ <TextBlock Text="Drop palette here" Foreground="White" FontSize="32" HorizontalAlignment="Center" VerticalAlignment="Center"/>
|
|
|
+ </Grid>
|
|
|
+ <ScrollViewer Grid.Row="2" HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Auto">
|
|
|
+ <ItemsControl ItemsSource="{Binding Colors, ElementName=paletteControl}" 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 Margin="10" Orientation="Horizontal"
|
|
|
HorizontalAlignment="Left" VerticalAlignment="Top"/>
|
|
|
- </ItemsPanelTemplate>
|
|
|
- </ItemsControl.ItemsPanel>
|
|
|
- <ItemsControl.ItemTemplate>
|
|
|
- <DataTemplate>
|
|
|
- <palettes:PaletteColor Cursor="Hand" ToolTip="Click to select as main color. Drag and drop onto another palette color to swap them." AllowDrop="True" Color="{Binding}"
|
|
|
+ </ItemsPanelTemplate>
|
|
|
+ </ItemsControl.ItemsPanel>
|
|
|
+ <ItemsControl.ItemTemplate>
|
|
|
+ <DataTemplate>
|
|
|
+ <palettes:PaletteColor Cursor="Hand" ToolTip="Click to select as main color. Drag and drop onto another palette color to swap them." AllowDrop="True" Color="{Binding}"
|
|
|
Margin="2.5"
|
|
|
Drop="PaletteColor_Drop"
|
|
|
AssociatedKey="{Binding Path=(ItemsControl.AlternationIndex),
|
|
|
RelativeSource={RelativeSource TemplatedParent}, Converter={converters:IndexToAssociatedKeyConverter}}">
|
|
|
- <b:Interaction.Triggers>
|
|
|
- <b:EventTrigger EventName="MouseLeftButtonUp">
|
|
|
- <b:InvokeCommandAction
|
|
|
+ <b:Interaction.Triggers>
|
|
|
+ <b:EventTrigger EventName="MouseLeftButtonUp">
|
|
|
+ <b:InvokeCommandAction
|
|
|
Command="{Binding SelectColorCommand, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type palettes:PaletteViewer}}}"
|
|
|
CommandParameter="{Binding}" />
|
|
|
- </b:EventTrigger>
|
|
|
- </b:Interaction.Triggers>
|
|
|
- <palettes:PaletteColor.ContextMenu>
|
|
|
- <ContextMenu>
|
|
|
- <MenuItem Header="Choose" Foreground="White" Click="MenuItem_OnClick"
|
|
|
+ </b:EventTrigger>
|
|
|
+ </b:Interaction.Triggers>
|
|
|
+ <palettes:PaletteColor.ContextMenu>
|
|
|
+ <ContextMenu>
|
|
|
+ <MenuItem Header="Choose" Foreground="White" Click="MenuItem_OnClick"
|
|
|
CommandParameter="{Binding}"/>
|
|
|
- <MenuItem Header="Remove" Foreground="White"
|
|
|
+ <MenuItem Header="Remove" Foreground="White"
|
|
|
Click="RemoveColorMenuItem_OnClick"
|
|
|
CommandParameter="{Binding}" />
|
|
|
- <MenuItem Header="Replace" Foreground="White"
|
|
|
+ <MenuItem Header="Replace" Foreground="White"
|
|
|
CommandParameter="{Binding}"
|
|
|
Click="ReplaceColor_OnClick"/>
|
|
|
- </ContextMenu>
|
|
|
- </palettes:PaletteColor.ContextMenu>
|
|
|
- </palettes:PaletteColor>
|
|
|
- </DataTemplate>
|
|
|
- </ItemsControl.ItemTemplate>
|
|
|
- </ItemsControl>
|
|
|
- </ScrollViewer>
|
|
|
- <palettes:ColorReplacer Grid.Row="3" VerticalAlignment="Bottom" x:Name="Replacer"
|
|
|
- ReplaceColorsCommand="{Binding ElementName=paletteControl, Path=ReplaceColorsCommand}"
|
|
|
- HintColor="{Binding ElementName=paletteControl, Path=HintColor}"/>
|
|
|
- </Grid>
|
|
|
+ </ContextMenu>
|
|
|
+ </palettes:PaletteColor.ContextMenu>
|
|
|
+ </palettes:PaletteColor>
|
|
|
+ </DataTemplate>
|
|
|
+ </ItemsControl.ItemTemplate>
|
|
|
+ </ItemsControl>
|
|
|
+ </ScrollViewer>
|
|
|
+ </Grid>
|
|
|
+ </DockPanel>
|
|
|
</UserControl>
|