|
@@ -1,233 +1,226 @@
|
|
|
-<Window x:Class="PixiEditor.MainWindow" MinHeight="1000" MinWidth="1100"
|
|
|
- xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
|
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
|
- xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
|
- xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
|
- xmlns:vm="clr-namespace:PixiEditor.ViewModels"
|
|
|
- xmlns:vws="clr-namespace:PixiEditor.Views"
|
|
|
- xmlns:helpers="clr-namespace:PixiEditor.Helpers"
|
|
|
- xmlns:converters="clr-namespace:PixiEditor.Helpers.Converters"
|
|
|
- xmlns:behaviors="clr-namespace:PixiEditor.Helpers.Behaviours"
|
|
|
- xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
|
|
|
- xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
|
|
|
+<Window x:Class="PixiEditor.MainWindow" MinHeight="1000" MinWidth="1100"
|
|
|
+ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
|
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
|
+ xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
|
+ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
|
+ xmlns:vm="clr-namespace:PixiEditor.ViewModels"
|
|
|
+ xmlns:vws="clr-namespace:PixiEditor.Views"
|
|
|
+ xmlns:helpers="clr-namespace:PixiEditor.Helpers"
|
|
|
+ xmlns:converters="clr-namespace:PixiEditor.Helpers.Converters"
|
|
|
+ xmlns:behaviors="clr-namespace:PixiEditor.Helpers.Behaviours"
|
|
|
+ xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
|
|
|
+ xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
|
|
|
xmlns:xcad="http://schemas.xceed.com/wpf/xaml/avalondock"
|
|
|
xmlns:ui="clr-namespace:PixiEditor.Helpers.UI"
|
|
|
xmlns:cmd="http://www.galasoft.ch/mvvmlight"
|
|
|
- mc:Ignorable="d"
|
|
|
- Title="PixiEditor" Name="mainWindow" Height="1000" Width="1600" Background="#FF252424" WindowStartupLocation="CenterScreen" WindowState="Maximized" DataContext="{DynamicResource ViewModelMain}">
|
|
|
- <Window.Resources>
|
|
|
- <vm:ViewModelMain x:Key="ViewModelMain"/>
|
|
|
- <BooleanToVisibilityConverter x:Key="BoolToVisibilityConverter"/>
|
|
|
- <helpers:ToolSizeToIntConverter x:Key="ToolSizeToIntConverter"/>
|
|
|
- <converters:BoolToColorConverter x:Key="BoolToColorConverter"/>
|
|
|
- </Window.Resources>
|
|
|
-
|
|
|
- <i:Interaction.Triggers>
|
|
|
- <i:EventTrigger EventName="KeyDown">
|
|
|
- <cmd:EventToCommand Command="{Binding KeyDownCommand}" PassEventArgsToCommand="True"/>
|
|
|
- </i:EventTrigger>
|
|
|
- </i:Interaction.Triggers>
|
|
|
- <Grid>
|
|
|
- <Grid.ColumnDefinitions>
|
|
|
- <ColumnDefinition Width="60*"/>
|
|
|
- <ColumnDefinition Width="1420*"/>
|
|
|
- <ColumnDefinition Width="150*"/>
|
|
|
- </Grid.ColumnDefinitions>
|
|
|
- <Grid.RowDefinitions>
|
|
|
- <RowDefinition Height="30*"/>
|
|
|
- <RowDefinition Height="908*"/>
|
|
|
- <RowDefinition Height="30*"/>
|
|
|
- </Grid.RowDefinitions>
|
|
|
-
|
|
|
- <Border Grid.ColumnSpan="3" Background="#FF363434" Grid.Row="0" Height="30"/>
|
|
|
- <WrapPanel Grid.ColumnSpan="2" Grid.Column="0" Grid.Row="0" Grid.RowSpan="2" Panel.ZIndex="100">
|
|
|
- <vws:MenuButton Text="File" Margin="0,0,-140,0">
|
|
|
- <vws:MenuButton.Item>
|
|
|
- <StackPanel>
|
|
|
- <Button Style="{StaticResource MenuInsideButtonStyle}" Content="New" Command="{Binding GenerateDrawAreaCommand}"/>
|
|
|
- <Button Style="{StaticResource MenuInsideButtonStyle}" Content="Save" Command="{Binding SaveFileCommand}"/>
|
|
|
- <Button Style="{StaticResource MenuInsideButtonStyle}" Content="Open" Command="{Binding OpenFileCommand}"/>
|
|
|
- </StackPanel>
|
|
|
- </vws:MenuButton.Item>
|
|
|
- </vws:MenuButton>
|
|
|
- <vws:MenuButton Text="Edit" Margin="0,0,-140,0">
|
|
|
- <vws:MenuButton.Item>
|
|
|
- <StackPanel>
|
|
|
- <Button Style="{StaticResource MenuInsideButtonStyle}" Content="Undo" Command="{Binding UndoCommand}"/>
|
|
|
- <Button Style="{StaticResource MenuInsideButtonStyle}" Content="Redo" Command="{Binding RedoCommand}"/>
|
|
|
- </StackPanel>
|
|
|
- </vws:MenuButton.Item>
|
|
|
- </vws:MenuButton>
|
|
|
-
|
|
|
- <vws:MenuButton Text="View" Margin="0,0,-140,0">
|
|
|
- <vws:MenuButton.Item>
|
|
|
- <StackPanel>
|
|
|
- <Button Style="{StaticResource MenuInsideButtonStyle}" Content="Recenter" Command="{Binding RecenterZoomboxCommand}" CommandParameter="{Binding ElementName=Zoombox}"/>
|
|
|
- </StackPanel>
|
|
|
- </vws:MenuButton.Item>
|
|
|
- </vws:MenuButton>
|
|
|
- </WrapPanel>
|
|
|
- <Grid Grid.Column="1" Grid.Row="1" Background="#303030" Margin="0,5,5,0">
|
|
|
- <Grid>
|
|
|
- <vws:MainDrawingPanel CenterOnStart="True">
|
|
|
- <vws:MainDrawingPanel.Item>
|
|
|
- <Canvas Width="{Binding BitmapUtility.ActiveLayer.Width}" Height="{Binding BitmapUtility.ActiveLayer.Height}" VerticalAlignment="Center" HorizontalAlignment="Center">
|
|
|
- <i:Interaction.Triggers>
|
|
|
- <i:EventTrigger EventName="MouseMove">
|
|
|
- <i:InvokeCommandAction Command="{Binding MouseMoveCommand}"/>
|
|
|
- </i:EventTrigger>
|
|
|
- <i:EventTrigger EventName="MouseDown">
|
|
|
- <i:InvokeCommandAction Command="{Binding MouseDownCommand}"/>
|
|
|
- </i:EventTrigger>
|
|
|
- <i:EventTrigger EventName="MouseUp">
|
|
|
- <i:InvokeCommandAction Command="{Binding MouseUpCommand}"/>
|
|
|
- </i:EventTrigger>
|
|
|
- </i:Interaction.Triggers>
|
|
|
- <i:Interaction.Behaviors>
|
|
|
- <behaviors:MouseBehaviour MouseX="{Binding MouseXOnCanvas, Mode=OneWayToSource}" MouseY="{Binding MouseYOnCanvas, Mode=OneWayToSource}"/>
|
|
|
- </i:Interaction.Behaviors>
|
|
|
- <Image Source="/Images/transparentbg.png" Height="{Binding BitmapUtility.ActiveLayer.Height}" Width="{Binding BitmapUtility.ActiveLayer.Width}" Opacity="0.9" Stretch="UniformToFill"/>
|
|
|
- <Image Source="{Binding BitmapUtility.PreviewLayer.LayerBitmap}" Panel.ZIndex="2" RenderOptions.BitmapScalingMode="NearestNeighbor" Stretch="Uniform" Width="{Binding BitmapUtility.PreviewLayer.Width}" Height="{Binding BitmapUtility.PreviewLayer.Height}"/>
|
|
|
- <ItemsControl ItemsSource="{Binding BitmapUtility.Layers}">
|
|
|
- <ItemsControl.ItemsPanel>
|
|
|
- <ItemsPanelTemplate>
|
|
|
- <Grid/>
|
|
|
- </ItemsPanelTemplate>
|
|
|
- </ItemsControl.ItemsPanel>
|
|
|
- <ItemsControl.ItemTemplate>
|
|
|
- <DataTemplate>
|
|
|
- <Image Source="{Binding LayerBitmap}" Visibility="{Binding IsVisible, Converter={StaticResource BoolToVisibilityConverter}}" RenderOptions.BitmapScalingMode="NearestNeighbor" Stretch="Uniform" Width="{Binding Width}" Height="{Binding Height}"/>
|
|
|
- </DataTemplate>
|
|
|
- </ItemsControl.ItemTemplate>
|
|
|
- </ItemsControl>
|
|
|
- </Canvas>
|
|
|
- </vws:MainDrawingPanel.Item>
|
|
|
- </vws:MainDrawingPanel>
|
|
|
- </Grid>
|
|
|
- </Grid>
|
|
|
-
|
|
|
- <StackPanel Cursor="Arrow" Grid.Row="1" Grid.Column="0" Margin="0,5,5,0" Background="#404040">
|
|
|
- <TextBox Style="{StaticResource DarkTextBoxStyle}" Margin="0,10,0,0" Text="{Binding ToolSize, Mode=TwoWay,Converter={StaticResource ToolSizeToIntConverter}}" TextAlignment="Center" MaxLength="4">
|
|
|
- <i:Interaction.Behaviors>
|
|
|
- <behaviors:TextBoxNumericFinisherBehavior/>
|
|
|
- </i:Interaction.Behaviors>
|
|
|
- </TextBox>
|
|
|
- <Button Style="{StaticResource ToolButtonStyle}" Command="{Binding SelectToolCommand, Mode=OneWay}" CommandParameter="Pen" ToolTip="Standard brush (B)">
|
|
|
- <Button.Background>
|
|
|
- <ImageBrush ImageSource="/Images/PenImage.png" Stretch="Uniform"/>
|
|
|
- </Button.Background>
|
|
|
- </Button>
|
|
|
- <Button Style="{StaticResource ToolButtonStyle}" Command="{Binding SelectToolCommand, Mode=OneWay}" CommandParameter="Bucket" ToolTip="Fills area with color (G)">
|
|
|
- <Button.Background>
|
|
|
- <ImageBrush ImageSource="/Images/BucketImage.png" Stretch="Uniform"/>
|
|
|
- </Button.Background>
|
|
|
- </Button>
|
|
|
- <Button Style="{StaticResource ToolButtonStyle}" Command="{Binding SelectToolCommand, Mode=OneWay}" CommandParameter="Line" ToolTip="Draws line on canvas (L)">
|
|
|
- <Button.Background>
|
|
|
- <ImageBrush ImageSource="/Images/LineImage.png" Stretch="Uniform"/>
|
|
|
- </Button.Background>
|
|
|
- </Button>
|
|
|
- <Button Style="{StaticResource ToolButtonStyle}" Command="{Binding SelectToolCommand, Mode=OneWay}" CommandParameter="Circle" ToolTip="Draws circle on cavnas (C)">
|
|
|
- <Button.Background>
|
|
|
- <ImageBrush ImageSource="/Images/CircleImage.png" Stretch="Uniform"/>
|
|
|
- </Button.Background>
|
|
|
- </Button>
|
|
|
- <Button Style="{StaticResource ToolButtonStyle}" Command="{Binding SelectToolCommand, Mode=OneWay}" CommandParameter="Rectangle" ToolTip="Draws rectanlge on cavnas (R)">
|
|
|
- <Button.Background>
|
|
|
- <ImageBrush ImageSource="/Images/RectangleImage.png" Stretch="Uniform"/>
|
|
|
- </Button.Background>
|
|
|
- </Button>
|
|
|
- <Button Style="{StaticResource ToolButtonStyle}" Command="{Binding SelectToolCommand, Mode=OneWay}" CommandParameter="ColorPicker" ToolTip="Color picker, sets color from pixel as active (O)">
|
|
|
- <Button.Background>
|
|
|
- <ImageBrush ImageSource="/Images/PipetteImage.png" Stretch="Uniform"/>
|
|
|
- </Button.Background>
|
|
|
- </Button>
|
|
|
- <Button Style="{StaticResource ToolButtonStyle}" Command="{Binding SelectToolCommand, Mode=OneWay}" CommandParameter="Earser" ToolTip="Earser, Earsers color from pixel (E)">
|
|
|
- <Button.Background>
|
|
|
- <ImageBrush ImageSource="/Images/EarserImage.png" Stretch="Uniform"/>
|
|
|
- </Button.Background>
|
|
|
- </Button>
|
|
|
- <Button Style="{StaticResource ToolButtonStyle}" Opacity="1" Command="{Binding SelectToolCommand, Mode=OneWay}" CommandParameter="Brightness" ToolTip="Makes pixel brighter or darker pixel (U)">
|
|
|
- <Button.Background>
|
|
|
- <ImageBrush ImageSource="/Images/LightenImage.png" Stretch="Uniform"/>
|
|
|
- </Button.Background>
|
|
|
- </Button>
|
|
|
- </StackPanel>
|
|
|
-
|
|
|
- <DockPanel Grid.Column="2" Grid.Row="1" Background="#404040">
|
|
|
- <Grid DockPanel.Dock="Top" HorizontalAlignment="Center" Width="100" Margin="0,20,0,0" Height="100">
|
|
|
- <Rectangle Height="70" Width="70" HorizontalAlignment="Left" VerticalAlignment="Top" Stroke="Black" StrokeThickness="1" Panel.ZIndex="1">
|
|
|
- <Rectangle.Fill>
|
|
|
- <SolidColorBrush Color="{Binding PrimaryColor, Mode=OneWay}"/>
|
|
|
- </Rectangle.Fill>
|
|
|
- </Rectangle>
|
|
|
- <xctk:ColorPicker Width="70" Panel.ZIndex="2" Height="70" VerticalAlignment="Top" HorizontalAlignment="Left" UsingAlphaChannel="True" AvailableColorsSortingMode="Alphabetical" ShowDropDownButton="False" Background="Transparent" BorderThickness="0" ShowRecentColors="True" SelectedColor="{Binding PrimaryColor, Mode=TwoWay}"></xctk:ColorPicker>
|
|
|
+ mc:Ignorable="d"
|
|
|
+ Title="PixiEditor" Name="mainWindow" Height="1000" Width="1600" Background="#FF252424" WindowStartupLocation="CenterScreen" WindowState="Maximized" DataContext="{DynamicResource ViewModelMain}">
|
|
|
+ <Window.Resources>
|
|
|
+ <vm:ViewModelMain x:Key="ViewModelMain"/>
|
|
|
+ <BooleanToVisibilityConverter x:Key="BoolToVisibilityConverter"/>
|
|
|
+ <helpers:ToolSizeToIntConverter x:Key="ToolSizeToIntConverter"/>
|
|
|
+ <converters:BoolToColorConverter x:Key="BoolToColorConverter"/>
|
|
|
+ <converters:BoolToIntConverter x:Key="BoolToIntConverter"/>
|
|
|
+ </Window.Resources>
|
|
|
+
|
|
|
+ <i:Interaction.Triggers>
|
|
|
+ <i:EventTrigger EventName="KeyDown">
|
|
|
+ <cmd:EventToCommand Command="{Binding KeyDownCommand}" PassEventArgsToCommand="True"/>
|
|
|
+ </i:EventTrigger>
|
|
|
+ </i:Interaction.Triggers>
|
|
|
+ <Grid>
|
|
|
+ <Grid.ColumnDefinitions>
|
|
|
+ <ColumnDefinition Width="37*"/>
|
|
|
+ <ColumnDefinition Width="1416*"/>
|
|
|
+ <ColumnDefinition Width="147*"/>
|
|
|
+ </Grid.ColumnDefinitions>
|
|
|
+ <Grid.RowDefinitions>
|
|
|
+ <RowDefinition Height="30*"/>
|
|
|
+ <RowDefinition Height="29*"/>
|
|
|
+ <RowDefinition Height="895*"/>
|
|
|
+ <RowDefinition Height="30*"/>
|
|
|
+ </Grid.RowDefinitions>
|
|
|
+
|
|
|
+ <Border Grid.ColumnSpan="3" Background="#FF363434" Grid.Row="0"/>
|
|
|
+ <WrapPanel Grid.ColumnSpan="2" Grid.Column="0" Grid.Row="0" Grid.RowSpan="3" Panel.ZIndex="100">
|
|
|
+ <vws:MenuButton Text="File" Margin="0,0,-140,0">
|
|
|
+ <vws:MenuButton.Item>
|
|
|
+ <StackPanel>
|
|
|
+ <Button Style="{StaticResource MenuInsideButtonStyle}" Content="New" Command="{Binding GenerateDrawAreaCommand}"/>
|
|
|
+ <Button Style="{StaticResource MenuInsideButtonStyle}" Content="Export" Command="{Binding SaveFileCommand}"/>
|
|
|
+ <Button Style="{StaticResource MenuInsideButtonStyle}" Content="Export As..." Command="{Binding SaveFileCommand}" CommandParameter="AsNew"/>
|
|
|
+ <Button Style="{StaticResource MenuInsideButtonStyle}" Content="Open" Command="{Binding OpenFileCommand}"/>
|
|
|
+ </StackPanel>
|
|
|
+ </vws:MenuButton.Item>
|
|
|
+ </vws:MenuButton>
|
|
|
+ <vws:MenuButton Text="Edit" Margin="0,0,-140,0">
|
|
|
+ <vws:MenuButton.Item>
|
|
|
+ <StackPanel>
|
|
|
+ <Button Style="{StaticResource MenuInsideButtonStyle}" Content="Undo" Command="{Binding UndoCommand}"/>
|
|
|
+ <Button Style="{StaticResource MenuInsideButtonStyle}" Content="Redo" Command="{Binding RedoCommand}"/>
|
|
|
+ </StackPanel>
|
|
|
+ </vws:MenuButton.Item>
|
|
|
+ </vws:MenuButton>
|
|
|
+
|
|
|
+ <vws:MenuButton Text="View" Margin="0,0,-140,0">
|
|
|
+ <vws:MenuButton.Item>
|
|
|
+ <StackPanel>
|
|
|
+ <Button Style="{StaticResource MenuInsideButtonStyle}" Content="Recenter" Command="{Binding RecenterZoomboxCommand}" CommandParameter="{Binding ElementName=Zoombox}"/>
|
|
|
+ </StackPanel>
|
|
|
+ </vws:MenuButton.Item>
|
|
|
+ </vws:MenuButton>
|
|
|
+ </WrapPanel>
|
|
|
+ <StackPanel Background="#404040" Orientation="Horizontal" Grid.ColumnSpan="2" Margin="0,30,0,0" Grid.RowSpan="2">
|
|
|
+ <ItemsControl ItemsSource="{Binding BitmapUtility.SelectedTool.Toolbar.Settings}">
|
|
|
+ <ItemsControl.ItemsPanel>
|
|
|
+ <ItemsPanelTemplate>
|
|
|
+ <StackPanel Orientation="Horizontal" Margin="10, 0, 0, 0"/>
|
|
|
+ </ItemsPanelTemplate>
|
|
|
+ </ItemsControl.ItemsPanel>
|
|
|
+ <ItemsControl.ItemTemplate>
|
|
|
+ <DataTemplate>
|
|
|
+ <StackPanel Orientation="Horizontal" VerticalAlignment="Center" Margin="10,0,10,0">
|
|
|
+ <Label Visibility="{Binding HasLabel, Converter={StaticResource BoolToVisibilityConverter}}" Foreground="White" Content="{Binding Label}"/>
|
|
|
+ <ContentPresenter Content="{Binding SettingControl}"/>
|
|
|
+ </StackPanel>
|
|
|
+ </DataTemplate>
|
|
|
+ </ItemsControl.ItemTemplate>
|
|
|
+ </ItemsControl>
|
|
|
+ </StackPanel>
|
|
|
+ <Grid Grid.Column="1" Grid.Row="2" Background="#303030" Margin="0,7,5,0">
|
|
|
+ <Grid>
|
|
|
+ <vws:MainDrawingPanel x:Name="DrawingPanel" CenterOnStart="True" Cursor="{Binding ToolCursor}">
|
|
|
+ <i:Interaction.Triggers>
|
|
|
+ <i:EventTrigger EventName="MouseMove">
|
|
|
+ <i:InvokeCommandAction Command="{Binding MouseMoveCommand}"/>
|
|
|
+ </i:EventTrigger>
|
|
|
+ <i:EventTrigger EventName="MouseUp">
|
|
|
+ <i:InvokeCommandAction Command="{Binding MouseUpCommand}"/>
|
|
|
+ </i:EventTrigger>
|
|
|
+ </i:Interaction.Triggers>
|
|
|
+ <i:Interaction.Behaviors>
|
|
|
+ <behaviors:MouseBehaviour RelativeTo="{Binding ElementName=DrawingPanel, Path=Item}" MouseX="{Binding MouseXOnCanvas, Mode=OneWayToSource}" MouseY="{Binding MouseYOnCanvas, Mode=OneWayToSource}"/>
|
|
|
+ </i:Interaction.Behaviors>
|
|
|
+ <vws:MainDrawingPanel.Item>
|
|
|
+ <Canvas Width="{Binding BitmapUtility.ActiveLayer.Width}" Height="{Binding BitmapUtility.ActiveLayer.Height}" VerticalAlignment="Center" HorizontalAlignment="Center">
|
|
|
+ <i:Interaction.Triggers>
|
|
|
+ <i:EventTrigger EventName="MouseDown">
|
|
|
+ <i:InvokeCommandAction Command="{Binding MouseDownCommand}"/>
|
|
|
+ </i:EventTrigger>
|
|
|
+ </i:Interaction.Triggers>
|
|
|
+ <Image Source="/Images/transparentbg.png" Height="{Binding BitmapUtility.ActiveLayer.Height}" Width="{Binding BitmapUtility.ActiveLayer.Width}" Opacity="0.9" Stretch="UniformToFill"/>
|
|
|
+ <Image Source="{Binding BitmapUtility.PreviewLayer.LayerBitmap}" Panel.ZIndex="2" RenderOptions.BitmapScalingMode="NearestNeighbor" Stretch="Uniform" Width="{Binding BitmapUtility.PreviewLayer.Width}" Height="{Binding BitmapUtility.PreviewLayer.Height}"/>
|
|
|
+ <ItemsControl ItemsSource="{Binding BitmapUtility.Layers}">
|
|
|
+ <ItemsControl.ItemsPanel>
|
|
|
+ <ItemsPanelTemplate>
|
|
|
+ <Grid/>
|
|
|
+ </ItemsPanelTemplate>
|
|
|
+ </ItemsControl.ItemsPanel>
|
|
|
+ <ItemsControl.ItemTemplate>
|
|
|
+ <DataTemplate>
|
|
|
+ <Image Source="{Binding LayerBitmap}" Visibility="{Binding IsVisible, Converter={StaticResource BoolToVisibilityConverter}}" RenderOptions.BitmapScalingMode="NearestNeighbor" Stretch="Uniform" Width="{Binding Width}" Height="{Binding Height}"/>
|
|
|
+ </DataTemplate>
|
|
|
+ </ItemsControl.ItemTemplate>
|
|
|
+ </ItemsControl>
|
|
|
+ </Canvas>
|
|
|
+ </vws:MainDrawingPanel.Item>
|
|
|
+ </vws:MainDrawingPanel>
|
|
|
+ </Grid>
|
|
|
+ </Grid>
|
|
|
+
|
|
|
+ <StackPanel Orientation="Vertical" Cursor="Arrow" Grid.Row="2" Grid.Column="0" Margin="0,7,5,0" Background="#404040" Grid.RowSpan="2">
|
|
|
+
|
|
|
+ <ItemsControl ItemsSource="{Binding ToolSet}">
|
|
|
+ <ItemsControl.ItemTemplate>
|
|
|
+ <DataTemplate>
|
|
|
+ <Button BorderBrush="White" BorderThickness="{Binding IsActive, Converter={StaticResource BoolToIntConverter}}"
|
|
|
+ Style="{StaticResource ToolButtonStyle}"
|
|
|
+ Command="{Binding Path=DataContext.SelectToolCommand,
|
|
|
+ RelativeSource={RelativeSource AncestorType={x:Type Window}}}"
|
|
|
+ CommandParameter="{Binding ToolType}" ToolTip="{Binding Tooltip}">
|
|
|
+ <Button.Background>
|
|
|
+ <ImageBrush ImageSource="{Binding ImagePath}" Stretch="Uniform"/>
|
|
|
+ </Button.Background>
|
|
|
+ </Button>
|
|
|
+ </DataTemplate>
|
|
|
+ </ItemsControl.ItemTemplate>
|
|
|
+ </ItemsControl>
|
|
|
+ </StackPanel>
|
|
|
+
|
|
|
+ <DockPanel Grid.Column="2" Background="#404040" Margin="0,30,0,0" Grid.RowSpan="3">
|
|
|
+ <Grid DockPanel.Dock="Top" HorizontalAlignment="Center" Width="100" Margin="0,20,0,0" Height="100">
|
|
|
+ <Rectangle Height="70" Width="70" HorizontalAlignment="Left" VerticalAlignment="Top" Stroke="Black" StrokeThickness="1" Panel.ZIndex="1">
|
|
|
+ <Rectangle.Fill>
|
|
|
+ <SolidColorBrush Color="{Binding PrimaryColor, Mode=OneWay}"/>
|
|
|
+ </Rectangle.Fill>
|
|
|
+ </Rectangle>
|
|
|
+ <xctk:ColorPicker Width="70" Panel.ZIndex="2" Height="70" VerticalAlignment="Top" HorizontalAlignment="Left" UsingAlphaChannel="True" AvailableColorsSortingMode="Alphabetical" ShowDropDownButton="False" Background="Transparent" BorderThickness="0" ShowRecentColors="True" SelectedColor="{Binding PrimaryColor, Mode=TwoWay}"></xctk:ColorPicker>
|
|
|
<Button Opacity="0.3" ToolTip="Swap colors (X)" Command="{Binding SwapColorsCommand}" Width="25" Height="25" HorizontalAlignment="Left" VerticalAlignment="Bottom" Margin="0 0 0 3" Style="{StaticResource ImageButtonStyle}">
|
|
|
<Button.Background>
|
|
|
<ImageBrush ImageSource="/Images/SwapArrows.png" Stretch="Fill"/>
|
|
|
</Button.Background>
|
|
|
- </Button>
|
|
|
- <Rectangle Height="70" Width="70" HorizontalAlignment="Right" VerticalAlignment="Bottom" Stroke="Black" StrokeThickness="1" Margin="0,0,4,5">
|
|
|
- <Rectangle.Fill>
|
|
|
- <SolidColorBrush Color="{Binding SecondaryColor, Mode=OneWay}"/>
|
|
|
- </Rectangle.Fill>
|
|
|
- </Rectangle>
|
|
|
- <xctk:ColorPicker Width="70" Height="70" HorizontalAlignment="Right" VerticalAlignment="Bottom" UsingAlphaChannel="True" AvailableColorsSortingMode="Alphabetical" ShowDropDownButton="False" Background="Transparent" BorderThickness="0" ShowRecentColors="True" Margin="0,0,4,5" SelectedColor="{Binding SecondaryColor, Mode=TwoWay}"/>
|
|
|
- </Grid>
|
|
|
-
|
|
|
- <xcad:DockingManager Grid.Column="2" Grid.Row="1" DockPanel.Dock="Top">
|
|
|
- <xcad:DockingManager.Style>
|
|
|
- <Style TargetType="xcad:DockingManager">
|
|
|
- <Setter Property="Foreground" Value="Snow"/>
|
|
|
- </Style>
|
|
|
- </xcad:DockingManager.Style>
|
|
|
- <xcad:LayoutRoot x:Name="LayoutRoot">
|
|
|
- <xcad:LayoutPanel Orientation="Vertical">
|
|
|
- <xcad:LayoutAnchorablePane>
|
|
|
- <xcad:LayoutAnchorable ContentId="layers" Title="Layers" CanHide="False" CanClose="False" CanAutoHide="False" CanDockAsTabbedDocument="False" CanFloat="True">
|
|
|
- <StackPanel Orientation="Vertical">
|
|
|
- <Button Command="{Binding NewLayerCommand}" Height="30" Content="New Layer" HorizontalAlignment="Stretch" Margin="5" Style="{StaticResource DarkRoundButton}"/>
|
|
|
- <ItemsControl ItemsSource="{Binding BitmapUtility.Layers}" x:Name="layersItemsControl" AlternationCount="9999">
|
|
|
- <ItemsControl.ItemsPanel>
|
|
|
- <ItemsPanelTemplate>
|
|
|
- <ui:ReversedOrderStackPanel Orientation="Vertical"/>
|
|
|
- </ItemsPanelTemplate>
|
|
|
- </ItemsControl.ItemsPanel>
|
|
|
- <ItemsControl.ItemTemplate>
|
|
|
- <DataTemplate>
|
|
|
- <Border BorderThickness="1" BorderBrush="Gray" MinWidth="60" Background="{Binding IsActive, Mode=TwoWay, Converter={StaticResource BoolToColorConverter}}">
|
|
|
- <DockPanel>
|
|
|
- <CheckBox VerticalAlignment="Center" Command="{Binding Path=DataContext.ReloadImageCommand, RelativeSource={RelativeSource AncestorType={x:Type Window}}}" IsThreeState="False" IsChecked="{Binding Path=IsVisible}"/>
|
|
|
- <Button Background="Transparent" Style="{StaticResource BaseDarkButton}" FontSize="16" DockPanel.Dock="Left" Command="{Binding RelativeSource={RelativeSource AncestorType={x:Type Window}},
|
|
|
- Path=DataContext.SetActiveLayerCommand}" CommandParameter="{Binding RelativeSource={RelativeSource Mode=TemplatedParent},
|
|
|
- Path=(ItemsControl.AlternationIndex)}">
|
|
|
- <Button.ContextMenu>
|
|
|
- <ContextMenu>
|
|
|
- <MenuItem Header="Delete" Command="{Binding DeleteLayerCommand, Source={StaticResource ViewModelMain}}" CommandParameter="{Binding RelativeSource={RelativeSource Mode=TemplatedParent},
|
|
|
- Path=(ItemsControl.AlternationIndex)}"/>
|
|
|
- <MenuItem Header="Rename" Command="{Binding RenameLayerCommand, Source={StaticResource ViewModelMain}}" CommandParameter="{Binding RelativeSource={RelativeSource Mode=TemplatedParent},
|
|
|
- Path=(ItemsControl.AlternationIndex)}"/>
|
|
|
- <MenuItem Header="Move to front" Command="{Binding MoveToFrontCommand, Source={StaticResource ViewModelMain}}" CommandParameter="{Binding RelativeSource={RelativeSource Mode=TemplatedParent},
|
|
|
- Path=(ItemsControl.AlternationIndex)}"/>
|
|
|
- <MenuItem Header="Move to back" Command="{Binding MoveToBackCommand, Source={StaticResource ViewModelMain}}" CommandParameter="{Binding RelativeSource={RelativeSource Mode=TemplatedParent},
|
|
|
- Path=(ItemsControl.AlternationIndex)}"/>
|
|
|
- </ContextMenu>
|
|
|
- </Button.ContextMenu>
|
|
|
- <vws:EditableTextBlock IsEditing="{Binding IsRenaming, Mode=TwoWay}" Text="{Binding Name, Mode=TwoWay}">
|
|
|
- </vws:EditableTextBlock>
|
|
|
- </Button>
|
|
|
- </DockPanel>
|
|
|
- </Border>
|
|
|
- </DataTemplate>
|
|
|
- </ItemsControl.ItemTemplate>
|
|
|
- </ItemsControl>
|
|
|
- </StackPanel>
|
|
|
- </xcad:LayoutAnchorable>
|
|
|
- </xcad:LayoutAnchorablePane>
|
|
|
- </xcad:LayoutPanel>
|
|
|
- </xcad:LayoutRoot>
|
|
|
- </xcad:DockingManager>
|
|
|
- </DockPanel>
|
|
|
-
|
|
|
- </Grid>
|
|
|
-</Window>
|
|
|
+ </Button>
|
|
|
+ <Rectangle Height="70" Width="70" HorizontalAlignment="Right" VerticalAlignment="Bottom" Stroke="Black" StrokeThickness="1" Margin="0,0,4,5">
|
|
|
+ <Rectangle.Fill>
|
|
|
+ <SolidColorBrush Color="{Binding SecondaryColor, Mode=OneWay}"/>
|
|
|
+ </Rectangle.Fill>
|
|
|
+ </Rectangle>
|
|
|
+ <xctk:ColorPicker Width="70" Height="70" HorizontalAlignment="Right" VerticalAlignment="Bottom" UsingAlphaChannel="True" AvailableColorsSortingMode="Alphabetical" ShowDropDownButton="False" Background="Transparent" BorderThickness="0" ShowRecentColors="True" Margin="0,0,4,5" SelectedColor="{Binding SecondaryColor, Mode=TwoWay}"/>
|
|
|
+ </Grid>
|
|
|
+
|
|
|
+ <xcad:DockingManager Grid.Column="2" Grid.Row="1" DockPanel.Dock="Top">
|
|
|
+ <xcad:DockingManager.Style>
|
|
|
+ <Style TargetType="xcad:DockingManager">
|
|
|
+ <Setter Property="Foreground" Value="Snow"/>
|
|
|
+ </Style>
|
|
|
+ </xcad:DockingManager.Style>
|
|
|
+ <xcad:LayoutRoot x:Name="LayoutRoot">
|
|
|
+ <xcad:LayoutPanel Orientation="Vertical">
|
|
|
+ <xcad:LayoutAnchorablePane>
|
|
|
+ <xcad:LayoutAnchorable ContentId="layers" Title="Layers" CanHide="False" CanClose="False" CanAutoHide="False" CanDockAsTabbedDocument="False" CanFloat="True">
|
|
|
+ <StackPanel Orientation="Vertical">
|
|
|
+ <Button Command="{Binding NewLayerCommand}" Height="30" Content="New Layer" HorizontalAlignment="Stretch" Margin="5" Style="{StaticResource DarkRoundButton}"/>
|
|
|
+ <ItemsControl ItemsSource="{Binding BitmapUtility.Layers}" x:Name="layersItemsControl" AlternationCount="9999">
|
|
|
+ <ItemsControl.ItemsPanel>
|
|
|
+ <ItemsPanelTemplate>
|
|
|
+ <ui:ReversedOrderStackPanel Orientation="Vertical"/>
|
|
|
+ </ItemsPanelTemplate>
|
|
|
+ </ItemsControl.ItemsPanel>
|
|
|
+ <ItemsControl.ItemTemplate>
|
|
|
+ <DataTemplate>
|
|
|
+ <Border BorderThickness="1" BorderBrush="Gray" MinWidth="60" Background="{Binding IsActive, Mode=TwoWay, Converter={StaticResource BoolToColorConverter}}">
|
|
|
+ <DockPanel>
|
|
|
+ <CheckBox VerticalAlignment="Center" Command="{Binding Path=DataContext.ReloadImageCommand, RelativeSource={RelativeSource AncestorType={x:Type Window}}}" IsThreeState="False" IsChecked="{Binding Path=IsVisible}"/>
|
|
|
+ <Button Background="Transparent" Style="{StaticResource BaseDarkButton}" FontSize="16" DockPanel.Dock="Left" Command="{Binding RelativeSource={RelativeSource AncestorType={x:Type Window}},
|
|
|
+ Path=DataContext.SetActiveLayerCommand}" CommandParameter="{Binding RelativeSource={RelativeSource Mode=TemplatedParent},
|
|
|
+ Path=(ItemsControl.AlternationIndex)}">
|
|
|
+ <Button.ContextMenu>
|
|
|
+ <ContextMenu>
|
|
|
+ <MenuItem Header="Delete" Command="{Binding DeleteLayerCommand, Source={StaticResource ViewModelMain}}" CommandParameter="{Binding RelativeSource={RelativeSource Mode=TemplatedParent},
|
|
|
+ Path=(ItemsControl.AlternationIndex)}"/>
|
|
|
+ <MenuItem Header="Rename" Command="{Binding RenameLayerCommand, Source={StaticResource ViewModelMain}}" CommandParameter="{Binding RelativeSource={RelativeSource Mode=TemplatedParent},
|
|
|
+ Path=(ItemsControl.AlternationIndex)}"/>
|
|
|
+ <MenuItem Header="Move to front" Command="{Binding MoveToFrontCommand, Source={StaticResource ViewModelMain}}" CommandParameter="{Binding RelativeSource={RelativeSource Mode=TemplatedParent},
|
|
|
+ Path=(ItemsControl.AlternationIndex)}"/>
|
|
|
+ <MenuItem Header="Move to back" Command="{Binding MoveToBackCommand, Source={StaticResource ViewModelMain}}" CommandParameter="{Binding RelativeSource={RelativeSource Mode=TemplatedParent},
|
|
|
+ Path=(ItemsControl.AlternationIndex)}"/>
|
|
|
+ </ContextMenu>
|
|
|
+ </Button.ContextMenu>
|
|
|
+ <vws:EditableTextBlock IsEditing="{Binding IsRenaming, Mode=TwoWay}" Text="{Binding Name, Mode=TwoWay}">
|
|
|
+ </vws:EditableTextBlock>
|
|
|
+ </Button>
|
|
|
+ </DockPanel>
|
|
|
+ </Border>
|
|
|
+ </DataTemplate>
|
|
|
+ </ItemsControl.ItemTemplate>
|
|
|
+ </ItemsControl>
|
|
|
+ </StackPanel>
|
|
|
+ </xcad:LayoutAnchorable>
|
|
|
+ </xcad:LayoutAnchorablePane>
|
|
|
+ </xcad:LayoutPanel>
|
|
|
+ </xcad:LayoutRoot>
|
|
|
+ </xcad:DockingManager>
|
|
|
+ </DockPanel>
|
|
|
+
|
|
|
+ </Grid>
|
|
|
+</Window>
|