|
@@ -16,48 +16,110 @@
|
|
<i:Interaction.Behaviors>
|
|
<i:Interaction.Behaviors>
|
|
<behaviors:ClearFocusOnClickBehavior/>
|
|
<behaviors:ClearFocusOnClickBehavior/>
|
|
</i:Interaction.Behaviors>
|
|
</i:Interaction.Behaviors>
|
|
- <Grid>
|
|
|
|
- <Grid Background="Transparent"/>
|
|
|
|
- <Grid Grid.Row="0" VerticalAlignment="Center">
|
|
|
|
- <Grid.ColumnDefinitions>
|
|
|
|
- <ColumnDefinition Width="30"/>
|
|
|
|
- <ColumnDefinition Width="*"/>
|
|
|
|
- </Grid.ColumnDefinitions>
|
|
|
|
- <Grid Visibility="{Binding Document.ReferenceLayerViewModel.ReferenceBitmap, ElementName=uc, Converter={converters:NullToVisibilityConverter}}" Grid.ColumnSpan="2" Grid.RowSpan="2" Panel.ZIndex="5">
|
|
|
|
- <Grid Cursor="Hand" Visibility="{Binding ElementName=visibilityCheckbox, Path=IsChecked, Converter={InverseBoolToVisibilityConverter}}" Background="Transparent">
|
|
|
|
|
|
+ <DockPanel Background="Transparent">
|
|
|
|
+ <CheckBox Focusable="False" Panel.ZIndex="10" Name="visibilityCheckbox" Margin="0,0,5,0" Height="16" HorizontalAlignment="Right" DockPanel.Dock="Right">
|
|
|
|
+ <CheckBox.Triggers>
|
|
|
|
+ <EventTrigger RoutedEvent="CheckBox.Checked">
|
|
|
|
+ <BeginStoryboard>
|
|
|
|
+ <Storyboard>
|
|
|
|
+ <DoubleAnimation Storyboard.TargetName="mainDockPanel" Storyboard.TargetProperty="Height" From="40" To="0" Duration="0:0:0.15"/>
|
|
|
|
+ </Storyboard>
|
|
|
|
+ </BeginStoryboard>
|
|
|
|
+ </EventTrigger>
|
|
|
|
+ <EventTrigger RoutedEvent="CheckBox.Unchecked">
|
|
|
|
+ <BeginStoryboard>
|
|
|
|
+ <Storyboard>
|
|
|
|
+ <DoubleAnimation Storyboard.TargetName="mainDockPanel" Storyboard.TargetProperty="Height" From="0" To="40" Duration="0:0:0.15"/>
|
|
|
|
+ </Storyboard>
|
|
|
|
+ </BeginStoryboard>
|
|
|
|
+ </EventTrigger>
|
|
|
|
+
|
|
|
|
+ </CheckBox.Triggers>
|
|
|
|
+ <CheckBox.Template>
|
|
|
|
+ <ControlTemplate TargetType="{x:Type CheckBox}">
|
|
|
|
+ <StackPanel Orientation="Horizontal" Focusable="False">
|
|
|
|
+ <Image Focusable="False" Width="14" Cursor="Hand" x:Name="checkboxImage" Source="/Images/ChevronDown.png">
|
|
|
|
+ <Image.RenderTransform>
|
|
|
|
+ <RotateTransform Angle="0"/>
|
|
|
|
+ </Image.RenderTransform>
|
|
|
|
+ </Image>
|
|
|
|
+ <ContentPresenter Focusable="False"/>
|
|
|
|
+ </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 Height="40" x:Name="mainDockPanel">
|
|
|
|
+ <Grid
|
|
|
|
+ Visibility="{Binding Document.ReferenceLayerViewModel.ReferenceBitmap, ElementName=uc, Converter={converters:NullToVisibilityConverter}}"
|
|
|
|
+ Panel.ZIndex="5">
|
|
|
|
+ <Grid Cursor="Hand" Visibility="{Binding ElementName=visibilityCheckbox, Path=IsChecked, Converter={InverseBoolToVisibilityConverter}}" Background="Transparent">
|
|
|
|
+ <StackPanel Orientation="Horizontal" HorizontalAlignment="Center" DockPanel.Dock="Left">
|
|
|
|
+ <Image Margin="5 0 5 0" Width="20" Source="/Images/Layer-add.png"
|
|
|
|
+ Visibility="{Binding Document.ReferenceLayerViewModel.ReferenceBitmap, ElementName=uc, Converter={converters:NullToVisibilityConverter}}"/>
|
|
|
|
+
|
|
|
|
+ <TextBlock IsEnabled="{Binding ElementName=uc, Path=IsEnabled}"
|
|
|
|
+ Margin="0 0 5 0" Foreground="White"
|
|
|
|
+ FontSize="15" VerticalAlignment="Center">Add Reference Layer</TextBlock>
|
|
|
|
+ </StackPanel>
|
|
<i:Interaction.Triggers>
|
|
<i:Interaction.Triggers>
|
|
<i:EventTrigger EventName="MouseUp">
|
|
<i:EventTrigger EventName="MouseUp">
|
|
<i:InvokeCommandAction Command="{cmds:Command PixiEditor.Layer.ImportReferenceLayer}"
|
|
<i:InvokeCommandAction Command="{cmds:Command PixiEditor.Layer.ImportReferenceLayer}"
|
|
- PassEventArgsToCommand="True"/>
|
|
|
|
|
|
+ PassEventArgsToCommand="True"/>
|
|
</i:EventTrigger>
|
|
</i:EventTrigger>
|
|
</i:Interaction.Triggers>
|
|
</i:Interaction.Triggers>
|
|
</Grid>
|
|
</Grid>
|
|
</Grid>
|
|
</Grid>
|
|
- <Grid Grid.Column="0" Height="16" Name="layerVisibilityCheckboxGrid">
|
|
|
|
- <CheckBox
|
|
|
|
- Visibility="{Binding Document.ReferenceLayerViewModel.ReferenceBitmap,
|
|
|
|
- ElementName=uc,
|
|
|
|
- Converter={converters:NotNullToVisibilityConverter}}"
|
|
|
|
- Style="{StaticResource ImageCheckBox}" VerticalAlignment="Center"
|
|
|
|
- IsThreeState="False" HorizontalAlignment="Center"
|
|
|
|
- IsChecked="{Binding Path=Document.ReferenceLayerViewModel.IsVisibleBindable, Mode=TwoWay, ElementName=uc}"/>
|
|
|
|
- </Grid>
|
|
|
|
- <StackPanel Name="middleStackPanel" Height="40" Orientation="Horizontal" Grid.Column="1" HorizontalAlignment="Left">
|
|
|
|
- <Button Cursor="Hand" Grid.Column="1"
|
|
|
|
|
|
+
|
|
|
|
+ <DockPanel Grid.Row="0" VerticalAlignment="Center" Height="40"
|
|
|
|
+ Visibility="{Binding Document.ReferenceLayerViewModel.ReferenceBitmap, ElementName=uc, Converter={converters:NotNullToVisibilityConverter}}" >
|
|
|
|
+ <Grid Height="16" Name="layerVisibilityCheckboxGrid" DockPanel.Dock="Left" Margin="10,0,5,0">
|
|
|
|
+ <CheckBox
|
|
|
|
+ Style="{StaticResource ImageCheckBox}" VerticalAlignment="Center"
|
|
|
|
+ IsThreeState="False" HorizontalAlignment="Center"
|
|
|
|
+ IsChecked="{Binding Path=Document.ReferenceLayerViewModel.IsVisibleBindable, Mode=TwoWay, ElementName=uc}"/>
|
|
|
|
+ </Grid>
|
|
|
|
+ <Border
|
|
|
|
+ HorizontalAlignment="Left" DockPanel.Dock="Left"
|
|
|
|
+ Width="30" Height="30"
|
|
|
|
+ BorderThickness="1"
|
|
|
|
+ BorderBrush="Black"
|
|
|
|
+ Background="{StaticResource MainColor}"
|
|
|
|
+ Margin="5, 0, 10, 0">
|
|
|
|
+ <Image Source="{Binding Document.ReferenceLayerViewModel.ReferenceBitmap,ElementName=uc}" Stretch="Uniform" Width="26" Height="26"
|
|
|
|
+ RenderOptions.BitmapScalingMode="HighQuality" IsHitTestVisible="False"/>
|
|
|
|
+ </Border>
|
|
|
|
+ <Button Cursor="Hand" Grid.Column="1" DockPanel.Dock="Right"
|
|
|
|
+ Command="{cmds:Command PixiEditor.Layer.DeleteReferenceLayer}"
|
|
|
|
+ Style="{StaticResource ImageButtonStyle}"
|
|
|
|
+ RenderOptions.BitmapScalingMode="HighQuality"
|
|
|
|
+ Margin="3,0,5,0"
|
|
|
|
+ Width="20" Height="20" HorizontalAlignment="Right">
|
|
|
|
+ <Button.Background>
|
|
|
|
+ <ImageBrush ImageSource="/Images/Trash.png"/>
|
|
|
|
+ </Button.Background>
|
|
|
|
+ </Button>
|
|
|
|
+ <Button Cursor="Hand" DockPanel.Dock="Right"
|
|
Command="{cmds:Command PixiEditor.Layer.ResetReferenceLayerPosition}"
|
|
Command="{cmds:Command PixiEditor.Layer.ResetReferenceLayerPosition}"
|
|
- Visibility="{Binding Document.ReferenceLayerViewModel.ReferenceBitmap, ElementName=uc, Converter={BoolToVisibilityConverter}}"
|
|
|
|
Style="{StaticResource ImageButtonStyle}"
|
|
Style="{StaticResource ImageButtonStyle}"
|
|
ToolTip="Reset reference layer position"
|
|
ToolTip="Reset reference layer position"
|
|
RenderOptions.BitmapScalingMode="HighQuality"
|
|
RenderOptions.BitmapScalingMode="HighQuality"
|
|
- Margin="3"
|
|
|
|
Width="20" Height="20" HorizontalAlignment="Right">
|
|
Width="20" Height="20" HorizontalAlignment="Right">
|
|
<Button.Background>
|
|
<Button.Background>
|
|
<ImageBrush ImageSource="/Images/Layout.png"/>
|
|
<ImageBrush ImageSource="/Images/Layout.png"/>
|
|
</Button.Background>
|
|
</Button.Background>
|
|
</Button>
|
|
</Button>
|
|
- <Button Cursor="Hand" Grid.Column="1"
|
|
|
|
|
|
+ <Button Cursor="Hand" DockPanel.Dock="Right"
|
|
Command="{cmds:Command PixiEditor.Layer.TransformReferenceLayer}"
|
|
Command="{cmds:Command PixiEditor.Layer.TransformReferenceLayer}"
|
|
- Visibility="{Binding Document.ReferenceLayerViewModel.ReferenceBitmap, ElementName=uc, Converter={BoolToVisibilityConverter}}"
|
|
|
|
Style="{StaticResource ImageButtonStyle}"
|
|
Style="{StaticResource ImageButtonStyle}"
|
|
ToolTip="Transform reference layer"
|
|
ToolTip="Transform reference layer"
|
|
RenderOptions.BitmapScalingMode="HighQuality"
|
|
RenderOptions.BitmapScalingMode="HighQuality"
|
|
@@ -66,76 +128,11 @@
|
|
<ImageBrush ImageSource="/Images/Tools/MoveImage.png"/>
|
|
<ImageBrush ImageSource="/Images/Tools/MoveImage.png"/>
|
|
</Button.Background>
|
|
</Button.Background>
|
|
</Button>
|
|
</Button>
|
|
- <Border HorizontalAlignment="Left"
|
|
|
|
- Visibility="{Binding Document.ReferenceLayerViewModel.ReferenceBitmap, ElementName=uc, Converter={converters:NotNullToVisibilityConverter}}"
|
|
|
|
- Width="30" Height="30"
|
|
|
|
- BorderThickness="1" BorderBrush="Black"
|
|
|
|
- Background="{StaticResource MainColor}"
|
|
|
|
- Margin="5, 0, 10, 0">
|
|
|
|
- <Image Source="{Binding Document.ReferenceLayerViewModel.ReferenceBitmap,ElementName=uc}" Stretch="Uniform" Width="26" Height="26"
|
|
|
|
- RenderOptions.BitmapScalingMode="HighQuality" IsHitTestVisible="False"/>
|
|
|
|
- </Border>
|
|
|
|
- <Image Margin="30 0 5 0" Width="20" Source="/Images/Layer-add.png"
|
|
|
|
- Visibility="{Binding Document.ReferenceLayerViewModel.ReferenceBitmap, ElementName=uc, Converter={converters:NullToVisibilityConverter}}"/>
|
|
|
|
-
|
|
|
|
- <local1:PrependTextBlock IsEnabled="{Binding ElementName=uc, Path=IsEnabled}"
|
|
|
|
- Margin="0 0 5 0" Prepend="Add " Foreground="White"
|
|
|
|
- HidePrepend="{Binding Document.ReferenceLayerViewModel.ReferenceBitmap, ElementName=uc, Converter={converters:NotNullToBoolConverter}}"
|
|
|
|
- FontSize="15" VerticalAlignment="Center" Text="Reference Layer" />
|
|
|
|
- <Button Cursor="Hand" Grid.Column="1"
|
|
|
|
- Command="{cmds:Command PixiEditor.Layer.DeleteReferenceLayer}"
|
|
|
|
- Visibility="{Binding Document.ReferenceLayerViewModel.ReferenceBitmap, ElementName=uc, Converter={BoolToVisibilityConverter}}"
|
|
|
|
- Style="{StaticResource ImageButtonStyle}"
|
|
|
|
- RenderOptions.BitmapScalingMode="HighQuality"
|
|
|
|
- Width="20" Height="20" HorizontalAlignment="Right">
|
|
|
|
- <Button.Background>
|
|
|
|
- <ImageBrush ImageSource="/Images/Trash.png"/>
|
|
|
|
- </Button.Background>
|
|
|
|
- </Button>
|
|
|
|
- </StackPanel>
|
|
|
|
- <CheckBox Focusable="False" 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" Focusable="False">
|
|
|
|
- <Image Focusable="False" Width="14" Cursor="Hand" x:Name="checkboxImage" Source="/Images/ChevronDown.png">
|
|
|
|
- <Image.RenderTransform>
|
|
|
|
- <RotateTransform Angle="0"/>
|
|
|
|
- </Image.RenderTransform>
|
|
|
|
- </Image>
|
|
|
|
- <ContentPresenter Focusable="False"/>
|
|
|
|
- </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>
|
|
|
|
|
|
+ <TextBlock IsEnabled="{Binding ElementName=uc, Path=IsEnabled}" HorizontalAlignment="Center"
|
|
|
|
+ Margin="0 0 5 0" Foreground="White"
|
|
|
|
+ FontSize="15" VerticalAlignment="Center">Reference Layer</TextBlock>
|
|
|
|
+ </DockPanel>
|
|
</Grid>
|
|
</Grid>
|
|
- </Grid>
|
|
|
|
|
|
+ </DockPanel>
|
|
</Border>
|
|
</Border>
|
|
</UserControl>
|
|
</UserControl>
|