|
@@ -5,33 +5,84 @@
|
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
xmlns:local="clr-namespace:PixiEditor.Views.UserControls.Layers" xmlns:behaviors="clr-namespace:PixiEditor.Helpers.Behaviours" xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity" xmlns:local1="clr-namespace:PixiEditor.Views.UserControls"
|
|
xmlns:local="clr-namespace:PixiEditor.Views.UserControls.Layers" xmlns:behaviors="clr-namespace:PixiEditor.Helpers.Behaviours" xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity" xmlns:local1="clr-namespace:PixiEditor.Views.UserControls"
|
|
mc:Ignorable="d"
|
|
mc:Ignorable="d"
|
|
- d:DesignHeight="60" d:DesignWidth="250" VerticalAlignment="Center" Name="uc">
|
|
|
|
- <Border BorderBrush="{StaticResource DarkerAccentColor}" BorderThickness="0 2 0 0" MinWidth="60" Height="40" Focusable="True">
|
|
|
|
|
|
+ d:DesignHeight="60" d:DesignWidth="350" VerticalAlignment="Center" Name="uc">
|
|
|
|
+ <Border BorderBrush="{StaticResource DarkerAccentColor}" BorderThickness="0 2 0 0" MinWidth="60" Focusable="True">
|
|
<i:Interaction.Behaviors>
|
|
<i:Interaction.Behaviors>
|
|
<behaviors:ClearFocusOnClickBehavior/>
|
|
<behaviors:ClearFocusOnClickBehavior/>
|
|
</i:Interaction.Behaviors>
|
|
</i:Interaction.Behaviors>
|
|
- <Grid Height="35">
|
|
|
|
|
|
+ <Grid>
|
|
<Grid Background="Transparent"/>
|
|
<Grid Background="Transparent"/>
|
|
<Grid Grid.Row="1" Grid.RowSpan="3" VerticalAlignment="Center">
|
|
<Grid Grid.Row="1" Grid.RowSpan="3" VerticalAlignment="Center">
|
|
<Grid.ColumnDefinitions>
|
|
<Grid.ColumnDefinitions>
|
|
- <ColumnDefinition Width="30"/>
|
|
|
|
- <ColumnDefinition Width="*"/>
|
|
|
|
- </Grid.ColumnDefinitions>
|
|
|
|
- <Grid MouseDown="Grid_MouseDown" Visibility="{Binding ReferenceLayerSelected, ElementName=uc, Converter={InverseBoolToVisibilityConverter}}" Cursor="Hand" Grid.ColumnSpan="2" Grid.RowSpan="2" Background="Transparent" Panel.ZIndex="5"/>
|
|
|
|
|
|
+ <ColumnDefinition Width="30"/>
|
|
|
|
+ <ColumnDefinition Width="*"/>
|
|
|
|
+ </Grid.ColumnDefinitions>
|
|
|
|
+ <Grid Visibility="{Binding ReferenceLayerSelected, ElementName=uc, Converter={InverseBoolToVisibilityConverter}}" Grid.ColumnSpan="2" Grid.RowSpan="2" Panel.ZIndex="5">
|
|
|
|
+ <Grid MouseDown="Grid_MouseDown" Cursor="Hand" Visibility="{Binding ElementName=visibilityCheckbox, Path=IsChecked, Converter={InverseBoolToVisibilityConverter}}" Background="Transparent"/>
|
|
|
|
+ </Grid>
|
|
|
|
+ <Grid Grid.Column="0" Height="16" Name="layerVisibilityCheckboxGrid">
|
|
<CheckBox Visibility="{Binding ReferenceLayerSelected, ElementName=uc, Converter={BoolToVisibilityConverter}}" Style="{StaticResource ImageCheckBox}" VerticalAlignment="Center"
|
|
<CheckBox Visibility="{Binding ReferenceLayerSelected, ElementName=uc, Converter={BoolToVisibilityConverter}}" Style="{StaticResource ImageCheckBox}" VerticalAlignment="Center"
|
|
IsThreeState="False" HorizontalAlignment="Center"
|
|
IsThreeState="False" HorizontalAlignment="Center"
|
|
- IsChecked="{Binding Path=IsLayerVisible, Mode=TwoWay, ElementName=uc}" Grid.Column="0" Height="16" />
|
|
|
|
- <StackPanel Orientation="Horizontal" Grid.Column="1" HorizontalAlignment="Center">
|
|
|
|
|
|
+ IsChecked="{Binding Path=Layer.IsVisible, Mode=TwoWay, ElementName=uc}"/>
|
|
|
|
+ </Grid>
|
|
|
|
+ <StackPanel Name="middleStackPanel" Height="40" Orientation="Horizontal" Grid.Column="1" HorizontalAlignment="Center">
|
|
<Border HorizontalAlignment="Left" Visibility="{Binding ReferenceLayerSelected, ElementName=uc, Converter={BoolToVisibilityConverter}}" Width="30" Height="30" BorderThickness="1" BorderBrush="Black" Background="{StaticResource MainColor}"
|
|
<Border HorizontalAlignment="Left" Visibility="{Binding ReferenceLayerSelected, ElementName=uc, Converter={BoolToVisibilityConverter}}" Width="30" Height="30" BorderThickness="1" BorderBrush="Black" Background="{StaticResource MainColor}"
|
|
Margin="5, 0, 10, 0">
|
|
Margin="5, 0, 10, 0">
|
|
- <Image Source="{Binding PreviewImage}" Stretch="Uniform" Width="25" Height="25"
|
|
|
|
|
|
+ <Image Source="{Binding Layer.LayerBitmap, ElementName=uc}" Stretch="Uniform" Width="25" Height="25"
|
|
RenderOptions.BitmapScalingMode="NearestNeighbor"/>
|
|
RenderOptions.BitmapScalingMode="NearestNeighbor"/>
|
|
</Border>
|
|
</Border>
|
|
<Image Margin="0 0 5 0" Width="20" Source="/Images/Layer-add.png" Visibility="{Binding ReferenceLayerSelected, ElementName=uc, Converter={InverseBoolToVisibilityConverter}}"/>
|
|
<Image Margin="0 0 5 0" Width="20" Source="/Images/Layer-add.png" Visibility="{Binding ReferenceLayerSelected, ElementName=uc, Converter={InverseBoolToVisibilityConverter}}"/>
|
|
|
|
|
|
- <local1:PrependTextBlock Prepend="Select " Foreground="White" HidePrepend="{Binding ReferenceLayerSelected, ElementName=uc}"
|
|
|
|
|
|
+ <local1:PrependTextBlock Margin="0 0 5 0" Prepend="Select " Foreground="White" HidePrepend="{Binding ReferenceLayerSelected, ElementName=uc}"
|
|
FontSize="15" VerticalAlignment="Center" Text="Reference Layer" />
|
|
FontSize="15" VerticalAlignment="Center" Text="Reference Layer" />
|
|
|
|
+ <Button Click="TrashButton_Click" Cursor="Hand" Grid.Column="1" Visibility="{Binding ReferenceLayerSelected, ElementName=uc, Converter={BoolToVisibilityConverter}}" Style="{StaticResource ImageButtonStyle}" Width="20" Height="20" HorizontalAlignment="Right">
|
|
|
|
+ <Button.Background>
|
|
|
|
+ <ImageBrush ImageSource="/Images/Trash.png"/>
|
|
|
|
+ </Button.Background>
|
|
|
|
+ </Button>
|
|
</StackPanel>
|
|
</StackPanel>
|
|
|
|
+ <CheckBox Panel.ZIndex="10" Name="visibilityCheckbox" Grid.Column="1" Margin="0,0,5,0" Height="16" HorizontalAlignment="Right">
|
|
|
|
+ <CheckBox.Triggers>
|
|
|
|
+ <EventTrigger RoutedEvent="CheckBox.Checked">
|
|
|
|
+ <BeginStoryboard>
|
|
|
|
+ <Storyboard>
|
|
|
|
+ <DoubleAnimation Storyboard.TargetName="middleStackPanel" Storyboard.TargetProperty="Height" From="40" To="0" Duration="0:0:0.15"/>
|
|
|
|
+ <DoubleAnimation Storyboard.TargetName="layerVisibilityCheckboxGrid" Storyboard.TargetProperty="Height" From="16" To="0" Duration="0:0:0.15"/>
|
|
|
|
+ </Storyboard>
|
|
|
|
+ </BeginStoryboard>
|
|
|
|
+ </EventTrigger>
|
|
|
|
+ <EventTrigger RoutedEvent="CheckBox.Unchecked">
|
|
|
|
+ <BeginStoryboard>
|
|
|
|
+ <Storyboard>
|
|
|
|
+ <DoubleAnimation Storyboard.TargetName="middleStackPanel" Storyboard.TargetProperty="Height" From="0" To="40" Duration="0:0:0.15"/>
|
|
|
|
+ <DoubleAnimation Storyboard.TargetName="layerVisibilityCheckboxGrid" Storyboard.TargetProperty="Height" From="0" To="16" Duration="0:0:0.15"/>
|
|
|
|
+ </Storyboard>
|
|
|
|
+ </BeginStoryboard>
|
|
|
|
+ </EventTrigger>
|
|
|
|
+
|
|
|
|
+ </CheckBox.Triggers>
|
|
|
|
+ <CheckBox.Template>
|
|
|
|
+ <ControlTemplate TargetType="{x:Type CheckBox}">
|
|
|
|
+ <StackPanel Orientation="Horizontal">
|
|
|
|
+ <Image Width="14" Cursor="Hand" x:Name="checkboxImage" Source="/Images/ChevronDown.png">
|
|
|
|
+ <Image.RenderTransform>
|
|
|
|
+ <RotateTransform Angle="0"/>
|
|
|
|
+ </Image.RenderTransform>
|
|
|
|
+ </Image>
|
|
|
|
+ <ContentPresenter/>
|
|
|
|
+ </StackPanel>
|
|
|
|
+ <ControlTemplate.Triggers>
|
|
|
|
+ <Trigger Property="IsChecked" Value="True">
|
|
|
|
+ <Setter TargetName="checkboxImage" Property="RenderTransform">
|
|
|
|
+ <Setter.Value>
|
|
|
|
+ <RotateTransform Angle="180" CenterX="7" CenterY="4"/>
|
|
|
|
+ </Setter.Value>
|
|
|
|
+ </Setter>
|
|
|
|
+ </Trigger>
|
|
|
|
+ </ControlTemplate.Triggers>
|
|
|
|
+ </ControlTemplate>
|
|
|
|
+ </CheckBox.Template>
|
|
|
|
+ </CheckBox>
|
|
</Grid>
|
|
</Grid>
|
|
</Grid>
|
|
</Grid>
|
|
</Border>
|
|
</Border>
|