Browse Source

Single DockingManager WIP

flabbet 4 years ago
parent
commit
e7dfccdfe3

+ 1 - 1
PixiEditor/App.xaml

@@ -18,7 +18,7 @@
                 <ResourceDictionary Source="Styles/LabelStyles.xaml" />
                 <ResourceDictionary Source="Styles/LabelStyles.xaml" />
                 <ResourceDictionary Source="Styles/AvalonDock/DarkBrushes.xaml" />
                 <ResourceDictionary Source="Styles/AvalonDock/DarkBrushes.xaml" />
                 <ResourceDictionary Source="Styles/AvalonDock/Themes/Menu/DarkBrushes.xaml" />
                 <ResourceDictionary Source="Styles/AvalonDock/Themes/Menu/DarkBrushes.xaml" />
-                <ResourceDictionary Source="Styles/AvalonDock/OverlayButtons.xaml" />
+                <ResourceDictionary Source="Styles/AvalonDock/Themes/OverlayButtons.xaml" />
                 <ResourceDictionary Source="Styles/AvalonDock/Themes/Menu/MenuItem.xaml" />
                 <ResourceDictionary Source="Styles/AvalonDock/Themes/Menu/MenuItem.xaml" />
                 <ResourceDictionary Source="Styles/AvalonDock/Themes/Icons/IconGeometry.xaml" />
                 <ResourceDictionary Source="Styles/AvalonDock/Themes/Icons/IconGeometry.xaml" />
                 <ResourceDictionary Source="Styles/AvalonDock/Themes/Generic.xaml" />
                 <ResourceDictionary Source="Styles/AvalonDock/Themes/Generic.xaml" />

+ 28 - 0
PixiEditor/Helpers/UI/DocumentsTemplateSelector.cs

@@ -0,0 +1,28 @@
+using System.Windows;
+using System.Windows.Controls;
+using AvalonDock.Layout;
+using PixiEditor.Models.DataHolders;
+using PixiEditor.ViewModels;
+
+namespace PixiEditor.Helpers.UI
+{
+    public class DocumentsTemplateSelector : DataTemplateSelector
+    {
+        public DocumentsTemplateSelector()
+        {
+
+        }
+
+        public DataTemplate DocumentsViewTemplate { get; set; }
+
+        public override DataTemplate SelectTemplate(object item, DependencyObject container)
+        {
+            if (item is Document)
+            {
+                return DocumentsViewTemplate;
+            }
+
+            return base.SelectTemplate(item, container);
+        }
+    }
+}

+ 25 - 0
PixiEditor/Helpers/UI/PanelsStyleSelector.cs

@@ -0,0 +1,25 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using PixiEditor.Models.DataHolders;
+
+namespace PixiEditor.Helpers.UI
+{
+    public class PanelsStyleSelector : StyleSelector
+    {
+        public Style DocumentTabStyle { get; set; }
+
+        public override Style SelectStyle(object item, DependencyObject container)
+        {
+            if (item is Document)
+            {
+                return DocumentTabStyle;
+            }
+            return base.SelectStyle(item, container);
+        }
+    }
+}

+ 5 - 5
PixiEditor/Styles/AvalonDock/DarkBrushes.xaml

@@ -136,12 +136,12 @@
 	<SolidColorBrush
 	<SolidColorBrush
 		x:Key="{x:Static reskeys:ResourceKeys.DocumentWellTabButtonSelectedActiveHoveredBackground}"
 		x:Key="{x:Static reskeys:ResourceKeys.DocumentWellTabButtonSelectedActiveHoveredBackground}"
 		options:Freeze="true"
 		options:Freeze="true"
-		Color="Black" />
+		Color="#616161" />
 	<!--  AccentColor  -->
 	<!--  AccentColor  -->
 	<SolidColorBrush
 	<SolidColorBrush
 		x:Key="{x:Static reskeys:ResourceKeys.DocumentWellTabButtonSelectedActiveHoveredBorder}"
 		x:Key="{x:Static reskeys:ResourceKeys.DocumentWellTabButtonSelectedActiveHoveredBorder}"
 		options:Freeze="true"
 		options:Freeze="true"
-		Color="Black" />
+		Color="#616161" />
 	<SolidColorBrush
 	<SolidColorBrush
 		x:Key="{x:Static reskeys:ResourceKeys.DocumentWellTabButtonSelectedActiveHoveredGlyph}"
 		x:Key="{x:Static reskeys:ResourceKeys.DocumentWellTabButtonSelectedActiveHoveredGlyph}"
 		options:Freeze="true"
 		options:Freeze="true"
@@ -150,12 +150,12 @@
 	<SolidColorBrush
 	<SolidColorBrush
 		x:Key="{x:Static reskeys:ResourceKeys.DocumentWellTabButtonSelectedActivePressedBackground}"
 		x:Key="{x:Static reskeys:ResourceKeys.DocumentWellTabButtonSelectedActivePressedBackground}"
 		options:Freeze="true"
 		options:Freeze="true"
-		Color="#0E6198" />
+		Color="Black" />
 	<!--  AccentColor  -->
 	<!--  AccentColor  -->
 	<SolidColorBrush
 	<SolidColorBrush
 		x:Key="{x:Static reskeys:ResourceKeys.DocumentWellTabButtonSelectedActivePressedBorder}"
 		x:Key="{x:Static reskeys:ResourceKeys.DocumentWellTabButtonSelectedActivePressedBorder}"
 		options:Freeze="true"
 		options:Freeze="true"
-		Color="#0E6198" />
+		Color="Black" />
 	<SolidColorBrush
 	<SolidColorBrush
 		x:Key="{x:Static reskeys:ResourceKeys.DocumentWellTabButtonSelectedActivePressedGlyph}"
 		x:Key="{x:Static reskeys:ResourceKeys.DocumentWellTabButtonSelectedActivePressedGlyph}"
 		options:Freeze="true"
 		options:Freeze="true"
@@ -332,7 +332,7 @@
 	<SolidColorBrush
 	<SolidColorBrush
 		x:Key="{x:Static reskeys:ResourceKeys.ToolWindowTabSelectedInactiveText}"
 		x:Key="{x:Static reskeys:ResourceKeys.ToolWindowTabSelectedInactiveText}"
 		options:Freeze="true"
 		options:Freeze="true"
-		Color="#B00022" />
+		Color="#FFFFFF" />
 	<SolidColorBrush
 	<SolidColorBrush
 		x:Key="{x:Static reskeys:ResourceKeys.ToolWindowTabUnselectedBackground}"
 		x:Key="{x:Static reskeys:ResourceKeys.ToolWindowTabUnselectedBackground}"
 		options:Freeze="true"
 		options:Freeze="true"

+ 2 - 2
PixiEditor/Styles/AvalonDock/PixiEditorDockTheme.xaml

@@ -1,7 +1,7 @@
 <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
 <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
     <ResourceDictionary.MergedDictionaries>
     <ResourceDictionary.MergedDictionaries>
-        <ResourceDictionary Source="/Styles/AvalonDock/DarkBrushes.xaml" />
-        <ResourceDictionary Source="/Styles/AvalonDock/Themes/Generic.xaml" />
+        <ResourceDictionary Source="/PixiEditor;component/Styles/AvalonDock/DarkBrushes.xaml" />
+        <ResourceDictionary Source="/PixiEditor;component/Styles/AvalonDock/Themes/Generic.xaml" />
     </ResourceDictionary.MergedDictionaries>
     </ResourceDictionary.MergedDictionaries>
 
 
 </ResourceDictionary>
 </ResourceDictionary>

+ 3 - 3
PixiEditor/Styles/AvalonDock/Themes/Generic.xaml

@@ -9,9 +9,9 @@
     xmlns:ex="clr-namespace:PixiEditor.Helpers.Extensions"
     xmlns:ex="clr-namespace:PixiEditor.Helpers.Extensions"
 	xmlns:shell="clr-namespace:Microsoft.Windows.Shell;assembly=AvalonDock">
 	xmlns:shell="clr-namespace:Microsoft.Windows.Shell;assembly=AvalonDock">
 	<ResourceDictionary.MergedDictionaries>
 	<ResourceDictionary.MergedDictionaries>
-		<ResourceDictionary Source="/Styles/AvalonDock/OverlayButtons.xaml" />
-        <ResourceDictionary Source="/Styles/AvalonDock/Themes/Menu/MenuItem.xaml" />
-		<ResourceDictionary Source="/Styles/AvalonDock/Themes/Icons/IconGeometry.xaml" />
+		<ResourceDictionary Source="/PixiEditor;component/Styles/AvalonDock/Themes/OverlayButtons.xaml" />
+        <ResourceDictionary Source="/PixiEditor;component/Styles/AvalonDock/Themes/Menu/MenuItem.xaml" />
+        <ResourceDictionary Source="/PixiEditor;component/Styles/AvalonDock/Themes/Icons/IconGeometry.xaml" />
 	</ResourceDictionary.MergedDictionaries>
 	</ResourceDictionary.MergedDictionaries>
 
 
 	<Style x:Key="DropDownControlArea" TargetType="avalonDockControls:DropDownControlArea" />
 	<Style x:Key="DropDownControlArea" TargetType="avalonDockControls:DropDownControlArea" />

+ 0 - 0
PixiEditor/Styles/AvalonDock/OverlayButtons.xaml → PixiEditor/Styles/AvalonDock/Themes/OverlayButtons.xaml


+ 1 - 0
PixiEditor/ViewModels/SubViewModels/Main/IoViewModel.cs

@@ -91,6 +91,7 @@ namespace PixiEditor.ViewModels.SubViewModels.Main
         /// <param name="parameter">CommandParameter.</param>
         /// <param name="parameter">CommandParameter.</param>
         private void MouseMove(object parameter)
         private void MouseMove(object parameter)
         {
         {
+            if (Owner.BitmapManager.ActiveDocument == null) return;
             Coordinates cords = new Coordinates(
             Coordinates cords = new Coordinates(
                 (int)Owner.BitmapManager.ActiveDocument.MouseXOnCanvas,
                 (int)Owner.BitmapManager.ActiveDocument.MouseXOnCanvas,
                 (int)Owner.BitmapManager.ActiveDocument.MouseYOnCanvas);
                 (int)Owner.BitmapManager.ActiveDocument.MouseYOnCanvas);

+ 164 - 148
PixiEditor/Views/MainWindow.xaml

@@ -62,7 +62,6 @@
         <Grid.ColumnDefinitions>
         <Grid.ColumnDefinitions>
             <ColumnDefinition Width="45" />
             <ColumnDefinition Width="45" />
             <ColumnDefinition Width="1*" />
             <ColumnDefinition Width="1*" />
-            <ColumnDefinition Width="290" />
         </Grid.ColumnDefinitions>
         </Grid.ColumnDefinitions>
         <Grid.RowDefinitions>
         <Grid.RowDefinitions>
             <RowDefinition Height="30" />
             <RowDefinition Height="30" />
@@ -172,20 +171,26 @@
         </StackPanel>
         </StackPanel>
         <Grid Grid.Column="1" Grid.Row="2" Background="#303030">
         <Grid Grid.Column="1" Grid.Row="2" Background="#303030">
             <Grid>
             <Grid>
-                <avalondock:DockingManager ActiveContent="{Binding BitmapManager.ActiveDocument, Mode=TwoWay}" 
+                <DockingManager ActiveContent="{Binding BitmapManager.ActiveDocument, Mode=TwoWay}" 
                                            DocumentsSource="{Binding BitmapManager.Documents}">
                                            DocumentsSource="{Binding BitmapManager.Documents}">
-                    <avalondock:DockingManager.Theme>
+                    <DockingManager.Theme>
                         <avalonDockTheme:PixiEditorDockTheme />
                         <avalonDockTheme:PixiEditorDockTheme />
-                    </avalondock:DockingManager.Theme>
-                    <avalondock:DockingManager.LayoutItemContainerStyle>
-                        <Style TargetType="{x:Type avalondock:LayoutItem}">
-                            <Setter Property="Title" Value="{Binding Model.Name}" />
-                            <Setter Property="CloseCommand" Value="{Binding Model.RequestCloseDocumentCommand}" />
-                        </Style>
-                    </avalondock:DockingManager.LayoutItemContainerStyle>
-                    <avalondock:DockingManager.LayoutItemTemplate>
-                        <DataTemplate DataType="{x:Type vm:ViewModelMain}">
-                            <usercontrols:DrawingViewPort
+                    </DockingManager.Theme>
+                    <avalondock:DockingManager.LayoutItemContainerStyleSelector>
+                        <ui:PanelsStyleSelector>
+                            <ui:PanelsStyleSelector.DocumentTabStyle>
+                                <Style TargetType="{x:Type avalondock:LayoutItem}">
+                                    <Setter Property="Title" Value="{Binding Model.Name}" />
+                                    <Setter Property="CloseCommand" Value="{Binding Model.RequestCloseDocumentCommand}" />
+                                </Style>
+                            </ui:PanelsStyleSelector.DocumentTabStyle>
+                        </ui:PanelsStyleSelector>
+                    </avalondock:DockingManager.LayoutItemContainerStyleSelector>
+                    <DockingManager.LayoutItemTemplateSelector>
+                        <ui:DocumentsTemplateSelector>
+                            <ui:DocumentsTemplateSelector.DocumentsViewTemplate>
+                                <DataTemplate DataType="{x:Type vm:ViewModelMain}">
+                                    <usercontrols:DrawingViewPort
                                         ZoomPercentage="{Binding ZoomPercentage}"
                                         ZoomPercentage="{Binding ZoomPercentage}"
                                         RecenterZoombox="{Binding RecenterZoombox}"
                                         RecenterZoombox="{Binding RecenterZoombox}"
                                         Cursor="{Binding XamlAccesibleViewModel.ToolsSubViewModel.ToolCursor}"
                                         Cursor="{Binding XamlAccesibleViewModel.ToolsSubViewModel.ToolCursor}"
@@ -195,183 +200,193 @@
                                         MouseDownCommand="{Binding XamlAccesibleViewModel.IoSubViewModel.MouseDownCommand}"
                                         MouseDownCommand="{Binding XamlAccesibleViewModel.IoSubViewModel.MouseDownCommand}"
                                         MouseXOnCanvas="{Binding MouseXOnCanvas, Mode=TwoWay}"
                                         MouseXOnCanvas="{Binding MouseXOnCanvas, Mode=TwoWay}"
                                         MouseYOnCanvas="{Binding MouseYOnCanvas, Mode=TwoWay}">
                                         MouseYOnCanvas="{Binding MouseYOnCanvas, Mode=TwoWay}">
-                                <i:Interaction.Triggers>
-                                    <i:EventTrigger EventName="PreviewMouseDown">
-                                        <i:InvokeCommandAction Command="{Binding SetAsActiveOnClickCommand}"/>
-                                    </i:EventTrigger>
-                                </i:Interaction.Triggers>
-                            </usercontrols:DrawingViewPort>
-                        </DataTemplate>
-                    </avalondock:DockingManager.LayoutItemTemplate>
-                </avalondock:DockingManager>
-            </Grid>
-        </Grid>
-
-        <StackPanel Orientation="Vertical" Cursor="Arrow" Grid.Row="2" Grid.Column="0"
-                    Background="{StaticResource AccentColor}" Grid.RowSpan="2">
-
-            <ItemsControl ItemsSource="{Binding ToolsSubViewModel.ToolSet}">
-                <ItemsControl.ItemTemplate>
-                    <DataTemplate>
-                        <Button BorderBrush="White"
-                                BorderThickness="{Binding IsActive, Converter={StaticResource BoolToIntConverter}}"
-                                Style="{StaticResource ToolButtonStyle}"
-                                Command="{Binding Path=DataContext.ToolsSubViewModel.SelectToolCommand,
-                            RelativeSource={RelativeSource AncestorType={x:Type Window}}}"
-                                CommandParameter="{Binding}" ToolTip="{Binding Tooltip}">
-                            <Button.Background>
-                                <ImageBrush ImageSource="{Binding ImagePath}" Stretch="Uniform" />
-                            </Button.Background>
-                        </Button>
-                    </DataTemplate>
-                </ItemsControl.ItemTemplate>
-            </ItemsControl>
-        </StackPanel>
-
-        <Grid Grid.Column="2" Background="{StaticResource AccentColor}" Grid.Row="2" Grid.RowSpan="1">
-            <avalondock:DockingManager Foreground="White" Background="{StaticResource AccentColor}" BorderThickness="0">
-                <avalondock:LayoutRoot x:Name="LayoutRoot">
-                    <avalondock:LayoutPanel Orientation="Vertical">
-                        <LayoutAnchorablePane DockHeight="1.3*" DockWidth="*">
-                            <LayoutAnchorable ContentId="colorPicker" Title="Color Picker" CanHide="False"
+                                        <i:Interaction.Triggers>
+                                            <i:EventTrigger EventName="PreviewMouseDown">
+                                                <i:InvokeCommandAction Command="{Binding SetAsActiveOnClickCommand}"/>
+                                            </i:EventTrigger>
+                                        </i:Interaction.Triggers>
+                                    </usercontrols:DrawingViewPort>
+                                </DataTemplate>
+                            </ui:DocumentsTemplateSelector.DocumentsViewTemplate>
+                        </ui:DocumentsTemplateSelector>
+                    </DockingManager.LayoutItemTemplateSelector>
+                    <avalondock:LayoutRoot x:Name="LayoutRoot">
+                        <LayoutPanel Orientation="Horizontal">
+                            <LayoutDocumentPane/>
+                            <LayoutPanel Orientation="Vertical" DockWidth="290">
+                                <LayoutAnchorablePane>
+                                <LayoutAnchorable ContentId="colorPicker" Title="Color Picker" CanHide="False"
                                                              CanClose="False" CanAutoHide="False"
                                                              CanClose="False" CanAutoHide="False"
-                                                             CanDockAsTabbedDocument="True" CanFloat="True">
-                                <colorpicker:StandardColorPicker Grid.Row="0" SelectedColor="{Binding ColorsSubViewModel.PrimaryColor, Mode=TwoWay}"
+                                                             CanDockAsTabbedDocument="False" CanFloat="True">
+                                    <colorpicker:StandardColorPicker Grid.Row="0" SelectedColor="{Binding ColorsSubViewModel.PrimaryColor, Mode=TwoWay}"
                                      SecondaryColor="{Binding ColorsSubViewModel.SecondaryColor, Mode=TwoWay}" Style="{StaticResource DefaultColorPickerStyle}" >
                                      SecondaryColor="{Binding ColorsSubViewModel.SecondaryColor, Mode=TwoWay}" Style="{StaticResource DefaultColorPickerStyle}" >
-                                    <i:Interaction.Behaviors>
-                                        <behaviours:GlobalShortcutFocusBehavior/>
-                                    </i:Interaction.Behaviors>
-                                </colorpicker:StandardColorPicker>
-                            </LayoutAnchorable>
-                            <avalondock:LayoutAnchorable ContentId="swatches" Title="Swatches" CanHide="False"
+                                        <i:Interaction.Behaviors>
+                                            <behaviours:GlobalShortcutFocusBehavior/>
+                                        </i:Interaction.Behaviors>
+                                    </colorpicker:StandardColorPicker>
+                                </LayoutAnchorable>
+                                <avalondock:LayoutAnchorable ContentId="swatches" Title="Swatches" CanHide="False"
                                                          CanClose="False" CanAutoHide="False"
                                                          CanClose="False" CanAutoHide="False"
                                                          CanDockAsTabbedDocument="False" CanFloat="True">
                                                          CanDockAsTabbedDocument="False" CanFloat="True">
-                                <ScrollViewer HorizontalScrollBarVisibility="Disabled"
+                                    <ScrollViewer HorizontalScrollBarVisibility="Disabled"
                                               VerticalScrollBarVisibility="Auto">
                                               VerticalScrollBarVisibility="Auto">
-                                    <ItemsControl ItemsSource="{Binding BitmapManager.ActiveDocument.Swatches}">
-                                        <ItemsControl.ItemsPanel>
-                                            <ItemsPanelTemplate>
-                                                <WrapPanel Margin="10,10,0,10" Orientation="Horizontal"
+                                        <ItemsControl ItemsSource="{Binding BitmapManager.ActiveDocument.Swatches}">
+                                            <ItemsControl.ItemsPanel>
+                                                <ItemsPanelTemplate>
+                                                    <WrapPanel Margin="10,10,0,10" Orientation="Horizontal"
                                                            VerticalAlignment="Top" HorizontalAlignment="Left" />
                                                            VerticalAlignment="Top" HorizontalAlignment="Left" />
-                                            </ItemsPanelTemplate>
-                                        </ItemsControl.ItemsPanel>
-                                        <ItemsControl.ItemTemplate>
-                                            <DataTemplate>
-                                                <Grid Width="45" Height="45" Margin="0 5 5 5">
-                                                    <Border CornerRadius="5.5" Width="44" Height="44">
-                                                        <Border.Background>
-                                                            <ImageBrush ImageSource="../Images/transparentbg.png"
+                                                </ItemsPanelTemplate>
+                                            </ItemsControl.ItemsPanel>
+                                            <ItemsControl.ItemTemplate>
+                                                <DataTemplate>
+                                                    <Grid Width="45" Height="45" Margin="0 5 5 5">
+                                                        <Border CornerRadius="5.5" Width="44" Height="44">
+                                                            <Border.Background>
+                                                                <ImageBrush ImageSource="../Images/transparentbg.png"
                                                                         Stretch="UniformToFill">
                                                                         Stretch="UniformToFill">
-                                                                <ImageBrush.RelativeTransform>
-                                                                    <ScaleTransform ScaleX="6" ScaleY="6" CenterX="0.5"
+                                                                    <ImageBrush.RelativeTransform>
+                                                                        <ScaleTransform ScaleX="6" ScaleY="6" CenterX="0.5"
                                                                                     CenterY="0.5" />
                                                                                     CenterY="0.5" />
-                                                                </ImageBrush.RelativeTransform>
-                                                            </ImageBrush>
-                                                        </Border.Background>
-                                                    </Border>
-                                                    <Border CornerRadius="5.5" BorderThickness="0 0 0 0.1" BorderBrush="White" Cursor="Hand">
-                                                        <Border.Background>
-                                                            <SolidColorBrush Color="{Binding}" />
-                                                        </Border.Background>
-                                                    </Border>
-                                                    <i:Interaction.Triggers>
-                                                        <i:EventTrigger EventName="MouseDown">
-                                                            <i:InvokeCommandAction
+                                                                    </ImageBrush.RelativeTransform>
+                                                                </ImageBrush>
+                                                            </Border.Background>
+                                                        </Border>
+                                                        <Border CornerRadius="5.5" BorderThickness="0 0 0 0.1" BorderBrush="White" Cursor="Hand">
+                                                            <Border.Background>
+                                                                <SolidColorBrush Color="{Binding}" />
+                                                            </Border.Background>
+                                                        </Border>
+                                                        <i:Interaction.Triggers>
+                                                            <i:EventTrigger EventName="MouseDown">
+                                                                <i:InvokeCommandAction
                                                                 Command="{Binding
                                                                 Command="{Binding
                                                                     RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}, Path=DataContext.ColorsSubViewModel.SelectColorCommand}"
                                                                     RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}, Path=DataContext.ColorsSubViewModel.SelectColorCommand}"
                                                                 CommandParameter="{Binding}" />
                                                                 CommandParameter="{Binding}" />
-                                                        </i:EventTrigger>
-                                                    </i:Interaction.Triggers>
-                                                    <Grid.ContextMenu>
-                                                        <ContextMenu>
-                                                            <MenuItem Header="Remove" Foreground="White"
+                                                            </i:EventTrigger>
+                                                        </i:Interaction.Triggers>
+                                                        <Grid.ContextMenu>
+                                                            <ContextMenu>
+                                                                <MenuItem Header="Remove" Foreground="White"
                                                                       Command="{Binding ColorsSubViewModel.RemoveSwatchCommand, Source={StaticResource ViewModelMain}}"
                                                                       Command="{Binding ColorsSubViewModel.RemoveSwatchCommand, Source={StaticResource ViewModelMain}}"
                                                                       CommandParameter="{Binding}" />
                                                                       CommandParameter="{Binding}" />
-                                                        </ContextMenu>
-                                                    </Grid.ContextMenu>
-                                                </Grid>
-                                            </DataTemplate>
-                                        </ItemsControl.ItemTemplate>
-                                    </ItemsControl>
-                                </ScrollViewer>
-                            </avalondock:LayoutAnchorable>
-                        </LayoutAnchorablePane>
-                        <avalondock:LayoutAnchorablePane>
-                            <avalondock:LayoutAnchorable ContentId="layers" Title="Layers" CanHide="False"
+                                                            </ContextMenu>
+                                                        </Grid.ContextMenu>
+                                                    </Grid>
+                                                </DataTemplate>
+                                            </ItemsControl.ItemTemplate>
+                                        </ItemsControl>
+                                    </ScrollViewer>
+                                </avalondock:LayoutAnchorable>
+                            </LayoutAnchorablePane>
+                                <LayoutAnchorablePane>
+                                    <LayoutAnchorable ContentId="layers" Title="Layers" CanHide="False"
                                                          CanClose="False" CanAutoHide="False"
                                                          CanClose="False" CanAutoHide="False"
                                                          CanDockAsTabbedDocument="True" CanFloat="True">
                                                          CanDockAsTabbedDocument="True" CanFloat="True">
-                                <Grid>
-                                    <Grid.RowDefinitions>
-                                        <RowDefinition Height="40"/>
-                                        <RowDefinition Height="30"/>
-                                        <RowDefinition Height="15"/>
-                                        <RowDefinition Height="1*"/>
-                                    </Grid.RowDefinitions>
-                                    <Button Grid.Row="0" Command="{Binding LayersSubViewModel.NewLayerCommand}" Height="30" Content="New Layer"
+                                        <Grid>
+                                            <Grid.RowDefinitions>
+                                                <RowDefinition Height="40"/>
+                                                <RowDefinition Height="30"/>
+                                                <RowDefinition Height="15"/>
+                                                <RowDefinition Height="1*"/>
+                                            </Grid.RowDefinitions>
+                                            <Button Grid.Row="0" Command="{Binding LayersSubViewModel.NewLayerCommand}" Height="30" Content="New Layer"
                                             HorizontalAlignment="Stretch" Margin="5"
                                             HorizontalAlignment="Stretch" Margin="5"
                                             Style="{StaticResource DarkRoundButton}" />
                                             Style="{StaticResource DarkRoundButton}" />
-                                    <StackPanel Grid.Row="1" Orientation="Horizontal" Margin="10,0">
-                                        <Label Content="Opacity" Foreground="White" VerticalAlignment="Center"/>
-                                        <vws:NumberInput Min="0" Max="100" Width="40" Height="20" VerticalAlignment="Center"
+                                            <StackPanel Grid.Row="1" Orientation="Horizontal" Margin="10,0">
+                                                <Label Content="Opacity" Foreground="White" VerticalAlignment="Center"/>
+                                                <vws:NumberInput Min="0" Max="100" Width="40" Height="20" VerticalAlignment="Center"
                                                          Value="{Binding BitmapManager.ActiveDocument.ActiveLayer.Opacity, Mode=TwoWay, 
                                                          Value="{Binding BitmapManager.ActiveDocument.ActiveLayer.Opacity, Mode=TwoWay, 
                                             Converter={StaticResource FloatNormalizeConverter}}" />
                                             Converter={StaticResource FloatNormalizeConverter}}" />
-                                        <Label Content="%" Foreground="White" VerticalAlignment="Center"/>
-                                    </StackPanel>
-                                    <Separator Grid.Row="2" Background="{StaticResource BrighterAccentColor}"/>
-                                    <ScrollViewer Grid.Row="3" VerticalScrollBarVisibility="Auto">
-                                        <ItemsControl ItemsSource="{Binding BitmapManager.ActiveDocument.Layers}"
+                                                <Label Content="%" Foreground="White" VerticalAlignment="Center"/>
+                                            </StackPanel>
+                                            <Separator Grid.Row="2" Background="{StaticResource BrighterAccentColor}"/>
+                                            <ScrollViewer Grid.Row="3" VerticalScrollBarVisibility="Auto">
+                                                <ItemsControl ItemsSource="{Binding BitmapManager.ActiveDocument.Layers}"
                                                       x:Name="layersItemsControl" AlternationCount="9999">
                                                       x:Name="layersItemsControl" AlternationCount="9999">
-                                            <ItemsControl.ItemsPanel>
-                                                <ItemsPanelTemplate>
-                                                    <ui:ReversedOrderStackPanel Orientation="Vertical" />
-                                                </ItemsPanelTemplate>
-                                            </ItemsControl.ItemsPanel>
-                                            <ItemsControl.ItemTemplate>
-                                                <DataTemplate>
-                                                    <vws:LayerItem LayerIndex="{Binding RelativeSource={RelativeSource Mode=TemplatedParent},
+                                                    <ItemsControl.ItemsPanel>
+                                                        <ItemsPanelTemplate>
+                                                            <ui:ReversedOrderStackPanel Orientation="Vertical" />
+                                                        </ItemsPanelTemplate>
+                                                    </ItemsControl.ItemsPanel>
+                                                    <ItemsControl.ItemTemplate>
+                                                        <DataTemplate>
+                                                            <vws:LayerItem LayerIndex="{Binding RelativeSource={RelativeSource Mode=TemplatedParent},
                                 Path=(ItemsControl.AlternationIndex)}" SetActiveLayerCommand="{Binding Path=DataContext.LayersSubViewModel.SetActiveLayerCommand, ElementName=mainWindow}"
                                 Path=(ItemsControl.AlternationIndex)}" SetActiveLayerCommand="{Binding Path=DataContext.LayersSubViewModel.SetActiveLayerCommand, ElementName=mainWindow}"
                                                                    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.LayersSubViewModel.MoveToBackCommand, ElementName=mainWindow}"
                                                                    MoveToBackCommand="{Binding DataContext.LayersSubViewModel.MoveToBackCommand, ElementName=mainWindow}"
                                                                    MoveToFrontCommand="{Binding DataContext.LayersSubViewModel.MoveToFrontCommand, ElementName=mainWindow}">
                                                                    MoveToFrontCommand="{Binding DataContext.LayersSubViewModel.MoveToFrontCommand, ElementName=mainWindow}">
-                                                        <vws:LayerItem.ContextMenu>
-                                                            <ContextMenu>
-                                                                <MenuItem Header="Delete"
+                                                                <vws:LayerItem.ContextMenu>
+                                                                    <ContextMenu>
+                                                                        <MenuItem Header="Delete"
                                                                                   Command="{Binding LayersSubViewModel.DeleteLayerCommand, Source={StaticResource ViewModelMain}}"
                                                                                   Command="{Binding LayersSubViewModel.DeleteLayerCommand, Source={StaticResource ViewModelMain}}"
                                                                                   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 LayersSubViewModel.RenameLayerCommand, Source={StaticResource ViewModelMain}}"
                                                                                   Command="{Binding LayersSubViewModel.RenameLayerCommand, Source={StaticResource ViewModelMain}}"
                                                                                   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 LayersSubViewModel.MoveToFrontCommand, Source={StaticResource ViewModelMain}}"
                                                                                   Command="{Binding LayersSubViewModel.MoveToFrontCommand, Source={StaticResource ViewModelMain}}"
                                                                                   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 LayersSubViewModel.MoveToBackCommand, Source={StaticResource ViewModelMain}}"
                                                                                   Command="{Binding LayersSubViewModel.MoveToBackCommand, Source={StaticResource ViewModelMain}}"
                                                                                   CommandParameter="{Binding RelativeSource={RelativeSource Mode=TemplatedParent},
                                                                                   CommandParameter="{Binding RelativeSource={RelativeSource Mode=TemplatedParent},
                                 Path=(ItemsControl.AlternationIndex)}" />
                                 Path=(ItemsControl.AlternationIndex)}" />
-                                                            </ContextMenu>
-                                                        </vws:LayerItem.ContextMenu>
-                                                    </vws:LayerItem>
-                                                </DataTemplate>
-                                            </ItemsControl.ItemTemplate>
-                                        </ItemsControl>
-                                    </ScrollViewer>
-                                </Grid>
-                            </avalondock:LayoutAnchorable>
-                        </avalondock:LayoutAnchorablePane>
-                        
-                    </avalondock:LayoutPanel>
-                </avalondock:LayoutRoot>
+                                                                    </ContextMenu>
+                                                                </vws:LayerItem.ContextMenu>
+                                                            </vws:LayerItem>
+                                                        </DataTemplate>
+                                                    </ItemsControl.ItemTemplate>
+                                                </ItemsControl>
+                                            </ScrollViewer>
+                                        </Grid>
+                                    </LayoutAnchorable>
+                                </LayoutAnchorablePane>
+                            </LayoutPanel>
+                        </LayoutPanel>
+                    </avalondock:LayoutRoot>
+                </DockingManager>
+            </Grid>
+        </Grid>
+
+        <StackPanel Orientation="Vertical" Cursor="Arrow" Grid.Row="2" Grid.Column="0"
+                    Background="{StaticResource AccentColor}" Grid.RowSpan="2">
+
+            <ItemsControl ItemsSource="{Binding ToolsSubViewModel.ToolSet}">
+                <ItemsControl.ItemTemplate>
+                    <DataTemplate>
+                        <Button BorderBrush="White"
+                                BorderThickness="{Binding IsActive, Converter={StaticResource BoolToIntConverter}}"
+                                Style="{StaticResource ToolButtonStyle}"
+                                Command="{Binding Path=DataContext.ToolsSubViewModel.SelectToolCommand,
+                            RelativeSource={RelativeSource AncestorType={x:Type Window}}}"
+                                CommandParameter="{Binding}" ToolTip="{Binding Tooltip}">
+                            <Button.Background>
+                                <ImageBrush ImageSource="{Binding ImagePath}" Stretch="Uniform" />
+                            </Button.Background>
+                        </Button>
+                    </DataTemplate>
+                </ItemsControl.ItemTemplate>
+            </ItemsControl>
+        </StackPanel>
+
+        <!--<Grid Grid.Column="2" Background="{StaticResource AccentColor}" Grid.Row="2" Grid.RowSpan="1">
+            <avalondock:DockingManager Foreground="White" Background="{StaticResource AccentColor}" BorderThickness="0">
+
                 <avalondock:DockingManager.Theme>
                 <avalondock:DockingManager.Theme>
                     <avalonDockTheme:PixiEditorDockTheme />
                     <avalonDockTheme:PixiEditorDockTheme />
                 </avalondock:DockingManager.Theme>
                 </avalondock:DockingManager.Theme>
             </avalondock:DockingManager>
             </avalondock:DockingManager>
-        </Grid>
-        <DockPanel Grid.Row="3" Grid.Column="1">
+        </Grid>-->
+        <Grid Grid.Row="3" Grid.Column="1">
+            <Grid.ColumnDefinitions>
+                <ColumnDefinition Width="*"/>
+                <ColumnDefinition Width="290"/>
+            </Grid.ColumnDefinitions>
+            <DockPanel>
             <TextBlock Text="{Binding BitmapManager.SelectedTool.ActionDisplay}" Foreground="White" FontSize="15" Margin="10,0,0,0" VerticalAlignment="Center"/>
             <TextBlock Text="{Binding BitmapManager.SelectedTool.ActionDisplay}" Foreground="White" FontSize="15" Margin="10,0,0,0" VerticalAlignment="Center"/>
             <StackPanel DockPanel.Dock="Right" Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Center">
             <StackPanel DockPanel.Dock="Right" Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Center">
                 <TextBlock Text="X:" Foreground="White" FontSize="16"/>
                 <TextBlock Text="X:" Foreground="White" FontSize="16"/>
@@ -388,5 +403,6 @@
             <TextBlock VerticalAlignment="Center" Padding="10" HorizontalAlignment="Right"
             <TextBlock VerticalAlignment="Center" Padding="10" HorizontalAlignment="Right"
                        Foreground="White" FontSize="14"  Text="{Binding UpdateSubViewModel.VersionText}" />
                        Foreground="White" FontSize="14"  Text="{Binding UpdateSubViewModel.VersionText}" />
         </StackPanel>
         </StackPanel>
+        </Grid>
     </Grid>
     </Grid>
 </Window>
 </Window>