|
@@ -6,7 +6,10 @@
|
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
xmlns:docVm="clr-namespace:PixiEditor.ViewModels.SubViewModels.Document"
|
|
xmlns:docVm="clr-namespace:PixiEditor.ViewModels.SubViewModels.Document"
|
|
xmlns:ui="clr-namespace:PixiEditor.Helpers.UI"
|
|
xmlns:ui="clr-namespace:PixiEditor.Helpers.UI"
|
|
|
|
+ xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
|
|
|
|
+ xmlns:beh="clr-namespace:PixiEditor.Helpers.Behaviours"
|
|
xmlns:vws="clr-namespace:PixiEditor.Views"
|
|
xmlns:vws="clr-namespace:PixiEditor.Views"
|
|
|
|
+ xmlns:sys="clr-namespace:System;assembly=mscorlib"
|
|
xmlns:converters="clr-namespace:PixiEditor.Helpers.Converters"
|
|
xmlns:converters="clr-namespace:PixiEditor.Helpers.Converters"
|
|
xmlns:commands="clr-namespace:PixiEditor.Models.Commands.XAML"
|
|
xmlns:commands="clr-namespace:PixiEditor.Models.Commands.XAML"
|
|
xmlns:layerUserControls="clr-namespace:PixiEditor.Views.UserControls.Layers"
|
|
xmlns:layerUserControls="clr-namespace:PixiEditor.Views.UserControls.Layers"
|
|
@@ -23,7 +26,6 @@
|
|
<StackPanel Orientation="Horizontal" DockPanel.Dock="Left">
|
|
<StackPanel Orientation="Horizontal" DockPanel.Dock="Left">
|
|
<Button Command="{commands:Command PixiEditor.Layer.NewLayer}"
|
|
<Button Command="{commands:Command PixiEditor.Layer.NewLayer}"
|
|
Height="24" Width="24" Cursor="Hand" ToolTip="New Layer"
|
|
Height="24" Width="24" Cursor="Hand" ToolTip="New Layer"
|
|
- CommandParameter="{Binding Path=SelectedItem, ElementName=layersManager}"
|
|
|
|
HorizontalAlignment="Stretch" Margin="5"
|
|
HorizontalAlignment="Stretch" Margin="5"
|
|
Style="{StaticResource ToolButtonStyle}">
|
|
Style="{StaticResource ToolButtonStyle}">
|
|
<Button.Background>
|
|
<Button.Background>
|
|
@@ -31,7 +33,6 @@
|
|
</Button.Background>
|
|
</Button.Background>
|
|
</Button>
|
|
</Button>
|
|
<Button Command="{commands:Command PixiEditor.Layer.NewFolder}"
|
|
<Button Command="{commands:Command PixiEditor.Layer.NewFolder}"
|
|
- CommandParameter="{Binding Path=SelectedItem, ElementName=layersManager}"
|
|
|
|
Height="24" Width="24" ToolTip="New Group" Cursor="Hand"
|
|
Height="24" Width="24" ToolTip="New Group" Cursor="Hand"
|
|
HorizontalAlignment="Stretch" Margin="5"
|
|
HorizontalAlignment="Stretch" Margin="5"
|
|
Style="{StaticResource ToolButtonStyle}">
|
|
Style="{StaticResource ToolButtonStyle}">
|
|
@@ -39,8 +40,7 @@
|
|
<ImageBrush ImageSource="/Images/Folder-add.png"/>
|
|
<ImageBrush ImageSource="/Images/Folder-add.png"/>
|
|
</Button.Background>
|
|
</Button.Background>
|
|
</Button>
|
|
</Button>
|
|
- <Button Command="{commands:Command PixiEditor.Layer.DeleteSelected}"
|
|
|
|
- CommandParameter="{Binding ElementName=layersManager, Path=SelectedItem}" Height="24" Width="24" ToolTip="Delete selected" Cursor="Hand"
|
|
|
|
|
|
+ <Button Command="{commands:Command PixiEditor.Layer.DeleteSelected}" Height="24" Width="24" ToolTip="Delete selected" Cursor="Hand"
|
|
HorizontalAlignment="Stretch" Margin="5"
|
|
HorizontalAlignment="Stretch" Margin="5"
|
|
Style="{StaticResource ToolButtonStyle}">
|
|
Style="{StaticResource ToolButtonStyle}">
|
|
<Button.Background>
|
|
<Button.Background>
|
|
@@ -49,14 +49,44 @@
|
|
</Button>
|
|
</Button>
|
|
</StackPanel>
|
|
</StackPanel>
|
|
<StackPanel Orientation="Horizontal" DockPanel.Dock="Right" Margin="0,0,10,0" HorizontalAlignment="Right" Focusable="True">
|
|
<StackPanel Orientation="Horizontal" DockPanel.Dock="Right" Margin="0,0,10,0" HorizontalAlignment="Right" Focusable="True">
|
|
- <Label Content="Opacity" Foreground="White" VerticalAlignment="Center"/>
|
|
|
|
|
|
+ <Slider
|
|
|
|
+ Width="50"
|
|
|
|
+ Minimum="0"
|
|
|
|
+ Maximum="1"
|
|
|
|
+ SmallChange="0.01"
|
|
|
|
+ LargeChange="0.1"
|
|
|
|
+ IsSnapToTickEnabled="False"
|
|
|
|
+ x:Name="opacitySlider"
|
|
|
|
+ VerticalAlignment="Center"
|
|
|
|
+ HorizontalAlignment="Stretch"
|
|
|
|
+ Value="{Binding ElementName=layersManager, Path=ActiveDocument.SelectedStructureMember.OpacityBindable, Mode=OneWay}">
|
|
|
|
+ <i:Interaction.Behaviors>
|
|
|
|
+ <beh:SliderUpdateBehavior
|
|
|
|
+ DragStarted="{commands:Command PixiEditor.Layer.OpacitySliderDragStarted}"
|
|
|
|
+ DragValueChanged="{commands:Command PixiEditor.Layer.OpacitySliderDragged, UseProvided=True}"
|
|
|
|
+ DragEnded="{commands:Command PixiEditor.Layer.OpacitySliderDragEnded}"
|
|
|
|
+ ValueFromSlider="{Binding ElementName=opacitySlider, Path=Value}" />
|
|
|
|
+ </i:Interaction.Behaviors>
|
|
|
|
+ </Slider>
|
|
<userControls:NumberInput
|
|
<userControls:NumberInput
|
|
- Min="0" Max="100"
|
|
|
|
- x:Name="numberInput"
|
|
|
|
- IsEnabled="{Binding Path=OpacityInputEnabled, ElementName=layersManager}"
|
|
|
|
- Width="40" Height="20"
|
|
|
|
- VerticalAlignment="Center"
|
|
|
|
- LostFocus="NumberInput_LostFocus"/>
|
|
|
|
|
|
+ Min="0" Max="100"
|
|
|
|
+ x:Name="numberInput"
|
|
|
|
+ IsEnabled="{Binding Path=ActiveDocument, ElementName=layersManager, Converter={converters:NotNullToVisibilityConverter}}"
|
|
|
|
+ Width="40" Height="20"
|
|
|
|
+ VerticalAlignment="Center"
|
|
|
|
+ LostFocus="NumberInput_LostFocus">
|
|
|
|
+ <userControls:NumberInput.Value>
|
|
|
|
+ <Binding
|
|
|
|
+ Mode="TwoWay"
|
|
|
|
+ ElementName="layersManager"
|
|
|
|
+ Path="ActiveDocument.SelectedStructureMember.OpacityBindable"
|
|
|
|
+ Converter="{converters:MultiplyConverter}">
|
|
|
|
+ <Binding.ConverterParameter>
|
|
|
|
+ <sys:Double>100</sys:Double>
|
|
|
|
+ </Binding.ConverterParameter>
|
|
|
|
+ </Binding>
|
|
|
|
+ </userControls:NumberInput.Value>
|
|
|
|
+ </userControls:NumberInput>
|
|
<Label Content="%" Foreground="White" VerticalAlignment="Center"/>
|
|
<Label Content="%" Foreground="White" VerticalAlignment="Center"/>
|
|
</StackPanel>
|
|
</StackPanel>
|
|
</DockPanel>
|
|
</DockPanel>
|
|
@@ -64,11 +94,10 @@
|
|
<DockPanel LastChildFill="True" Grid.Row="2" Margin="0, -12, 0, 0">
|
|
<DockPanel LastChildFill="True" Grid.Row="2" Margin="0, -12, 0, 0">
|
|
<layerUserControls:ReferenceLayer
|
|
<layerUserControls:ReferenceLayer
|
|
DockPanel.Dock="Bottom"
|
|
DockPanel.Dock="Bottom"
|
|
- Visibility="{Binding Path=OpacityInputEnabled, ElementName=layersManager,
|
|
|
|
- Converter={BoolToVisibilityConverter}}"
|
|
|
|
|
|
+ Visibility="{Binding Path=ActiveDocument, ElementName=layersManager, Converter={converters:NotNullToVisibilityConverter}}"
|
|
Background="{StaticResource MainColor}"
|
|
Background="{StaticResource MainColor}"
|
|
Grid.Row="3" VerticalAlignment="Bottom"/>
|
|
Grid.Row="3" VerticalAlignment="Bottom"/>
|
|
- <TreeView DockPanel.Dock="Top" Name="treeView" ItemsSource="{Binding StructureRoot.Children, ElementName=layersManager}" SelectedItemChanged="TreeView_SelectedItemChanged">
|
|
|
|
|
|
+ <TreeView DockPanel.Dock="Top" Name="treeView" ItemsSource="{Binding ActiveDocument.StructureRoot.Children, ElementName=layersManager}">
|
|
<TreeView.ItemsPanel>
|
|
<TreeView.ItemsPanel>
|
|
<ItemsPanelTemplate>
|
|
<ItemsPanelTemplate>
|
|
<ui:ReversedOrderStackPanel/>
|
|
<ui:ReversedOrderStackPanel/>
|
|
@@ -78,13 +107,11 @@
|
|
<HierarchicalDataTemplate DataType="{x:Type docVm:FolderViewModel}" ItemsSource="{Binding Children}">
|
|
<HierarchicalDataTemplate DataType="{x:Type docVm:FolderViewModel}" ItemsSource="{Binding Children}">
|
|
<layerUserControls:FolderControl
|
|
<layerUserControls:FolderControl
|
|
Folder="{Binding}"
|
|
Folder="{Binding}"
|
|
- MouseDown="SelectActiveItem"
|
|
|
|
MouseMove="LayerGroup_MouseMove"/>
|
|
MouseMove="LayerGroup_MouseMove"/>
|
|
</HierarchicalDataTemplate>
|
|
</HierarchicalDataTemplate>
|
|
<DataTemplate DataType="{x:Type docVm:LayerViewModel}">
|
|
<DataTemplate DataType="{x:Type docVm:LayerViewModel}">
|
|
<layerUserControls:LayerControl
|
|
<layerUserControls:LayerControl
|
|
Layer="{Binding}"
|
|
Layer="{Binding}"
|
|
- MouseDown="SelectActiveItem"
|
|
|
|
MouseMove="LayerStructureItemContainer_MouseMove"/>
|
|
MouseMove="LayerStructureItemContainer_MouseMove"/>
|
|
</DataTemplate>
|
|
</DataTemplate>
|
|
</TreeView.Resources>
|
|
</TreeView.Resources>
|