|
@@ -1,436 +1,439 @@
|
|
|
-<Window x:Class="PixiEditor.MainWindow" MinHeight="500" 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:converters="clr-namespace:PixiEditor.Helpers.Converters"
|
|
|
- xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
|
|
|
- xmlns:ui="clr-namespace:PixiEditor.Helpers.UI"
|
|
|
- xmlns:cmd="http://www.galasoft.ch/mvvmlight"
|
|
|
- xmlns:avalondock="https://github.com/Dirkster99/AvalonDock"
|
|
|
- xmlns:colorpicker="clr-namespace:ColorPicker;assembly=ColorPicker" xmlns:usercontrols="clr-namespace:PixiEditor.Views.UserControls" xmlns:behaviours="clr-namespace:PixiEditor.Helpers.Behaviours"
|
|
|
- xmlns:avalonDockTheme="clr-namespace:PixiEditor.Styles.AvalonDock"
|
|
|
- mc:Ignorable="d" WindowStyle="None" Initialized="MainWindow_Initialized"
|
|
|
- Title="PixiEditor" Name="mainWindow" Height="1000" Width="1600" Background="{StaticResource MainColor}"
|
|
|
- WindowStartupLocation="CenterScreen" WindowState="Maximized">
|
|
|
- <WindowChrome.WindowChrome>
|
|
|
- <WindowChrome CaptionHeight="32"
|
|
|
- ResizeBorderThickness="{x:Static SystemParameters.WindowResizeBorderThickness}" />
|
|
|
- </WindowChrome.WindowChrome>
|
|
|
-
|
|
|
- <Window.Resources>
|
|
|
- <ResourceDictionary>
|
|
|
- <!--<vm:ViewModelMain x:Key="ViewModelMain" />-->
|
|
|
- <BooleanToVisibilityConverter x:Key="BoolToVisibilityConverter" />
|
|
|
- <converters:BoolToIntConverter x:Key="BoolToIntConverter" />
|
|
|
- <converters:NotNullToBoolConverter x:Key="NotNullToBoolConverter" />
|
|
|
- <converters:FloatNormalizeConverter x:Key="FloatNormalizeConverter" />
|
|
|
- <converters:DoubleToIntConverter x:Key="DoubleToIntConverter"/>
|
|
|
- <ResourceDictionary.MergedDictionaries>
|
|
|
- <ResourceDictionary Source="pack://application:,,,/ColorPicker;component/Styles/DefaultColorPickerStyle.xaml" />
|
|
|
- </ResourceDictionary.MergedDictionaries>
|
|
|
- </ResourceDictionary>
|
|
|
- </Window.Resources>
|
|
|
-
|
|
|
- <Window.CommandBindings>
|
|
|
- <CommandBinding Command="{x:Static SystemCommands.CloseWindowCommand}" CanExecute="CommandBinding_CanExecute"
|
|
|
- Executed="CommandBinding_Executed_Close" />
|
|
|
- <CommandBinding Command="{x:Static SystemCommands.MaximizeWindowCommand}"
|
|
|
- CanExecute="CommandBinding_CanExecute" Executed="CommandBinding_Executed_Maximize" />
|
|
|
- <CommandBinding Command="{x:Static SystemCommands.MinimizeWindowCommand}"
|
|
|
- CanExecute="CommandBinding_CanExecute" Executed="CommandBinding_Executed_Minimize" />
|
|
|
- <CommandBinding Command="{x:Static SystemCommands.RestoreWindowCommand}" CanExecute="CommandBinding_CanExecute"
|
|
|
- Executed="CommandBinding_Executed_Restore" />
|
|
|
- </Window.CommandBindings>
|
|
|
-
|
|
|
- <i:Interaction.Triggers>
|
|
|
- <i:EventTrigger EventName="KeyDown">
|
|
|
- <cmd:EventToCommand Command="{Binding IoSubViewModel.KeyDownCommand}" PassEventArgsToCommand="True" />
|
|
|
- </i:EventTrigger>
|
|
|
- <i:EventTrigger EventName="KeyUp">
|
|
|
- <cmd:EventToCommand Command="{Binding IoSubViewModel.KeyUpCommand}" PassEventArgsToCommand="True"/>
|
|
|
- </i:EventTrigger>
|
|
|
- <i:EventTrigger EventName="ContentRendered">
|
|
|
- <i:InvokeCommandAction Command="{Binding OnStartupCommand}" />
|
|
|
- </i:EventTrigger>
|
|
|
- <i:EventTrigger EventName="Closing">
|
|
|
- <cmd:EventToCommand Command="{Binding CloseWindowCommand}" PassEventArgsToCommand="True" />
|
|
|
- </i:EventTrigger>
|
|
|
- </i:Interaction.Triggers>
|
|
|
- <Grid Name="mainGrid" Margin="5" Focusable="True">
|
|
|
- <Grid.ColumnDefinitions>
|
|
|
- <ColumnDefinition Width="45" />
|
|
|
- <ColumnDefinition Width="1*" />
|
|
|
- </Grid.ColumnDefinitions>
|
|
|
- <Grid.RowDefinitions>
|
|
|
- <RowDefinition Height="30" />
|
|
|
- <RowDefinition Height="40" />
|
|
|
- <RowDefinition Height="1*" />
|
|
|
- <RowDefinition Height="30" />
|
|
|
- </Grid.RowDefinitions>
|
|
|
- <i:Interaction.Behaviors>
|
|
|
- <behaviours:ClearFocusOnClickBehavior/>
|
|
|
- </i:Interaction.Behaviors>
|
|
|
- <DockPanel Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="3" Background="{StaticResource MainColor}">
|
|
|
- <Image DockPanel.Dock="Left" HorizontalAlignment="Left" VerticalAlignment="Top"
|
|
|
- Source="/Images/PixiEditorLogo.png" Width="20" Height="20" Margin="5,5,0,0" />
|
|
|
- <Menu WindowChrome.IsHitTestVisibleInChrome="True" Margin="10, 4, 0, 0" DockPanel.Dock="Left"
|
|
|
- HorizontalAlignment="Left" VerticalAlignment="Top" Background="Transparent" IsMainMenu="True">
|
|
|
- <Menu.Resources>
|
|
|
- <Style TargetType="{x:Type MenuItem}" BasedOn="{StaticResource menuItemStyle}" />
|
|
|
- </Menu.Resources>
|
|
|
- <MenuItem Header="_File">
|
|
|
- <MenuItem InputGestureText="CTRL+N" Header="_New" Command="{Binding FileSubViewModel.OpenNewFilePopupCommand}" />
|
|
|
- <MenuItem Header="_Open" InputGestureText="Ctrl+O" Command="{Binding FileSubViewModel.OpenFileCommand}" />
|
|
|
- <MenuItem Header="_Recent" ItemsSource="{Binding FileSubViewModel.RecentlyOpened}" x:Name="recentItemMenu" IsEnabled="{Binding FileSubViewModel.HasRecent}">
|
|
|
- <MenuItem.ItemContainerStyle>
|
|
|
- <Style TargetType="MenuItem" BasedOn="{StaticResource menuItemStyle}">
|
|
|
- <Setter Property="Command" Value="{Binding ElementName=recentItemMenu, Path=DataContext.FileSubViewModel.OpenRecentCommand}"/>
|
|
|
- <Setter Property="CommandParameter" Value="{Binding}"/>
|
|
|
- </Style>
|
|
|
- </MenuItem.ItemContainerStyle>
|
|
|
- </MenuItem>
|
|
|
- <MenuItem Header="_Save" InputGestureText="Ctrl+S" Command="{Binding FileSubViewModel.SaveDocumentCommand}" />
|
|
|
- <MenuItem Header="_Save As..." InputGestureText="Ctrl+Shift+S"
|
|
|
- Command="{Binding FileSubViewModel.SaveDocumentCommand}" CommandParameter="AsNew" />
|
|
|
- <MenuItem Header="_Export" InputGestureText="Ctrl+Shift+Alt+S" Command="{Binding FileSubViewModel.ExportFileCommand}" />
|
|
|
- <Separator />
|
|
|
- <MenuItem Header="_Exit" Command="{x:Static SystemCommands.CloseWindowCommand}" />
|
|
|
- </MenuItem>
|
|
|
- <MenuItem Header="_Edit">
|
|
|
- <MenuItem Header="_Undo" InputGestureText="Ctrl+Z" Command="{Binding UndoSubViewModel.UndoCommand}" />
|
|
|
- <MenuItem Header="_Redo" InputGestureText="Ctrl+Y" Command="{Binding UndoSubViewModel.RedoCommand}" />
|
|
|
- <Separator />
|
|
|
- <MenuItem Header="_Cut" Command="{Binding ClipboardSubViewModel.CutCommand}" InputGestureText="Ctrl+X" />
|
|
|
- <MenuItem Header="_Copy" Command="{Binding ClipboardSubViewModel.CopyCommand}" InputGestureText="Ctrl+C" />
|
|
|
- <MenuItem Header="_Paste" Command="{Binding ClipboardSubViewModel.PasteCommand}" InputGestureText="Ctrl+V" />
|
|
|
- <MenuItem Header="_Duplicate" Command="{Binding ClipboardSubViewModel.DuplicateCommand}" InputGestureText="Ctrl+J" />
|
|
|
- <Separator />
|
|
|
- <MenuItem Header="_Delete Selected" Command="{Binding DocumentSubViewModel.DeletePixelsCommand}"
|
|
|
- InputGestureText="Delete" />
|
|
|
- <Separator />
|
|
|
- <MenuItem Header="_Settings" Command="{Binding MiscSubViewModel.OpenSettingsWindowCommand}" />
|
|
|
- </MenuItem>
|
|
|
- <MenuItem Header="_Select">
|
|
|
- <MenuItem Header="_Select All" Command="{Binding SelectionSubViewModel.SelectAllCommand}" InputGestureText="Ctrl+A" />
|
|
|
- <MenuItem Header="_Deselect" Command="{Binding SelectionSubViewModel.DeselectCommand}" InputGestureText="Ctrl+D" />
|
|
|
- </MenuItem>
|
|
|
- <MenuItem Header="_Document">
|
|
|
- <MenuItem Header="Resize Document..." Command="{Binding DocumentSubViewModel.OpenResizePopupCommand}"
|
|
|
- InputGestureText="Ctrl+Shift+I" />
|
|
|
- <MenuItem Header="Resize Canvas..." Command="{Binding DocumentSubViewModel.OpenResizePopupCommand}"
|
|
|
- CommandParameter="canvas" InputGestureText="Ctrl+Shift+C" />
|
|
|
- <MenuItem Header="Clip Canvas" Command="{Binding DocumentSubViewModel.ClipCanvasCommand}" />
|
|
|
- <Separator/>
|
|
|
- <MenuItem Header="Center Content" Command="{Binding DocumentSubViewModel.CenterContentCommand}" />
|
|
|
- </MenuItem>
|
|
|
- <MenuItem Header="_View">
|
|
|
- <MenuItem Header="Show Grid Lines" IsChecked="{Binding ViewportSubViewModel.GridLinesEnabled, Mode=TwoWay}"
|
|
|
- IsCheckable="True" InputGestureText="Ctrl+`"/>
|
|
|
- </MenuItem>
|
|
|
- <MenuItem Header="_Help">
|
|
|
- <MenuItem Header="Documentation" Command="{Binding MiscSubViewModel.OpenHyperlinkCommand}"
|
|
|
- CommandParameter="https://github.com/PixiEditor/PixiEditor/wiki"/>
|
|
|
- <MenuItem Header="Repository" Command="{Binding MiscSubViewModel.OpenHyperlinkCommand}"
|
|
|
- CommandParameter="https://github.com/PixiEditor/PixiEditor"/>
|
|
|
- <MenuItem Header="Shortcuts" Command="{Binding MiscSubViewModel.OpenHyperlinkCommand}"
|
|
|
- CommandParameter="https://github.com/PixiEditor/PixiEditor/wiki/Shortcuts"/>
|
|
|
- <Separator/>
|
|
|
- <MenuItem Header="License" Command="{Binding MiscSubViewModel.OpenHyperlinkCommand}"
|
|
|
- CommandParameter="https://github.com/PixiEditor/PixiEditor/blob/master/LICENSE"/>
|
|
|
- <MenuItem Header="Third Party Licenses" Command="{Binding MiscSubViewModel.OpenHyperlinkCommand}"
|
|
|
- CommandParameter="https://github.com/PixiEditor/PixiEditor/wiki/Third-party-licenses"/>
|
|
|
- </MenuItem>
|
|
|
- <MenuItem Header="_Debug" Visibility="{Binding IsDebug, Converter={StaticResource BoolToVisibilityConverter}}">
|
|
|
- <MenuItem Header="Such empty here..." IsEnabled="False"/>
|
|
|
- </MenuItem>
|
|
|
- </Menu>
|
|
|
- <StackPanel DockPanel.Dock="Right" VerticalAlignment="Top" Orientation="Horizontal"
|
|
|
- HorizontalAlignment="Right" WindowChrome.IsHitTestVisibleInChrome="True">
|
|
|
- <Button Style="{StaticResource MinimizeButtonStyle}" WindowChrome.IsHitTestVisibleInChrome="True"
|
|
|
- ToolTip="Minimize"
|
|
|
- Command="{x:Static SystemCommands.MinimizeWindowCommand}" />
|
|
|
- <Button x:Name="RestoreButton" Visibility="Visible" Style="{StaticResource RestoreButtonStyle}"
|
|
|
- Command="{x:Static SystemCommands.RestoreWindowCommand}"
|
|
|
- WindowChrome.IsHitTestVisibleInChrome="True" ToolTip="Restore" />
|
|
|
- <Button x:Name="MaximizeButton" Visibility="Collapsed" Style="{StaticResource MaximizeButtonStyle}"
|
|
|
- Command="{x:Static SystemCommands.MaximizeWindowCommand}"
|
|
|
- WindowChrome.IsHitTestVisibleInChrome="True" ToolTip="Maximize" />
|
|
|
- <Button Style="{StaticResource CloseButtonStyle}" WindowChrome.IsHitTestVisibleInChrome="True"
|
|
|
- ToolTip="Close"
|
|
|
- Command="{x:Static SystemCommands.CloseWindowCommand}" />
|
|
|
- </StackPanel>
|
|
|
- </DockPanel>
|
|
|
- <StackPanel Background="{StaticResource MainColor}" Orientation="Horizontal" Grid.ColumnSpan="3" Grid.Column="0"
|
|
|
- Grid.Row="1">
|
|
|
- <Label Style="{StaticResource BaseLabel}" Margin="10,0,0,0" FontSize="12" VerticalAlignment="Center" Content="{Binding BitmapManager.SelectedTool.ToolName}"/>
|
|
|
- <Label Style="{StaticResource BaseLabel}" Padding="0" FontSize="12" VerticalAlignment="Center" Content="tool"/>
|
|
|
- <ItemsControl ItemsSource="{Binding BitmapManager.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}" />
|
|
|
- <ContentControl Content="{Binding SettingControl}" />
|
|
|
- </StackPanel>
|
|
|
- </DataTemplate>
|
|
|
- </ItemsControl.ItemTemplate>
|
|
|
- </ItemsControl>
|
|
|
- </StackPanel>
|
|
|
- <Grid Grid.Column="1" Grid.Row="2" Background="#303030">
|
|
|
- <Grid>
|
|
|
- <DockingManager ActiveContent="{Binding BitmapManager.ActiveDocument, Mode=TwoWay}"
|
|
|
- DocumentsSource="{Binding BitmapManager.Documents}">
|
|
|
- <DockingManager.Theme>
|
|
|
- <avalonDockTheme:PixiEditorDockTheme />
|
|
|
- </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}"
|
|
|
- RecenterZoombox="{Binding RecenterZoombox}"
|
|
|
- GridLinesVisible="{Binding XamlAccesibleViewModel.ViewportSubViewModel.GridLinesEnabled}"
|
|
|
- Cursor="{Binding XamlAccesibleViewModel.ToolsSubViewModel.ToolCursor}"
|
|
|
- MiddleMouseClickedCommand="{Binding XamlAccesibleViewModel.ToolsSubViewModel.SelectToolCommand}"
|
|
|
- ViewportPosition="{Binding ViewportPosition}"
|
|
|
- MouseMoveCommand="{Binding XamlAccesibleViewModel.IoSubViewModel.MouseMoveCommand}"
|
|
|
- MouseDownCommand="{Binding XamlAccesibleViewModel.IoSubViewModel.MouseDownCommand}"
|
|
|
- MouseXOnCanvas="{Binding MouseXOnCanvas, 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>
|
|
|
- </ui:DocumentsTemplateSelector.DocumentsViewTemplate>
|
|
|
- </ui:DocumentsTemplateSelector>
|
|
|
- </DockingManager.LayoutItemTemplateSelector>
|
|
|
- <avalondock:LayoutRoot x:Name="LayoutRoot">
|
|
|
- <LayoutPanel Orientation="Horizontal">
|
|
|
- <LayoutDocumentPane/>
|
|
|
- <LayoutAnchorablePaneGroup Orientation="Vertical" DockWidth="290">
|
|
|
- <LayoutAnchorablePane>
|
|
|
- <LayoutAnchorable ContentId="colorPicker" Title="Color Picker" CanHide="False"
|
|
|
- CanClose="False" CanAutoHide="False"
|
|
|
- CanDockAsTabbedDocument="False" CanFloat="True">
|
|
|
- <colorpicker:StandardColorPicker Grid.Row="0" SelectedColor="{Binding ColorsSubViewModel.PrimaryColor, Mode=TwoWay}"
|
|
|
- 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"
|
|
|
- CanClose="False" CanAutoHide="False"
|
|
|
- CanDockAsTabbedDocument="False" CanFloat="True">
|
|
|
- <ScrollViewer HorizontalScrollBarVisibility="Disabled"
|
|
|
- VerticalScrollBarVisibility="Auto">
|
|
|
- <ItemsControl ItemsSource="{Binding BitmapManager.ActiveDocument.Swatches}">
|
|
|
- <ItemsControl.ItemsPanel>
|
|
|
- <ItemsPanelTemplate>
|
|
|
- <WrapPanel Margin="10,10,0,10" Orientation="Horizontal"
|
|
|
- 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"
|
|
|
- Stretch="UniformToFill">
|
|
|
- <ImageBrush.RelativeTransform>
|
|
|
- <ScaleTransform ScaleX="6" ScaleY="6" CenterX="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
|
|
|
- Command="{Binding
|
|
|
- RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}, Path=DataContext.ColorsSubViewModel.SelectColorCommand}"
|
|
|
- CommandParameter="{Binding}" />
|
|
|
- </i:EventTrigger>
|
|
|
- </i:Interaction.Triggers>
|
|
|
- <Grid.ContextMenu>
|
|
|
- <ContextMenu>
|
|
|
- <MenuItem Header="Remove" Foreground="White"
|
|
|
- Command="{Binding ColorsSubViewModel.RemoveSwatchCommand}"
|
|
|
- CommandParameter="{Binding}" />
|
|
|
- </ContextMenu>
|
|
|
- </Grid.ContextMenu>
|
|
|
- </Grid>
|
|
|
- </DataTemplate>
|
|
|
- </ItemsControl.ItemTemplate>
|
|
|
- </ItemsControl>
|
|
|
- </ScrollViewer>
|
|
|
- </avalondock:LayoutAnchorable>
|
|
|
- </LayoutAnchorablePane>
|
|
|
- <LayoutAnchorablePane>
|
|
|
- <LayoutAnchorable ContentId="layers" Title="Layers" CanHide="False"
|
|
|
- CanClose="False" CanAutoHide="False"
|
|
|
- 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"
|
|
|
- HorizontalAlignment="Stretch" Margin="5"
|
|
|
- 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"
|
|
|
- IsEnabled="{Binding Path=BitmapManager.ActiveDocument,
|
|
|
- Converter={StaticResource NotNullToBoolConverter}}"
|
|
|
- Width="40" Height="20"
|
|
|
- VerticalAlignment="Center"
|
|
|
- Value="{Binding BitmapManager.ActiveDocument.ActiveLayer.OpacityUndoTriggerable, Mode=TwoWay,
|
|
|
- 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}"
|
|
|
- x:Name="layersItemsControl" AlternationCount="9999">
|
|
|
- <ItemsControl.ItemsPanel>
|
|
|
- <ItemsPanelTemplate>
|
|
|
- <ui:ReversedOrderStackPanel Orientation="Vertical" />
|
|
|
- </ItemsPanelTemplate>
|
|
|
- </ItemsControl.ItemsPanel>
|
|
|
- <ItemsControl.ItemTemplate>
|
|
|
- <DataTemplate>
|
|
|
- <vws:LayerItem Tag="{Binding DataContext, ElementName=mainWindow}" LayerIndex="{Binding RelativeSource={RelativeSource Mode=TemplatedParent},
|
|
|
- Path=(ItemsControl.AlternationIndex)}" SetActiveLayerCommand="{Binding Path=DataContext.LayersSubViewModel.SetActiveLayerCommand, ElementName=mainWindow}"
|
|
|
- LayerName="{Binding Name, Mode=TwoWay}" IsActive="{Binding IsActive, Mode=TwoWay}"
|
|
|
- IsRenaming="{Binding IsRenaming, Mode=TwoWay}"
|
|
|
- PreviewImage="{Binding LayerBitmap}"
|
|
|
- MoveToBackCommand="{Binding DataContext.LayersSubViewModel.MoveToBackCommand, ElementName=mainWindow}"
|
|
|
- MoveToFrontCommand="{Binding DataContext.LayersSubViewModel.MoveToFrontCommand, ElementName=mainWindow}">
|
|
|
- <vws:LayerItem.ContextMenu>
|
|
|
- <ContextMenu>
|
|
|
- <MenuItem Header="Delete"
|
|
|
- Command="{Binding PlacementTarget.Tag.LayersSubViewModel.DeleteLayerCommand,
|
|
|
- RelativeSource={RelativeSource AncestorType=ContextMenu}}"
|
|
|
- CommandParameter="{Binding RelativeSource={RelativeSource Mode=TemplatedParent},
|
|
|
- Path=(ItemsControl.AlternationIndex)}" />
|
|
|
- <MenuItem Header="Rename"
|
|
|
- Command="{Binding PlacementTarget.Tag.LayersSubViewModel.RenameLayerCommand,
|
|
|
- RelativeSource={RelativeSource AncestorType=ContextMenu}}"
|
|
|
- CommandParameter="{Binding RelativeSource={RelativeSource Mode=TemplatedParent},
|
|
|
- Path=(ItemsControl.AlternationIndex)}" />
|
|
|
- <MenuItem Header="Move to front"
|
|
|
- Command="{Binding PlacementTarget.Tag.LayersSubViewModel.MoveToFrontCommand,
|
|
|
- RelativeSource={RelativeSource AncestorType=ContextMenu}}"
|
|
|
- CommandParameter="{Binding RelativeSource={RelativeSource Mode=TemplatedParent},
|
|
|
- Path=(ItemsControl.AlternationIndex)}" />
|
|
|
- <MenuItem Header="Move to back"
|
|
|
- Command="{Binding PlacementTarget.Tag.LayersSubViewModel.MoveToBackCommand,
|
|
|
- RelativeSource={RelativeSource AncestorType=ContextMenu}}"
|
|
|
- CommandParameter="{Binding RelativeSource={RelativeSource Mode=TemplatedParent},
|
|
|
- Path=(ItemsControl.AlternationIndex)}" />
|
|
|
- <MenuItem Header="Merge with above"
|
|
|
- Command="{Binding PlacementTarget.Tag.LayersSubViewModel.MergeWithAboveCommand,
|
|
|
- RelativeSource={RelativeSource AncestorType=ContextMenu}}"
|
|
|
- CommandParameter="{Binding RelativeSource={RelativeSource Mode=TemplatedParent},
|
|
|
- Path=(ItemsControl.AlternationIndex)}" />
|
|
|
- <MenuItem Header="Merge with below"
|
|
|
- Command="{Binding PlacementTarget.Tag.LayersSubViewModel.MergeWithBelowCommand,
|
|
|
- RelativeSource={RelativeSource AncestorType=ContextMenu}}"
|
|
|
- CommandParameter="{Binding RelativeSource={RelativeSource Mode=TemplatedParent},
|
|
|
- Path=(ItemsControl.AlternationIndex)}" />
|
|
|
- </ContextMenu>
|
|
|
- </vws:LayerItem.ContextMenu>
|
|
|
- </vws:LayerItem>
|
|
|
- </DataTemplate>
|
|
|
- </ItemsControl.ItemTemplate>
|
|
|
- </ItemsControl>
|
|
|
- </ScrollViewer>
|
|
|
- </Grid>
|
|
|
- </LayoutAnchorable>
|
|
|
- </LayoutAnchorablePane>
|
|
|
- </LayoutAnchorablePaneGroup>
|
|
|
- </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.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"/>
|
|
|
- <StackPanel DockPanel.Dock="Right" Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Center">
|
|
|
- <TextBlock Text="X:" Foreground="White" FontSize="16"/>
|
|
|
- <TextBlock Margin="4,0,10,0" Text="{Binding BitmapManager.ActiveDocument.MouseXOnCanvas, Converter={StaticResource DoubleToIntConverter}}" Foreground="White" FontSize="16"/>
|
|
|
- <TextBlock Text="Y:" Foreground="White" FontSize="16"/>
|
|
|
- <TextBlock Margin="4,0,10,0" Text="{Binding BitmapManager.ActiveDocument.MouseYOnCanvas, Converter={StaticResource DoubleToIntConverter}}" Foreground="White" FontSize="16"/>
|
|
|
- </StackPanel>
|
|
|
- </DockPanel>
|
|
|
- <StackPanel Margin="10,0,0,0" VerticalAlignment="Center" Grid.Row="3"
|
|
|
- Grid.Column="3" Orientation="Horizontal">
|
|
|
- <Button Style="{StaticResource BaseDarkButton}"
|
|
|
- Visibility="{Binding UpdateSubViewModel.UpdateReadyToInstall, Converter={StaticResource BoolToVisibilityConverter}}" FontSize="14" Height="20"
|
|
|
- Command="{Binding UpdateSubViewModel.RestartApplicationCommand}">Restart</Button>
|
|
|
- <TextBlock VerticalAlignment="Center" Padding="10" HorizontalAlignment="Right"
|
|
|
- Foreground="White" FontSize="14" Text="{Binding UpdateSubViewModel.VersionText}" />
|
|
|
- </StackPanel>
|
|
|
- </Grid>
|
|
|
- </Grid>
|
|
|
+<Window x:Class="PixiEditor.MainWindow" MinHeight="500" 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:converters="clr-namespace:PixiEditor.Helpers.Converters"
|
|
|
+ xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
|
|
|
+ xmlns:ui="clr-namespace:PixiEditor.Helpers.UI"
|
|
|
+ xmlns:cmd="http://www.galasoft.ch/mvvmlight"
|
|
|
+ xmlns:avalondock="https://github.com/Dirkster99/AvalonDock"
|
|
|
+ xmlns:colorpicker="clr-namespace:ColorPicker;assembly=ColorPicker" xmlns:usercontrols="clr-namespace:PixiEditor.Views.UserControls" xmlns:behaviours="clr-namespace:PixiEditor.Helpers.Behaviours"
|
|
|
+ xmlns:avalonDockTheme="clr-namespace:PixiEditor.Styles.AvalonDock" d:DataContext="{d:DesignInstance Type=vm:ViewModelMain}"
|
|
|
+ mc:Ignorable="d" WindowStyle="None" Initialized="MainWindow_Initialized"
|
|
|
+ Title="PixiEditor" Name="mainWindow" Height="1000" Width="1600" Background="{StaticResource MainColor}"
|
|
|
+ WindowStartupLocation="CenterScreen" WindowState="Maximized">
|
|
|
+ <WindowChrome.WindowChrome>
|
|
|
+ <WindowChrome CaptionHeight="32"
|
|
|
+ ResizeBorderThickness="{x:Static SystemParameters.WindowResizeBorderThickness}" />
|
|
|
+ </WindowChrome.WindowChrome>
|
|
|
+
|
|
|
+ <Window.Resources>
|
|
|
+ <ResourceDictionary>
|
|
|
+ <!--<vm:ViewModelMain x:Key="ViewModelMain" />-->
|
|
|
+ <BooleanToVisibilityConverter x:Key="BoolToVisibilityConverter" />
|
|
|
+ <converters:BoolToIntConverter x:Key="BoolToIntConverter" />
|
|
|
+ <converters:NotNullToBoolConverter x:Key="NotNullToBoolConverter" />
|
|
|
+ <converters:FloatNormalizeConverter x:Key="FloatNormalizeConverter" />
|
|
|
+ <converters:DoubleToIntConverter x:Key="DoubleToIntConverter"/>
|
|
|
+ <ResourceDictionary.MergedDictionaries>
|
|
|
+ <ResourceDictionary Source="pack://application:,,,/ColorPicker;component/Styles/DefaultColorPickerStyle.xaml" />
|
|
|
+ </ResourceDictionary.MergedDictionaries>
|
|
|
+ </ResourceDictionary>
|
|
|
+ </Window.Resources>
|
|
|
+
|
|
|
+ <Window.CommandBindings>
|
|
|
+ <CommandBinding Command="{x:Static SystemCommands.CloseWindowCommand}" CanExecute="CommandBinding_CanExecute"
|
|
|
+ Executed="CommandBinding_Executed_Close" />
|
|
|
+ <CommandBinding Command="{x:Static SystemCommands.MaximizeWindowCommand}"
|
|
|
+ CanExecute="CommandBinding_CanExecute" Executed="CommandBinding_Executed_Maximize" />
|
|
|
+ <CommandBinding Command="{x:Static SystemCommands.MinimizeWindowCommand}"
|
|
|
+ CanExecute="CommandBinding_CanExecute" Executed="CommandBinding_Executed_Minimize" />
|
|
|
+ <CommandBinding Command="{x:Static SystemCommands.RestoreWindowCommand}" CanExecute="CommandBinding_CanExecute"
|
|
|
+ Executed="CommandBinding_Executed_Restore" />
|
|
|
+ </Window.CommandBindings>
|
|
|
+
|
|
|
+ <i:Interaction.Triggers>
|
|
|
+ <i:EventTrigger EventName="KeyDown">
|
|
|
+ <cmd:EventToCommand Command="{Binding IoSubViewModel.KeyDownCommand}" PassEventArgsToCommand="True" />
|
|
|
+ </i:EventTrigger>
|
|
|
+ <i:EventTrigger EventName="KeyUp">
|
|
|
+ <cmd:EventToCommand Command="{Binding IoSubViewModel.KeyUpCommand}" PassEventArgsToCommand="True"/>
|
|
|
+ </i:EventTrigger>
|
|
|
+ <i:EventTrigger EventName="ContentRendered">
|
|
|
+ <i:InvokeCommandAction Command="{Binding OnStartupCommand}" />
|
|
|
+ </i:EventTrigger>
|
|
|
+ <i:EventTrigger EventName="Closing">
|
|
|
+ <cmd:EventToCommand Command="{Binding CloseWindowCommand}" PassEventArgsToCommand="True" />
|
|
|
+ </i:EventTrigger>
|
|
|
+ </i:Interaction.Triggers>
|
|
|
+ <Grid Name="mainGrid" Margin="5" Focusable="True">
|
|
|
+ <Grid.ColumnDefinitions>
|
|
|
+ <ColumnDefinition Width="45" />
|
|
|
+ <ColumnDefinition Width="1*" />
|
|
|
+ </Grid.ColumnDefinitions>
|
|
|
+ <Grid.RowDefinitions>
|
|
|
+ <RowDefinition Height="30" />
|
|
|
+ <RowDefinition Height="40" />
|
|
|
+ <RowDefinition Height="1*" />
|
|
|
+ <RowDefinition Height="30" />
|
|
|
+ </Grid.RowDefinitions>
|
|
|
+ <i:Interaction.Behaviors>
|
|
|
+ <behaviours:ClearFocusOnClickBehavior/>
|
|
|
+ </i:Interaction.Behaviors>
|
|
|
+ <DockPanel Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="3" Background="{StaticResource MainColor}">
|
|
|
+ <Image DockPanel.Dock="Left" HorizontalAlignment="Left" VerticalAlignment="Top"
|
|
|
+ Source="/Images/PixiEditorLogo.png" Width="20" Height="20" Margin="5,5,0,0" />
|
|
|
+ <Menu WindowChrome.IsHitTestVisibleInChrome="True" Margin="10, 4, 0, 0" DockPanel.Dock="Left"
|
|
|
+ HorizontalAlignment="Left" VerticalAlignment="Top" Background="Transparent" IsMainMenu="True">
|
|
|
+ <Menu.Resources>
|
|
|
+ <Style TargetType="{x:Type MenuItem}" BasedOn="{StaticResource menuItemStyle}" />
|
|
|
+ </Menu.Resources>
|
|
|
+ <MenuItem Header="_File">
|
|
|
+ <MenuItem InputGestureText="CTRL+N" Header="_New" Command="{Binding FileSubViewModel.OpenNewFilePopupCommand}" />
|
|
|
+ <MenuItem Header="_Open" InputGestureText="Ctrl+O" Command="{Binding FileSubViewModel.OpenFileCommand}" />
|
|
|
+ <MenuItem Header="_Recent" ItemsSource="{Binding FileSubViewModel.RecentlyOpened}" x:Name="recentItemMenu" IsEnabled="{Binding FileSubViewModel.HasRecent}">
|
|
|
+ <MenuItem.ItemContainerStyle>
|
|
|
+ <Style TargetType="MenuItem" BasedOn="{StaticResource menuItemStyle}">
|
|
|
+ <Setter Property="Command" Value="{Binding ElementName=recentItemMenu, Path=DataContext.FileSubViewModel.OpenRecentCommand}"/>
|
|
|
+ <Setter Property="CommandParameter" Value="{Binding}"/>
|
|
|
+ </Style>
|
|
|
+ </MenuItem.ItemContainerStyle>
|
|
|
+ </MenuItem>
|
|
|
+ <MenuItem Header="_Save" InputGestureText="Ctrl+S" Command="{Binding FileSubViewModel.SaveDocumentCommand}" />
|
|
|
+ <MenuItem Header="_Save As..." InputGestureText="Ctrl+Shift+S"
|
|
|
+ Command="{Binding FileSubViewModel.SaveDocumentCommand}" CommandParameter="AsNew" />
|
|
|
+ <MenuItem Header="_Export" InputGestureText="Ctrl+Shift+Alt+S" Command="{Binding FileSubViewModel.ExportFileCommand}" />
|
|
|
+ <Separator />
|
|
|
+ <MenuItem Header="_Exit" Command="{x:Static SystemCommands.CloseWindowCommand}" />
|
|
|
+ </MenuItem>
|
|
|
+ <MenuItem Header="_Edit">
|
|
|
+ <MenuItem Header="_Undo" InputGestureText="Ctrl+Z" Command="{Binding UndoSubViewModel.UndoCommand}" />
|
|
|
+ <MenuItem Header="_Redo" InputGestureText="Ctrl+Y" Command="{Binding UndoSubViewModel.RedoCommand}" />
|
|
|
+ <Separator />
|
|
|
+ <MenuItem Header="_Cut" Command="{Binding ClipboardSubViewModel.CutCommand}" InputGestureText="Ctrl+X" />
|
|
|
+ <MenuItem Header="_Copy" Command="{Binding ClipboardSubViewModel.CopyCommand}" InputGestureText="Ctrl+C" />
|
|
|
+ <MenuItem Header="_Paste" Command="{Binding ClipboardSubViewModel.PasteCommand}" InputGestureText="Ctrl+V" />
|
|
|
+ <MenuItem Header="_Duplicate" Command="{Binding ClipboardSubViewModel.DuplicateCommand}" InputGestureText="Ctrl+J" />
|
|
|
+ <Separator />
|
|
|
+ <MenuItem Header="_Delete Selected" Command="{Binding DocumentSubViewModel.DeletePixelsCommand}"
|
|
|
+ InputGestureText="Delete" />
|
|
|
+ <Separator />
|
|
|
+ <MenuItem Header="_Settings" Command="{Binding MiscSubViewModel.OpenSettingsWindowCommand}" />
|
|
|
+ </MenuItem>
|
|
|
+ <MenuItem Header="_Select">
|
|
|
+ <MenuItem Header="_Select All" Command="{Binding SelectionSubViewModel.SelectAllCommand}" InputGestureText="Ctrl+A" />
|
|
|
+ <MenuItem Header="_Deselect" Command="{Binding SelectionSubViewModel.DeselectCommand}" InputGestureText="Ctrl+D" />
|
|
|
+ </MenuItem>
|
|
|
+ <MenuItem Header="_Document">
|
|
|
+ <MenuItem Header="_Resize Document..." Command="{Binding DocumentSubViewModel.OpenResizePopupCommand}"
|
|
|
+ InputGestureText="Ctrl+Shift+I" />
|
|
|
+ <MenuItem Header="_Resize Canvas..." Command="{Binding DocumentSubViewModel.OpenResizePopupCommand}"
|
|
|
+ CommandParameter="canvas" InputGestureText="Ctrl+Shift+C" />
|
|
|
+ <MenuItem Header="_Clip Canvas" Command="{Binding DocumentSubViewModel.ClipCanvasCommand}" />
|
|
|
+ <Separator/>
|
|
|
+ <MenuItem Header="_Center Content" Command="{Binding DocumentSubViewModel.CenterContentCommand}" />
|
|
|
+ </MenuItem>
|
|
|
+ <MenuItem Header="_View">
|
|
|
+ <MenuItem Header="_Show Grid Lines" IsChecked="{Binding ViewportSubViewModel.GridLinesEnabled, Mode=TwoWay}"
|
|
|
+ IsCheckable="True" InputGestureText="Ctrl+`"/>
|
|
|
+ </MenuItem>
|
|
|
+ <MenuItem Header="_Help">
|
|
|
+ <MenuItem Header="_Documentation" Command="{Binding MiscSubViewModel.OpenHyperlinkCommand}"
|
|
|
+ CommandParameter="https://github.com/PixiEditor/PixiEditor/wiki"/>
|
|
|
+ <MenuItem Header="_Repository" Command="{Binding MiscSubViewModel.OpenHyperlinkCommand}"
|
|
|
+ CommandParameter="https://github.com/PixiEditor/PixiEditor"/>
|
|
|
+ <MenuItem Header="_Shortcuts" Command="{Binding MiscSubViewModel.OpenHyperlinkCommand}"
|
|
|
+ CommandParameter="https://github.com/PixiEditor/PixiEditor/wiki/Shortcuts"/>
|
|
|
+ <Separator/>
|
|
|
+ <MenuItem Header="_License" Command="{Binding MiscSubViewModel.OpenHyperlinkCommand}"
|
|
|
+ CommandParameter="https://github.com/PixiEditor/PixiEditor/blob/master/LICENSE"/>
|
|
|
+ <MenuItem Header="_Third Party Licenses" Command="{Binding MiscSubViewModel.OpenHyperlinkCommand}"
|
|
|
+ CommandParameter="https://github.com/PixiEditor/PixiEditor/wiki/Third-party-licenses"/>
|
|
|
+ </MenuItem>
|
|
|
+ </Menu>
|
|
|
+ <StackPanel DockPanel.Dock="Right" VerticalAlignment="Top" Orientation="Horizontal"
|
|
|
+ HorizontalAlignment="Right" WindowChrome.IsHitTestVisibleInChrome="True">
|
|
|
+ <Button Style="{StaticResource MinimizeButtonStyle}" WindowChrome.IsHitTestVisibleInChrome="True"
|
|
|
+ ToolTip="Minimize"
|
|
|
+ Command="{x:Static SystemCommands.MinimizeWindowCommand}" />
|
|
|
+ <Button x:Name="RestoreButton" Visibility="Visible" Style="{StaticResource RestoreButtonStyle}"
|
|
|
+ Command="{x:Static SystemCommands.RestoreWindowCommand}"
|
|
|
+ WindowChrome.IsHitTestVisibleInChrome="True" ToolTip="Restore" />
|
|
|
+ <Button x:Name="MaximizeButton" Visibility="Collapsed" Style="{StaticResource MaximizeButtonStyle}"
|
|
|
+ Command="{x:Static SystemCommands.MaximizeWindowCommand}"
|
|
|
+ WindowChrome.IsHitTestVisibleInChrome="True" ToolTip="Maximize" />
|
|
|
+ <Button Style="{StaticResource CloseButtonStyle}" WindowChrome.IsHitTestVisibleInChrome="True"
|
|
|
+ ToolTip="Close"
|
|
|
+ Command="{x:Static SystemCommands.CloseWindowCommand}" />
|
|
|
+ </StackPanel>
|
|
|
+ </DockPanel>
|
|
|
+ <StackPanel Background="{StaticResource MainColor}" Orientation="Horizontal" Grid.ColumnSpan="3" Grid.Column="0"
|
|
|
+ Grid.Row="1">
|
|
|
+ <Label Style="{StaticResource BaseLabel}" Margin="10,0,0,0" FontSize="12" VerticalAlignment="Center" Content="{Binding BitmapManager.SelectedTool.ToolName}"/>
|
|
|
+ <Label Style="{StaticResource BaseLabel}" Padding="0" FontSize="12" VerticalAlignment="Center" Content="tool"/>
|
|
|
+ <ItemsControl ItemsSource="{Binding BitmapManager.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}" />
|
|
|
+ <ContentControl Content="{Binding SettingControl}" />
|
|
|
+ </StackPanel>
|
|
|
+ </DataTemplate>
|
|
|
+ </ItemsControl.ItemTemplate>
|
|
|
+ </ItemsControl>
|
|
|
+ </StackPanel>
|
|
|
+ <Grid Grid.Column="1" Grid.Row="2" Background="#303030">
|
|
|
+ <Grid>
|
|
|
+ <DockingManager ActiveContent="{Binding BitmapManager.ActiveDocument, Mode=TwoWay}"
|
|
|
+ DocumentsSource="{Binding BitmapManager.Documents}">
|
|
|
+ <DockingManager.Theme>
|
|
|
+ <avalonDockTheme:PixiEditorDockTheme />
|
|
|
+ </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}"
|
|
|
+ RecenterZoombox="{Binding RecenterZoombox}"
|
|
|
+ GridLinesVisible="{Binding XamlAccesibleViewModel.ViewportSubViewModel.GridLinesEnabled}"
|
|
|
+ Cursor="{Binding XamlAccesibleViewModel.ToolsSubViewModel.ToolCursor}"
|
|
|
+ MiddleMouseClickedCommand="{Binding XamlAccesibleViewModel.ToolsSubViewModel.SelectToolCommand}"
|
|
|
+ ViewportPosition="{Binding ViewportPosition}"
|
|
|
+ MouseMoveCommand="{Binding XamlAccesibleViewModel.IoSubViewModel.MouseMoveCommand}"
|
|
|
+ MouseDownCommand="{Binding XamlAccesibleViewModel.IoSubViewModel.MouseDownCommand}"
|
|
|
+ MouseXOnCanvas="{Binding MouseXOnCanvas, 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>
|
|
|
+ </ui:DocumentsTemplateSelector.DocumentsViewTemplate>
|
|
|
+ </ui:DocumentsTemplateSelector>
|
|
|
+ </DockingManager.LayoutItemTemplateSelector>
|
|
|
+ <avalondock:LayoutRoot x:Name="LayoutRoot">
|
|
|
+ <LayoutPanel Orientation="Horizontal">
|
|
|
+ <LayoutDocumentPane/>
|
|
|
+ <LayoutAnchorablePaneGroup Orientation="Vertical" DockWidth="290">
|
|
|
+ <LayoutAnchorablePane>
|
|
|
+ <LayoutAnchorable ContentId="colorPicker" Title="Color Picker" CanHide="False"
|
|
|
+ CanClose="False" CanAutoHide="False"
|
|
|
+ CanDockAsTabbedDocument="False" CanFloat="True">
|
|
|
+ <colorpicker:StandardColorPicker Grid.Row="0" SelectedColor="{Binding ColorsSubViewModel.PrimaryColor, Mode=TwoWay}"
|
|
|
+ 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"
|
|
|
+ CanClose="False" CanAutoHide="False"
|
|
|
+ CanDockAsTabbedDocument="False" CanFloat="True">
|
|
|
+ <ScrollViewer HorizontalScrollBarVisibility="Disabled"
|
|
|
+ VerticalScrollBarVisibility="Auto">
|
|
|
+ <ItemsControl ItemsSource="{Binding BitmapManager.ActiveDocument.Swatches}">
|
|
|
+ <ItemsControl.ItemsPanel>
|
|
|
+ <ItemsPanelTemplate>
|
|
|
+ <WrapPanel Margin="10,10,0,10" Orientation="Horizontal"
|
|
|
+ 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"
|
|
|
+ Stretch="UniformToFill">
|
|
|
+ <ImageBrush.RelativeTransform>
|
|
|
+ <ScaleTransform ScaleX="6" ScaleY="6" CenterX="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
|
|
|
+ Command="{Binding
|
|
|
+ RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}, Path=DataContext.ColorsSubViewModel.SelectColorCommand}"
|
|
|
+ CommandParameter="{Binding}" />
|
|
|
+ </i:EventTrigger>
|
|
|
+ </i:Interaction.Triggers>
|
|
|
+ <Grid.ContextMenu>
|
|
|
+ <ContextMenu>
|
|
|
+ <MenuItem Header="Remove" Foreground="White"
|
|
|
+ Command="{Binding ColorsSubViewModel.RemoveSwatchCommand}"
|
|
|
+ CommandParameter="{Binding}" />
|
|
|
+ </ContextMenu>
|
|
|
+ </Grid.ContextMenu>
|
|
|
+ </Grid>
|
|
|
+ </DataTemplate>
|
|
|
+ </ItemsControl.ItemTemplate>
|
|
|
+ </ItemsControl>
|
|
|
+ </ScrollViewer>
|
|
|
+ </avalondock:LayoutAnchorable>
|
|
|
+ </LayoutAnchorablePane>
|
|
|
+ <LayoutAnchorablePane>
|
|
|
+ <LayoutAnchorable ContentId="layers" Title="Layers" CanHide="False"
|
|
|
+ CanClose="False" CanAutoHide="False"
|
|
|
+ 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"
|
|
|
+ HorizontalAlignment="Stretch" Margin="5"
|
|
|
+ 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"
|
|
|
+ IsEnabled="{Binding Path=BitmapManager.ActiveDocument,
|
|
|
+ Converter={StaticResource NotNullToBoolConverter}}"
|
|
|
+ Width="40" Height="20"
|
|
|
+ VerticalAlignment="Center"
|
|
|
+ Value="{Binding BitmapManager.ActiveDocument.ActiveLayer.OpacityUndoTriggerable, Mode=TwoWay,
|
|
|
+ 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}"
|
|
|
+ x:Name="layersItemsControl" AlternationCount="9999">
|
|
|
+ <ItemsControl.ItemsPanel>
|
|
|
+ <ItemsPanelTemplate>
|
|
|
+ <ui:ReversedOrderStackPanel Orientation="Vertical" />
|
|
|
+ </ItemsPanelTemplate>
|
|
|
+ </ItemsControl.ItemsPanel>
|
|
|
+ <ItemsControl.ItemTemplate>
|
|
|
+ <DataTemplate>
|
|
|
+ <vws:LayerItem Tag="{Binding DataContext, ElementName=mainWindow}" LayerIndex="{Binding RelativeSource={RelativeSource Mode=TemplatedParent},
|
|
|
+ Path=(ItemsControl.AlternationIndex)}" SetActiveLayerCommand="{Binding Path=DataContext.LayersSubViewModel.SetActiveLayerCommand, ElementName=mainWindow}"
|
|
|
+ LayerName="{Binding Name, Mode=TwoWay}" IsActive="{Binding IsActive, Mode=TwoWay}"
|
|
|
+ IsRenaming="{Binding IsRenaming, Mode=TwoWay}"
|
|
|
+ PreviewImage="{Binding LayerBitmap}"
|
|
|
+ LayerColor="{Binding LayerHighlightColor}"
|
|
|
+ MoveToBackCommand="{Binding DataContext.LayersSubViewModel.MoveToBackCommand, ElementName=mainWindow}"
|
|
|
+ MoveToFrontCommand="{Binding DataContext.LayersSubViewModel.MoveToFrontCommand, ElementName=mainWindow}">
|
|
|
+ <vws:LayerItem.ContextMenu>
|
|
|
+ <ContextMenu>
|
|
|
+ <MenuItem Header="Delete"
|
|
|
+ Command="{Binding PlacementTarget.Tag.LayersSubViewModel.DeleteLayersCommand,
|
|
|
+ RelativeSource={RelativeSource AncestorType=ContextMenu}}"
|
|
|
+
|
|
|
+ CommandParameter="{Binding RelativeSource={RelativeSource Mode=TemplatedParent},
|
|
|
+ Path=(ItemsControl.AlternationIndex)}" />
|
|
|
+ <MenuItem Header="Rename"
|
|
|
+ Command="{Binding PlacementTarget.Tag.LayersSubViewModel.RenameLayerCommand,
|
|
|
+ RelativeSource={RelativeSource AncestorType=ContextMenu}}"
|
|
|
+ CommandParameter="{Binding RelativeSource={RelativeSource Mode=TemplatedParent},
|
|
|
+ Path=(ItemsControl.AlternationIndex)}" />
|
|
|
+ <MenuItem Header="Move to front"
|
|
|
+ Command="{Binding PlacementTarget.Tag.LayersSubViewModel.MoveToFrontCommand,
|
|
|
+ RelativeSource={RelativeSource AncestorType=ContextMenu}}"
|
|
|
+ CommandParameter="{Binding RelativeSource={RelativeSource Mode=TemplatedParent},
|
|
|
+ Path=(ItemsControl.AlternationIndex)}" />
|
|
|
+ <MenuItem Header="Move to back"
|
|
|
+ Command="{Binding PlacementTarget.Tag.LayersSubViewModel.MoveToBackCommand,
|
|
|
+ RelativeSource={RelativeSource AncestorType=ContextMenu}}"
|
|
|
+ CommandParameter="{Binding RelativeSource={RelativeSource Mode=TemplatedParent},
|
|
|
+ Path=(ItemsControl.AlternationIndex)}" />
|
|
|
+ <Separator/>
|
|
|
+ <MenuItem Header="Merge selected"
|
|
|
+ Command="{Binding PlacementTarget.Tag.LayersSubViewModel.MergeSelectedCommand,
|
|
|
+ RelativeSource={RelativeSource AncestorType=ContextMenu}}"/>
|
|
|
+ <MenuItem Header="Merge with above"
|
|
|
+ Command="{Binding PlacementTarget.Tag.LayersSubViewModel.MergeWithAboveCommand,
|
|
|
+ RelativeSource={RelativeSource AncestorType=ContextMenu}}"
|
|
|
+ CommandParameter="{Binding RelativeSource={RelativeSource Mode=TemplatedParent},
|
|
|
+ Path=(ItemsControl.AlternationIndex)}" />
|
|
|
+ <MenuItem Header="Merge with below"
|
|
|
+ Command="{Binding PlacementTarget.Tag.LayersSubViewModel.MergeWithBelowCommand,
|
|
|
+ RelativeSource={RelativeSource AncestorType=ContextMenu}}"
|
|
|
+ CommandParameter="{Binding RelativeSource={RelativeSource Mode=TemplatedParent},
|
|
|
+ Path=(ItemsControl.AlternationIndex)}" />
|
|
|
+ </ContextMenu>
|
|
|
+ </vws:LayerItem.ContextMenu>
|
|
|
+ </vws:LayerItem>
|
|
|
+ </DataTemplate>
|
|
|
+ </ItemsControl.ItemTemplate>
|
|
|
+ </ItemsControl>
|
|
|
+ </ScrollViewer>
|
|
|
+ </Grid>
|
|
|
+ </LayoutAnchorable>
|
|
|
+ </LayoutAnchorablePane>
|
|
|
+ </LayoutAnchorablePaneGroup>
|
|
|
+ </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.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"/>
|
|
|
+ <StackPanel DockPanel.Dock="Right" Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Center">
|
|
|
+ <TextBlock Text="X:" Foreground="White" FontSize="16"/>
|
|
|
+ <TextBlock Margin="4,0,10,0" Text="{Binding BitmapManager.ActiveDocument.MouseXOnCanvas, Converter={StaticResource DoubleToIntConverter}}" Foreground="White" FontSize="16"/>
|
|
|
+ <TextBlock Text="Y:" Foreground="White" FontSize="16"/>
|
|
|
+ <TextBlock Margin="4,0,10,0" Text="{Binding BitmapManager.ActiveDocument.MouseYOnCanvas, Converter={StaticResource DoubleToIntConverter}}" Foreground="White" FontSize="16"/>
|
|
|
+ </StackPanel>
|
|
|
+ </DockPanel>
|
|
|
+ <StackPanel Margin="10,0,0,0" VerticalAlignment="Center" Grid.Row="3"
|
|
|
+ Grid.Column="3" Orientation="Horizontal">
|
|
|
+ <Button Style="{StaticResource BaseDarkButton}"
|
|
|
+ Visibility="{Binding UpdateSubViewModel.UpdateReadyToInstall, Converter={StaticResource BoolToVisibilityConverter}}" FontSize="14" Height="20"
|
|
|
+ Command="{Binding UpdateSubViewModel.RestartApplicationCommand}">Restart</Button>
|
|
|
+ <TextBlock VerticalAlignment="Center" Padding="10" HorizontalAlignment="Right"
|
|
|
+ Foreground="White" FontSize="14" Text="{Binding UpdateSubViewModel.VersionText}" />
|
|
|
+ </StackPanel>
|
|
|
+ </Grid>
|
|
|
+ </Grid>
|
|
|
</Window>
|