|
@@ -4,58 +4,70 @@
|
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
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"
|
|
xmlns:local="clr-namespace:PixiEditor.Views.UserControls"
|
|
- xmlns:vws="clr-namespace:PixiEditor.Views"
|
|
|
|
|
|
+ xmlns:vws="clr-namespace:PixiEditor.Views" xmlns:ui="clr-namespace:PixiEditor.Helpers.UI"
|
|
mc:Ignorable="d"
|
|
mc:Ignorable="d"
|
|
- d:DesignHeight="450" d:DesignWidth="800" Name="uc">
|
|
|
|
|
|
+ d:DesignHeight="60" d:DesignWidth="250" Name="uc">
|
|
<Grid>
|
|
<Grid>
|
|
- <vws:LayerItem Tag="{Binding Path=DataContext, ElementName=layersItemsControl}"
|
|
|
|
|
|
+ <ItemsControl Name="itemsControl" ItemsSource="{Binding Item.Children, ElementName=uc}">
|
|
|
|
+ <ItemsControl.ItemsPanel>
|
|
|
|
+ <ItemsPanelTemplate>
|
|
|
|
+ <ui:ReversedOrderStackPanel Orientation="Vertical" />
|
|
|
|
+ </ItemsPanelTemplate>
|
|
|
|
+ </ItemsControl.ItemsPanel>
|
|
|
|
+ <ItemsControl.ItemTemplate>
|
|
|
|
+ <DataTemplate>
|
|
|
|
+ <vws:LayerItem Tag="{Binding Path=DataContext, ElementName=layersItemsControl}"
|
|
LayerIndex="{Binding RelativeSource={RelativeSource Mode=TemplatedParent},
|
|
LayerIndex="{Binding RelativeSource={RelativeSource Mode=TemplatedParent},
|
|
Path=(ItemsControl.AlternationIndex)}"
|
|
Path=(ItemsControl.AlternationIndex)}"
|
|
SetActiveLayerCommand="{Binding DataContext.LayersViewModel.SetActiveLayerCommand,
|
|
SetActiveLayerCommand="{Binding DataContext.LayersViewModel.SetActiveLayerCommand,
|
|
ElementName=layersItemsControl}"
|
|
ElementName=layersItemsControl}"
|
|
- LayerName="{Binding Name, Mode=TwoWay}" IsActive="{Binding IsActive, Mode=TwoWay}"
|
|
|
|
|
|
+ LayerName="{Binding Name, Mode=TwoWay}"
|
|
|
|
+ IsActive="{Binding IsActive, Mode=TwoWay}"
|
|
IsRenaming="{Binding IsRenaming, Mode=TwoWay}"
|
|
IsRenaming="{Binding IsRenaming, Mode=TwoWay}"
|
|
PreviewImage="{Binding LayerBitmap}"
|
|
PreviewImage="{Binding LayerBitmap}"
|
|
MoveToBackCommand="{Binding DataContext.LayersViewModel.MoveToBackCommand, ElementName=layersItemsControl}"
|
|
MoveToBackCommand="{Binding DataContext.LayersViewModel.MoveToBackCommand, ElementName=layersItemsControl}"
|
|
MoveToFrontCommand="{Binding DataContext.LayersViewModel.MoveToFrontCommand, ElementName=layersItemsControl}">
|
|
MoveToFrontCommand="{Binding DataContext.LayersViewModel.MoveToFrontCommand, ElementName=layersItemsControl}">
|
|
- <vws:LayerItem.ContextMenu>
|
|
|
|
- <ContextMenu>
|
|
|
|
- <MenuItem Header="Delete"
|
|
|
|
|
|
+ <vws:LayerItem.ContextMenu>
|
|
|
|
+ <ContextMenu>
|
|
|
|
+ <MenuItem Header="Delete"
|
|
Command="{Binding PlacementTarget.Tag.LayersViewModel.DeleteLayersCommand,
|
|
Command="{Binding PlacementTarget.Tag.LayersViewModel.DeleteLayersCommand,
|
|
RelativeSource={RelativeSource AncestorType=ContextMenu}}"
|
|
RelativeSource={RelativeSource AncestorType=ContextMenu}}"
|
|
CommandParameter="{Binding RelativeSource={RelativeSource Mode=TemplatedParent},
|
|
CommandParameter="{Binding RelativeSource={RelativeSource Mode=TemplatedParent},
|
|
Path=(ItemsControl.AlternationIndex)}" />
|
|
Path=(ItemsControl.AlternationIndex)}" />
|
|
- <MenuItem Header="Rename"
|
|
|
|
|
|
+ <MenuItem Header="Rename"
|
|
Command="{Binding PlacementTarget.Tag.LayersViewModel.RenameLayerCommand,
|
|
Command="{Binding PlacementTarget.Tag.LayersViewModel.RenameLayerCommand,
|
|
RelativeSource={RelativeSource AncestorType=ContextMenu}}"
|
|
RelativeSource={RelativeSource AncestorType=ContextMenu}}"
|
|
CommandParameter="{Binding RelativeSource={RelativeSource Mode=TemplatedParent},
|
|
CommandParameter="{Binding RelativeSource={RelativeSource Mode=TemplatedParent},
|
|
Path=(ItemsControl.AlternationIndex)}" />
|
|
Path=(ItemsControl.AlternationIndex)}" />
|
|
- <MenuItem Header="Move to front"
|
|
|
|
|
|
+ <MenuItem Header="Move to front"
|
|
Command="{Binding PlacementTarget.Tag.LayersViewModel.MoveToFrontCommand,
|
|
Command="{Binding PlacementTarget.Tag.LayersViewModel.MoveToFrontCommand,
|
|
RelativeSource={RelativeSource AncestorType=ContextMenu}}"
|
|
RelativeSource={RelativeSource AncestorType=ContextMenu}}"
|
|
CommandParameter="{Binding RelativeSource={RelativeSource Mode=TemplatedParent},
|
|
CommandParameter="{Binding RelativeSource={RelativeSource Mode=TemplatedParent},
|
|
Path=(ItemsControl.AlternationIndex)}" />
|
|
Path=(ItemsControl.AlternationIndex)}" />
|
|
- <MenuItem Header="Move to back"
|
|
|
|
|
|
+ <MenuItem Header="Move to back"
|
|
Command="{Binding PlacementTarget.Tag.LayersViewModel.MoveToBackCommand,
|
|
Command="{Binding PlacementTarget.Tag.LayersViewModel.MoveToBackCommand,
|
|
RelativeSource={RelativeSource AncestorType=ContextMenu}}"
|
|
RelativeSource={RelativeSource AncestorType=ContextMenu}}"
|
|
CommandParameter="{Binding RelativeSource={RelativeSource Mode=TemplatedParent},
|
|
CommandParameter="{Binding RelativeSource={RelativeSource Mode=TemplatedParent},
|
|
Path=(ItemsControl.AlternationIndex)}" />
|
|
Path=(ItemsControl.AlternationIndex)}" />
|
|
- <Separator/>
|
|
|
|
- <MenuItem Header="Merge selected"
|
|
|
|
|
|
+ <Separator/>
|
|
|
|
+ <MenuItem Header="Merge selected"
|
|
Command="{Binding PlacementTarget.Tag.LayersViewModel.MergeSelectedCommand,
|
|
Command="{Binding PlacementTarget.Tag.LayersViewModel.MergeSelectedCommand,
|
|
RelativeSource={RelativeSource AncestorType=ContextMenu}}"/>
|
|
RelativeSource={RelativeSource AncestorType=ContextMenu}}"/>
|
|
- <MenuItem Header="Merge with above"
|
|
|
|
|
|
+ <MenuItem Header="Merge with above"
|
|
Command="{Binding PlacementTarget.Tag.LayersViewModel.MergeWithAboveCommand,
|
|
Command="{Binding PlacementTarget.Tag.LayersViewModel.MergeWithAboveCommand,
|
|
RelativeSource={RelativeSource AncestorType=ContextMenu}}"
|
|
RelativeSource={RelativeSource AncestorType=ContextMenu}}"
|
|
CommandParameter="{Binding RelativeSource={RelativeSource Mode=TemplatedParent},
|
|
CommandParameter="{Binding RelativeSource={RelativeSource Mode=TemplatedParent},
|
|
Path=(ItemsControl.AlternationIndex)}" />
|
|
Path=(ItemsControl.AlternationIndex)}" />
|
|
- <MenuItem Header="Merge with below"
|
|
|
|
|
|
+ <MenuItem Header="Merge with below"
|
|
Command="{Binding PlacementTarget.Tag.LayersViewModel.MergeWithBelowCommand,
|
|
Command="{Binding PlacementTarget.Tag.LayersViewModel.MergeWithBelowCommand,
|
|
RelativeSource={RelativeSource AncestorType=ContextMenu}}"
|
|
RelativeSource={RelativeSource AncestorType=ContextMenu}}"
|
|
CommandParameter="{Binding RelativeSource={RelativeSource Mode=TemplatedParent},
|
|
CommandParameter="{Binding RelativeSource={RelativeSource Mode=TemplatedParent},
|
|
Path=(ItemsControl.AlternationIndex)}" />
|
|
Path=(ItemsControl.AlternationIndex)}" />
|
|
- </ContextMenu>
|
|
|
|
- </vws:LayerItem.ContextMenu>
|
|
|
|
- </vws:LayerItem>
|
|
|
|
|
|
+ </ContextMenu>
|
|
|
|
+ </vws:LayerItem.ContextMenu>
|
|
|
|
+ </vws:LayerItem>
|
|
|
|
+ </DataTemplate>
|
|
|
|
+ </ItemsControl.ItemTemplate>
|
|
|
|
+ </ItemsControl>
|
|
</Grid>
|
|
</Grid>
|
|
</UserControl>
|
|
</UserControl>
|