Browse Source

Finish all regular dialogs

Equbuxu 3 years ago
parent
commit
99f898b91d

+ 1 - 1
PixiEditor/Exceptions/CorruptedFileException.cs

@@ -6,7 +6,7 @@ namespace PixiEditor.Exceptions
     public class CorruptedFileException : Exception
     public class CorruptedFileException : Exception
     {
     {
         public CorruptedFileException()
         public CorruptedFileException()
-            : base("The file you chose might be corrupted.")
+            : base("The file you've chosen might be corrupted.")
         {
         {
         }
         }
 
 

+ 1 - 0
PixiEditor/Styles/ThemeStyle.xaml

@@ -42,6 +42,7 @@
         <Setter Property="OverridesDefaultStyle" Value="True" />
         <Setter Property="OverridesDefaultStyle" Value="True" />
         <Setter Property="Background" Value="#303030" />
         <Setter Property="Background" Value="#303030" />
         <Setter Property="Height" Value="28"/>
         <Setter Property="Height" Value="28"/>
+        <Setter Property="Width" Value="70"/>
         <Setter Property="Template">
         <Setter Property="Template">
             <Setter.Value>
             <Setter.Value>
                 <ControlTemplate TargetType="Button">
                 <ControlTemplate TargetType="Button">

+ 9 - 6
PixiEditor/Views/Dialogs/ConfirmationPopup.xaml

@@ -3,10 +3,13 @@
         xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
         xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
         xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
         xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
         xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
         xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
-        xmlns:system="clr-namespace:System;assembly=System.Runtime" xmlns:behaviours="clr-namespace:PixiEditor.Helpers.Behaviours" xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
+        xmlns:system="clr-namespace:System;assembly=System.Runtime" 
+        xmlns:behaviours="clr-namespace:PixiEditor.Helpers.Behaviours" 
+        xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
         xmlns:dial="clr-namespace:PixiEditor.Views.Dialogs"
         xmlns:dial="clr-namespace:PixiEditor.Views.Dialogs"
         mc:Ignorable="d" d:Title="Unsaved changes"
         mc:Ignorable="d" d:Title="Unsaved changes"
-        Name="popup" WindowStartupLocation="CenterScreen" Height="180" Width="400"
+        Name="popup" WindowStartupLocation="CenterScreen" 
+        Height="180" Width="400" MinHeight="180" MinWidth="400"
         WindowStyle="None">
         WindowStyle="None">
 
 
     <WindowChrome.WindowChrome>
     <WindowChrome.WindowChrome>
@@ -23,22 +26,22 @@
             TitleText="{Binding ElementName=popup, Path=Title}" CloseCommand="{Binding DataContext.CancelCommand, ElementName=popup}" />
             TitleText="{Binding ElementName=popup, Path=Title}" CloseCommand="{Binding DataContext.CancelCommand, ElementName=popup}" />
 
 
         <StackPanel DockPanel.Dock="Bottom" Grid.Row="2" Orientation="Horizontal" HorizontalAlignment="Center"
         <StackPanel DockPanel.Dock="Bottom" Grid.Row="2" Orientation="Horizontal" HorizontalAlignment="Center"
-                    Margin="0,0,10,16">
-            <Button Margin="10,0,10,0" Width="60" IsDefault="True"
+                    Margin="0,0,10,15">
+            <Button Margin="10,0,10,0" Width="70" IsDefault="True"
                     Command="{Binding Path=DataContext.SetResultAndCloseCommand, ElementName=popup}"
                     Command="{Binding Path=DataContext.SetResultAndCloseCommand, ElementName=popup}"
                     Style="{StaticResource DarkRoundButton}" Content="Yes">
                     Style="{StaticResource DarkRoundButton}" Content="Yes">
                 <Button.CommandParameter>
                 <Button.CommandParameter>
                     <system:Boolean>True</system:Boolean>
                     <system:Boolean>True</system:Boolean>
                 </Button.CommandParameter>
                 </Button.CommandParameter>
             </Button>
             </Button>
-            <Button Width="60"
+            <Button Width="70"
                     Command="{Binding Path=DataContext.SetResultAndCloseCommand, ElementName=popup}"
                     Command="{Binding Path=DataContext.SetResultAndCloseCommand, ElementName=popup}"
                     Style="{StaticResource DarkRoundButton}" Content="No">
                     Style="{StaticResource DarkRoundButton}" Content="No">
                 <Button.CommandParameter>
                 <Button.CommandParameter>
                     <system:Boolean>False</system:Boolean>
                     <system:Boolean>False</system:Boolean>
                 </Button.CommandParameter>
                 </Button.CommandParameter>
             </Button>
             </Button>
-            <Button Margin="10,0,10,0" Width="80" Style="{StaticResource DarkRoundButton}" Content="Cancel"
+            <Button Margin="10,0,10,0" Width="70" Style="{StaticResource DarkRoundButton}" Content="Cancel"
                     Command="{Binding DataContext.CancelCommand, ElementName=popup}" />
                     Command="{Binding DataContext.CancelCommand, ElementName=popup}" />
         </StackPanel>
         </StackPanel>
 
 

+ 15 - 22
PixiEditor/Views/Dialogs/ExportFilePopup.xaml

@@ -6,8 +6,9 @@
         xmlns:local="clr-namespace:PixiEditor.Views"
         xmlns:local="clr-namespace:PixiEditor.Views"
         xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
         xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
         xmlns:behaviours="clr-namespace:PixiEditor.Helpers.Behaviours"
         xmlns:behaviours="clr-namespace:PixiEditor.Helpers.Behaviours"
+        xmlns:dial="clr-namespace:PixiEditor.Views.Dialogs"
         mc:Ignorable="d" BorderBrush="Black" BorderThickness="1"
         mc:Ignorable="d" BorderBrush="Black" BorderThickness="1"
-        Title="SaveFilePopup" Height="300" Width="400" WindowStyle="None" MinHeight="300" MinWidth="400"
+        Title="SaveFilePopup" Height="250" Width="300" WindowStyle="None" MinHeight="250" MinWidth="300"
         WindowStartupLocation="CenterScreen" Name="saveFilePopup">
         WindowStartupLocation="CenterScreen" Name="saveFilePopup">
     <WindowChrome.WindowChrome>
     <WindowChrome.WindowChrome>
         <WindowChrome CaptionHeight="32"  GlassFrameThickness="0.1"
         <WindowChrome CaptionHeight="32"  GlassFrameThickness="0.1"
@@ -19,31 +20,23 @@
                         Executed="CommandBinding_Executed_Close" />
                         Executed="CommandBinding_Executed_Close" />
     </Window.CommandBindings>
     </Window.CommandBindings>
 
 
-    <Grid Background="{StaticResource AccentColor}" Focusable="True">
-        <Grid.RowDefinitions>
-            <RowDefinition Height="35" />
-            <RowDefinition />
-        </Grid.RowDefinitions>
+    <DockPanel Background="{StaticResource AccentColor}" Focusable="True">
         <i:Interaction.Behaviors>
         <i:Interaction.Behaviors>
             <behaviours:ClearFocusOnClickBehavior/>
             <behaviours:ClearFocusOnClickBehavior/>
         </i:Interaction.Behaviors>
         </i:Interaction.Behaviors>
 
 
-        <DockPanel Grid.Row="0" Background="{StaticResource MainColor}">
-            <Button DockPanel.Dock="Right" HorizontalAlignment="Right" Style="{StaticResource CloseButtonStyle}"
-                    WindowChrome.IsHitTestVisibleInChrome="True" ToolTip="Close"
-                    Command="{x:Static SystemCommands.CloseWindowCommand}" />
-        </DockPanel>
 
 
-        <TextBlock Grid.Row="1" Foreground="Snow" VerticalAlignment="Top" HorizontalAlignment="Center"
-                       Text="File settings" TextAlignment="Center" Margin="0,10,0,0" FontSize="24" />
-        <StackPanel Orientation="Vertical" Grid.Row="1" Margin="0,50,0,0">
-            <local:SizePicker Width="250" Height="120"
-                                  x:Name="sizePicker"
-                                  ChosenHeight="{Binding Path=SaveHeight, Mode=TwoWay, ElementName=saveFilePopup}"
-                                  ChosenWidth="{Binding Path=SaveWidth, Mode=TwoWay, ElementName=saveFilePopup}" />
-        </StackPanel>
-        <Button Grid.Row="1" Height="30" Width="60" VerticalAlignment="Bottom" HorizontalAlignment="Right" IsDefault="True"
-                    Margin="10" Style="{StaticResource DarkRoundButton}" Content="OK" Command="{Binding OkCommand}"
+        <dial:DialogTitleBar DockPanel.Dock="Top"
+            TitleText="Export image" CloseCommand="{x:Static SystemCommands.CloseWindowCommand}"/>
+
+        <Button DockPanel.Dock="Bottom" Width="70" HorizontalAlignment="Center" IsDefault="True"
+                    Margin="15" Style="{StaticResource DarkRoundButton}" Content="Export" Command="{Binding OkCommand}"
                     CommandParameter="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}}" />
                     CommandParameter="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}}" />
-    </Grid>
+
+        <local:SizePicker Width="230" Height="125" Margin="0,30,0,0"
+            x:Name="sizePicker"
+            ChosenHeight="{Binding Path=SaveHeight, Mode=TwoWay, ElementName=saveFilePopup}"
+            ChosenWidth="{Binding Path=SaveWidth, Mode=TwoWay, ElementName=saveFilePopup}" />
+
+    </DockPanel>
 </Window>
 </Window>

+ 1 - 1
PixiEditor/Views/Dialogs/HelloTherePopup.xaml

@@ -8,7 +8,7 @@
         xmlns:uc="clr-namespace:PixiEditor.Views.UserControls"
         xmlns:uc="clr-namespace:PixiEditor.Views.UserControls"
         xmlns:local="clr-namespace:PixiEditor.Views.Dialogs"
         xmlns:local="clr-namespace:PixiEditor.Views.Dialogs"
         mc:Ignorable="d" ShowInTaskbar="False"
         mc:Ignorable="d" ShowInTaskbar="False"
-        Title="Hello there!" Height="662" Width="632"
+        Title="Hello there!" Height="662" Width="632" MinHeight="500" MinWidth="500"
         d:DataContext="{d:DesignInstance local:HelloTherePopup}"
         d:DataContext="{d:DesignInstance local:HelloTherePopup}"
         WindowStyle="None" WindowStartupLocation="CenterScreen">
         WindowStyle="None" WindowStartupLocation="CenterScreen">
 
 

+ 21 - 23
PixiEditor/Views/Dialogs/ImportFilePopup.xaml

@@ -4,9 +4,16 @@
         xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
         xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
         xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
         xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
         xmlns:local="clr-namespace:PixiEditor.Views"
         xmlns:local="clr-namespace:PixiEditor.Views"
+        xmlns:dial="clr-namespace:PixiEditor.Views.Dialogs"
         xmlns:vm="clr-namespace:PixiEditor.ViewModels"
         xmlns:vm="clr-namespace:PixiEditor.ViewModels"
+        xmlns:behaviours="clr-namespace:PixiEditor.Helpers.Behaviours" 
+        xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
         mc:Ignorable="d" BorderBrush="Black" BorderThickness="1"
         mc:Ignorable="d" BorderBrush="Black" BorderThickness="1"
-        Title="ImportFilePopup" ShowInTaskbar="False" Height="350" Width="300" WindowStyle="None" WindowStartupLocation="CenterScreen" Name="importFilePopup" MinHeight="350" MinWidth="300"
+        Title="ImportFilePopup" ShowInTaskbar="False" 
+        MinHeight="250" MinWidth="300" Height="250" Width="300" 
+        WindowStyle="None" 
+        WindowStartupLocation="CenterScreen" 
+        Name="importFilePopup"
         DataContext="{DynamicResource ImportFilePopupViewModel}">
         DataContext="{DynamicResource ImportFilePopupViewModel}">
     <Window.Resources>
     <Window.Resources>
         <vm:ImportFilePopupViewModel x:Key="ImportFilePopupViewModel" />
         <vm:ImportFilePopupViewModel x:Key="ImportFilePopupViewModel" />
@@ -21,28 +28,19 @@
                         Executed="CommandBinding_Executed_Close" />
                         Executed="CommandBinding_Executed_Close" />
     </Window.CommandBindings>
     </Window.CommandBindings>
 
 
-    <Grid Background="{StaticResource AccentColor}">
-        <Grid.RowDefinitions>
-            <RowDefinition Height="35" />
-            <RowDefinition />
-        </Grid.RowDefinitions>
+    <DockPanel Background="{StaticResource AccentColor}">
+        <i:Interaction.Behaviors>
+            <behaviours:ClearFocusOnClickBehavior/>
+        </i:Interaction.Behaviors>
 
 
-        <DockPanel Grid.Row="0" Background="{StaticResource MainColor}">
-            <Button DockPanel.Dock="Right" HorizontalAlignment="Right" Style="{StaticResource CloseButtonStyle}"
-                    WindowChrome.IsHitTestVisibleInChrome="True" ToolTip="Close"
-                    Command="{x:Static SystemCommands.CloseWindowCommand}" />
-        </DockPanel>
-        <StackPanel Grid.Row="1">
-            <Label Height="40" Width="120" VerticalAlignment="Top" Content="Open" Foreground="Snow"
-                       HorizontalContentAlignment="Center" FontSize="24" Margin="0,10,0,0" />
-            <StackPanel Background="{StaticResource MainColor}" Height="120" Width="225" Margin="0,30,0,0">
-                <local:SizePicker x:Name="sizePicker"
-                                  ChosenWidth="{Binding ImportWidth, Mode=TwoWay}"
-                                  ChosenHeight="{Binding ImportHeight,Mode=TwoWay}" />
-            </StackPanel>
-        </StackPanel>
-        <Button Grid.Row="1" Height="30" Width="60" VerticalAlignment="Bottom" HorizontalAlignment="Right" IsDefault="True"
-                    Margin="10" Style="{StaticResource DarkRoundButton}" Content="OK" Command="{Binding OkCommand}"
+        <dial:DialogTitleBar DockPanel.Dock="Top"
+            TitleText="Import image" CloseCommand="{x:Static SystemCommands.CloseWindowCommand}"/>
+        <Button DockPanel.Dock="Bottom" Width="70" HorizontalAlignment="Center" IsDefault="True"
+                    Margin="15" Style="{StaticResource DarkRoundButton}" Content="Import" Command="{Binding OkCommand}"
                     CommandParameter="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}}" />
                     CommandParameter="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}}" />
-    </Grid>
+        <local:SizePicker x:Name="sizePicker" Width="230" Height="125" Margin="0,30,0,0"
+                                  ChosenWidth="{Binding ImportWidth, Mode=TwoWay}"
+                                  ChosenHeight="{Binding ImportHeight, Mode=TwoWay}" />
+
+    </DockPanel>
 </Window>
 </Window>

+ 4 - 7
PixiEditor/Views/Dialogs/NewFilePopup.xaml

@@ -12,7 +12,7 @@
         DataContext="{DynamicResource NewFileMenuViewModel}" 
         DataContext="{DynamicResource NewFileMenuViewModel}" 
         WindowStyle="None" 
         WindowStyle="None" 
         WindowStartupLocation="CenterScreen" 
         WindowStartupLocation="CenterScreen" 
-        MinHeight="200" MinWidth="300" Height="255" Width="300" 
+        MinHeight="250" MinWidth="300" Height="250" Width="300" 
         Name="newFilePopup" 
         Name="newFilePopup" 
         BorderBrush="Black" BorderThickness="1">
         BorderBrush="Black" BorderThickness="1">
     <Window.Resources>
     <Window.Resources>
@@ -34,21 +34,18 @@
         </i:Interaction.Behaviors>
         </i:Interaction.Behaviors>
 
 
         <dial:DialogTitleBar DockPanel.Dock="Top"
         <dial:DialogTitleBar DockPanel.Dock="Top"
-            TitleText="Create a new canvas" CloseCommand="{x:Static SystemCommands.CloseWindowCommand}" />
+            TitleText="Create a new image" CloseCommand="{x:Static SystemCommands.CloseWindowCommand}" />
 
 
-        <Button DockPanel.Dock="Bottom" Width="70" Margin="16" HorizontalAlignment="Center"
+        <Button DockPanel.Dock="Bottom" Width="70" Margin="0,15,0,15" HorizontalAlignment="Center"
                 IsDefault="True" Content="Create" x:Name="createButton"
                 IsDefault="True" Content="Create" x:Name="createButton"
                 Style="{StaticResource DarkRoundButton}" 
                 Style="{StaticResource DarkRoundButton}" 
                 Command="{Binding OkCommand}"
                 Command="{Binding OkCommand}"
                 CommandParameter="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}}" />
                 CommandParameter="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}}" />
 
 
-        <Border HorizontalAlignment="Center" Margin="0,30,0,0" Background="{StaticResource MainColor}"
-                        VerticalAlignment="Top" Grid.Row="1" Width="230" Height="125">
-            <local:SizePicker Margin="0,20" HorizontalAlignment="Center" Height="110"
+        <local:SizePicker HorizontalAlignment="Center" Width="230" Height="125" Margin="0,30,0,0"
                               PreserveAspectRatio="False"
                               PreserveAspectRatio="False"
                               ChosenHeight="{Binding FileHeight, Mode=TwoWay, ElementName=newFilePopup}"
                               ChosenHeight="{Binding FileHeight, Mode=TwoWay, ElementName=newFilePopup}"
                               ChosenWidth="{Binding FileWidth, Mode=TwoWay, ElementName=newFilePopup}" 
                               ChosenWidth="{Binding FileWidth, Mode=TwoWay, ElementName=newFilePopup}" 
                               x:Name="sizePicker"/>
                               x:Name="sizePicker"/>
-        </Border>
     </DockPanel>
     </DockPanel>
 </Window>
 </Window>

+ 3 - 2
PixiEditor/Views/Dialogs/NoticePopup.xaml

@@ -8,7 +8,8 @@
         xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
         xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
         xmlns:dial="clr-namespace:PixiEditor.Views.Dialogs"
         xmlns:dial="clr-namespace:PixiEditor.Views.Dialogs"
         mc:Ignorable="d" WindowStyle="None"
         mc:Ignorable="d" WindowStyle="None"
-        d:Title="Notice" Height="160" Width="400"
+        d:Title="Notice" Height="180" Width="400" MinHeight="180" MinWidth="400"
+        WindowStartupLocation="CenterScreen"
         x:Name="popup">
         x:Name="popup">
 
 
     <WindowChrome.WindowChrome>
     <WindowChrome.WindowChrome>
@@ -24,7 +25,7 @@
         <dial:DialogTitleBar DockPanel.Dock="Top"
         <dial:DialogTitleBar DockPanel.Dock="Top"
             TitleText="{Binding ElementName=popup, Path=Title}" CloseCommand="{Binding DataContext.CancelCommand, ElementName=popup}" />
             TitleText="{Binding ElementName=popup, Path=Title}" CloseCommand="{Binding DataContext.CancelCommand, ElementName=popup}" />
 
 
-        <StackPanel DockPanel.Dock="Bottom" Orientation="Horizontal" HorizontalAlignment="Center" Margin="0,0,0,16">
+        <StackPanel DockPanel.Dock="Bottom" Orientation="Horizontal" HorizontalAlignment="Center" Margin="0,0,0,15">
             <Button Width="70" IsDefault="True" Click="OkButton_Close" Style="{StaticResource DarkRoundButton}" Content="Close"/>
             <Button Width="70" IsDefault="True" Click="OkButton_Close" Style="{StaticResource DarkRoundButton}" Content="Close"/>
         </StackPanel>
         </StackPanel>
 
 

+ 4 - 4
PixiEditor/Views/Dialogs/ResizeCanvasPopup.xaml

@@ -9,7 +9,7 @@
         xmlns:dial="clr-namespace:PixiEditor.Views.Dialogs"
         xmlns:dial="clr-namespace:PixiEditor.Views.Dialogs"
         mc:Ignorable="d" Name="window"
         mc:Ignorable="d" Name="window"
         Title="ResizeCanvasPopup" ShowInTaskbar="False" WindowStartupLocation="CenterScreen"
         Title="ResizeCanvasPopup" ShowInTaskbar="False" WindowStartupLocation="CenterScreen"
-        Height="350" Width="300" WindowStyle="None">
+        Height="350" Width="300" MinHeight="350" MinWidth="300" WindowStyle="None">
 
 
     <WindowChrome.WindowChrome>
     <WindowChrome.WindowChrome>
         <WindowChrome CaptionHeight="32"  GlassFrameThickness="0.1"
         <WindowChrome CaptionHeight="32"  GlassFrameThickness="0.1"
@@ -27,14 +27,14 @@
         </i:Interaction.Behaviors>
         </i:Interaction.Behaviors>
 
 
         <dial:DialogTitleBar DockPanel.Dock="Top"
         <dial:DialogTitleBar DockPanel.Dock="Top"
-            TitleText="Resize Canvas" CloseCommand="{x:Static SystemCommands.CloseWindowCommand}" />
+            TitleText="Resize canvas" CloseCommand="{x:Static SystemCommands.CloseWindowCommand}" />
 
 
-        <Button DockPanel.Dock="Bottom" Width="70" HorizontalAlignment="Center" Margin="16"
+        <Button DockPanel.Dock="Bottom" Width="70" HorizontalAlignment="Center" Margin="15"
                 Style="{StaticResource DarkRoundButton}" Content="Resize" Click="Button_Click" IsDefault="True" />
                 Style="{StaticResource DarkRoundButton}" Content="Resize" Click="Button_Click" IsDefault="True" />
 
 
         <StackPanel HorizontalAlignment="Center" Margin="0,30,0,0" Background="{StaticResource MainColor}"
         <StackPanel HorizontalAlignment="Center" Margin="0,30,0,0" Background="{StaticResource MainColor}"
                     VerticalAlignment="Top" Grid.Row="1" Width="230" Height="225">
                     VerticalAlignment="Top" Grid.Row="1" Width="230" Height="225">
-            <local:SizePicker Margin="0,20,0,0" Width="200"
+            <local:SizePicker Margin="0,18,0,0" Width="200"
                               x:Name="sizePicker"
                               x:Name="sizePicker"
                               PreserveAspectRatio="False"
                               PreserveAspectRatio="False"
                               ChosenHeight="{Binding NewHeight, Mode=TwoWay, ElementName=window}"
                               ChosenHeight="{Binding NewHeight, Mode=TwoWay, ElementName=window}"

+ 19 - 25
PixiEditor/Views/Dialogs/ResizeDocumentPopup.xaml

@@ -4,10 +4,13 @@
         xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
         xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
         xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
         xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
         xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
         xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
-        xmlns:local="clr-namespace:PixiEditor.Views" xmlns:behaviors="clr-namespace:PixiEditor.Helpers.Behaviours"
+        xmlns:local="clr-namespace:PixiEditor.Views" 
+        xmlns:behaviors="clr-namespace:PixiEditor.Helpers.Behaviours"
+        xmlns:dial="clr-namespace:PixiEditor.Views.Dialogs"
         mc:Ignorable="d" Name="window"
         mc:Ignorable="d" Name="window"
         Title="ResizeDocumentPopup" ShowInTaskbar="False" WindowStartupLocation="CenterScreen"
         Title="ResizeDocumentPopup" ShowInTaskbar="False" WindowStartupLocation="CenterScreen"
-        Height="300" Width="400" WindowStyle="None">
+        Height="250" Width="300" MaxHeight="250" MaxWidth="300"
+        WindowStyle="None">
 
 
     <WindowChrome.WindowChrome>
     <WindowChrome.WindowChrome>
         <WindowChrome CaptionHeight="32" GlassFrameThickness="0.1"
         <WindowChrome CaptionHeight="32" GlassFrameThickness="0.1"
@@ -19,31 +22,22 @@
                         Executed="CommandBinding_Executed_Close" />
                         Executed="CommandBinding_Executed_Close" />
     </Window.CommandBindings>
     </Window.CommandBindings>
 
 
-    <Grid Background="{StaticResource AccentColor}" Focusable="True">
-        <Grid.RowDefinitions>
-            <RowDefinition Height="35" />
-            <RowDefinition />
-        </Grid.RowDefinitions>
+    <DockPanel Background="{StaticResource AccentColor}" Focusable="True">
         <i:Interaction.Behaviors>
         <i:Interaction.Behaviors>
             <behaviors:ClearFocusOnClickBehavior/>
             <behaviors:ClearFocusOnClickBehavior/>
         </i:Interaction.Behaviors>
         </i:Interaction.Behaviors>
 
 
-        <DockPanel Grid.Row="0" Background="{StaticResource MainColor}">
-            <Button DockPanel.Dock="Right" HorizontalAlignment="Right" Style="{StaticResource CloseButtonStyle}"
-                    WindowChrome.IsHitTestVisibleInChrome="True" ToolTip="Close"
-                    Command="{x:Static SystemCommands.CloseWindowCommand}" />
-        </DockPanel>
-        <Label Grid.Row="1" VerticalAlignment="Top" Foreground="White" FontSize="24" HorizontalAlignment="Center"
-               Content="Resize document" />
-        <StackPanel HorizontalAlignment="Center" Margin="0,50,0,0" Background="{StaticResource MainColor}"
-                    VerticalAlignment="Top" Grid.Row="1" Width="350" Height="150">
-            <local:SizePicker Margin="0,20" 
-                              x:Name="sizePicker"
-                              PreserveAspectRatio="True"
-                              ChosenHeight="{Binding Path=NewHeight, Mode=TwoWay, ElementName=window}"
-                              ChosenWidth="{Binding Path=NewWidth, Mode=TwoWay, ElementName=window}" />
-        </StackPanel>
-        <Button Grid.Row="1" Height="30" Width="60" VerticalAlignment="Bottom" HorizontalAlignment="Right" Margin="10"
-                Style="{StaticResource DarkRoundButton}" Content="OK" Click="Button_Click" IsDefault="True" />
-    </Grid>
+        <dial:DialogTitleBar DockPanel.Dock="Top"
+            TitleText="Resize image" CloseCommand="{x:Static SystemCommands.CloseWindowCommand}"/>
+
+        <Button DockPanel.Dock="Bottom" Width="70" HorizontalAlignment="Center" Margin="15"
+                Style="{StaticResource DarkRoundButton}" Content="Resize" Click="Button_Click" IsDefault="True" />
+
+        <local:SizePicker HorizontalAlignment="Center" Width="230" Height="125" Margin="0,30,0,0"
+            x:Name="sizePicker"
+            PreserveAspectRatio="True"
+            ChosenHeight="{Binding Path=NewHeight, Mode=TwoWay, ElementName=window}"
+            ChosenWidth="{Binding Path=NewWidth, Mode=TwoWay, ElementName=window}" />
+
+    </DockPanel>
 </Window>
 </Window>

+ 1 - 1
PixiEditor/Views/MainWindow.xaml

@@ -126,7 +126,7 @@
                     <MenuItem Header="_Deselect" Command="{Binding SelectionSubViewModel.DeselectCommand}" InputGestureText="Ctrl+D" />
                     <MenuItem Header="_Deselect" Command="{Binding SelectionSubViewModel.DeselectCommand}" InputGestureText="Ctrl+D" />
                 </MenuItem>
                 </MenuItem>
                 <MenuItem Header="_Document">
                 <MenuItem Header="_Document">
-                    <MenuItem Header="_Resize Document..." Command="{Binding DocumentSubViewModel.OpenResizePopupCommand}"
+                    <MenuItem Header="Resize _Image..." Command="{Binding DocumentSubViewModel.OpenResizePopupCommand}"
                               InputGestureText="Ctrl+Shift+I" />
                               InputGestureText="Ctrl+Shift+I" />
                     <MenuItem Header="_Resize Canvas..." Command="{Binding DocumentSubViewModel.OpenResizePopupCommand}"
                     <MenuItem Header="_Resize Canvas..." Command="{Binding DocumentSubViewModel.OpenResizePopupCommand}"
                               CommandParameter="canvas" InputGestureText="Ctrl+Shift+C" />
                               CommandParameter="canvas" InputGestureText="Ctrl+Shift+C" />

+ 3 - 3
PixiEditor/Views/UserControls/SizePicker.xaml

@@ -6,7 +6,7 @@
              xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
              xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
              xmlns:local="clr-namespace:PixiEditor.Views"
              xmlns:local="clr-namespace:PixiEditor.Views"
              mc:Ignorable="d"
              mc:Ignorable="d"
-             d:DesignHeight="110" d:DesignWidth="215" Name="uc">
+             d:DesignHeight="150" d:DesignWidth="300" Name="uc">
     <i:Interaction.Triggers>
     <i:Interaction.Triggers>
         <i:EventTrigger EventName="Loaded">
         <i:EventTrigger EventName="Loaded">
             <i:InvokeCommandAction Command="{Binding ElementName=uc, Path=LoadedCommand}"/>
             <i:InvokeCommandAction Command="{Binding ElementName=uc, Path=LoadedCommand}"/>
@@ -23,7 +23,7 @@
             <Setter Property="Height" Value="25"/>
             <Setter Property="Height" Value="25"/>
         </Style>
         </Style>
     </UserControl.Resources>
     </UserControl.Resources>
-    <StackPanel Background="{StaticResource MainColor}">
+    <Border Background="{StaticResource MainColor}" VerticalAlignment="Stretch">
         <Grid Height="90" HorizontalAlignment="Center">
         <Grid Height="90" HorizontalAlignment="Center">
             <Grid.ColumnDefinitions>
             <Grid.ColumnDefinitions>
                 <ColumnDefinition Width="40"/>
                 <ColumnDefinition Width="40"/>
@@ -68,5 +68,5 @@
                   HorizontalAlignment="Left" 
                   HorizontalAlignment="Left" 
                   VerticalAlignment="Center" />
                   VerticalAlignment="Center" />
         </Grid>
         </Grid>
-    </StackPanel>
+    </Border>
 </UserControl>
 </UserControl>