|
@@ -0,0 +1,39 @@
|
|
|
|
+<UserControl x:Class="PixiEditor.Views.PortableColorPicker"
|
|
|
|
+ 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" xmlns:converters="clr-namespace:PixiEditor.Helpers.Converters"
|
|
|
|
+ mc:Ignorable="d"
|
|
|
|
+ d:DesignHeight="20" d:DesignWidth="40" x:Name="uc">
|
|
|
|
+ <UserControl.Resources>
|
|
|
|
+ <converters:BoolToInvertedBoolConverter x:Key="BoolToInvertedBoolConverter"/>
|
|
|
|
+ <converters:ColorToBrushConverter x:Key="ColorToBrushConverter"/>
|
|
|
|
+ </UserControl.Resources>
|
|
|
|
+ <Grid>
|
|
|
|
+ <Border CornerRadius="2" Width="40" Height="20" BorderThickness="1" BorderBrush="Transparent" Panel.ZIndex="0" Padding="0" Margin="0">
|
|
|
|
+ <Border.Background>
|
|
|
|
+ <ImageBrush ImageSource="../Images/transparentbg.png" Stretch="UniformToFill">
|
|
|
|
+ <ImageBrush.RelativeTransform>
|
|
|
|
+ <TransformGroup>
|
|
|
|
+ <ScaleTransform CenterY="0.5" CenterX="0.5" ScaleX="6" ScaleY="6"/>
|
|
|
|
+ <SkewTransform CenterY="0.5" CenterX="0.5"/>
|
|
|
|
+ <RotateTransform CenterY="0.5" CenterX="0.5"/>
|
|
|
|
+ <TranslateTransform/>
|
|
|
|
+ </TransformGroup>
|
|
|
|
+ </ImageBrush.RelativeTransform>
|
|
|
|
+ </ImageBrush>
|
|
|
|
+ </Border.Background>
|
|
|
|
+ <ToggleButton Style="{StaticResource ColorToggleButtonStyle}" Padding="0" Margin="0" Height="20" Width="40" IsEnabled="{Binding Path=IsOpen, ElementName=popup, Converter={StaticResource BoolToInvertedBoolConverter}}"
|
|
|
|
+ x:Name="toggleButton" BorderThickness="0" Panel.ZIndex="1" Background="{Binding Path=SelectedColor, ElementName=colorPicker, Converter={StaticResource ColorToBrushConverter}}">
|
|
|
|
+ <Border Height="20" Width="40" BorderThickness="0" BorderBrush="Transparent" Background="Transparent" />
|
|
|
|
+ </ToggleButton>
|
|
|
|
+ </Border>
|
|
|
|
+ <Popup Name="popup" StaysOpen="False" IsOpen="{Binding Path=IsChecked, ElementName=toggleButton, Mode=TwoWay}">
|
|
|
|
+ <Border BorderThickness="1" BorderBrush="Black">
|
|
|
|
+ <local:ColorPicker x:Name="colorPicker" SelectedColor="{Binding ElementName=uc, Path=SelectedColor, Mode=TwoWay}"
|
|
|
|
+ SecondaryColor="{Binding ElementName=uc, Path=SecondaryColor, Mode=TwoWay}"/>
|
|
|
|
+ </Border>
|
|
|
|
+ </Popup>
|
|
|
|
+ </Grid>
|
|
|
|
+</UserControl>
|