Browse Source

Added delete layer option via context menu

Frytek 5 years ago
parent
commit
624a706a49

+ 6 - 8
PixiEditor/Helpers/Converters/BoolToVisibilityConverter.cs → PixiEditor/Helpers/Converters/BoolToColorConverter.cs

@@ -1,32 +1,30 @@
 using System;
 using System;
-using System.Collections.Generic;
 using System.Globalization;
 using System.Globalization;
-using System.Text;
 using System.Windows.Data;
 using System.Windows.Data;
 
 
 namespace PixiEditor.Helpers.Converters
 namespace PixiEditor.Helpers.Converters
 {
 {
-    public class BoolToVisibilityConverter : IValueConverter
+    public class BoolToColorConverter : IValueConverter
     {
     {
-        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
         {
         {
-            if(value.ToString() == "Hidden" || value.ToString() == "Collapsed")
+            if(value.ToString() == "Transparent")
             {
             {
                 return false;
                 return false;
             }
             }
             return true;
             return true;
         }
         }
 
 
-        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
         {
         {
             if(value is bool)
             if(value is bool)
             {
             {
                 if((bool)value == false)
                 if((bool)value == false)
                 {
                 {
-                    return "Hidden";
+                    return "Transparent";
                 }
                 }
             }
             }
-            return "Visible";
+            return "#638DCA";
         }
         }
     }
     }
 }
 }

BIN
PixiEditor/Images/transparentbg.png


+ 19 - 2
PixiEditor/Models/Controllers/BitmapOperationsUtility.cs

@@ -138,19 +138,36 @@ namespace PixiEditor.Models.Controllers
             }
             }
         }
         }
 
 
+        public void RemoveLayer(int layerIndex)
+        {
+            if (Layers.Count <= 1) return;
+
+            bool wasActive = Layers[layerIndex].IsActive;
+            Layers.RemoveAt(layerIndex);
+            if (wasActive)
+            {
+                SetActiveLayer(0);
+            }
+        }
+
         public void AddNewLayer(string name, int width, int height, bool setAsActive = true)
         public void AddNewLayer(string name, int width, int height, bool setAsActive = true)
         {
         {
             Layers.Add(new Layer(name, width, height));
             Layers.Add(new Layer(name, width, height));
             if (setAsActive)
             if (setAsActive)
             {
             {
-                ActiveLayerIndex = Layers.Count - 1;
+                SetActiveLayer(Layers.Count - 1);
             }
             }
             LayersChanged?.Invoke(this, new LayersChangedEventArgs(0, LayerAction.Add));
             LayersChanged?.Invoke(this, new LayersChangedEventArgs(0, LayerAction.Add));
         }
         }
 
 
         public void SetActiveLayer(int index)
         public void SetActiveLayer(int index)
         {
         {
-            ActiveLayerIndex = index;
+            if (ActiveLayerIndex <= Layers.Count - 1)
+            {
+                Layers[ActiveLayerIndex].IsActive = false;
+            }
+                ActiveLayerIndex = index;
+            Layers[ActiveLayerIndex].IsActive = true;
             LayersChanged?.Invoke(this, new LayersChangedEventArgs(index, LayerAction.SetActive));
             LayersChanged?.Invoke(this, new LayersChangedEventArgs(index, LayerAction.SetActive));
         }
         }
 
 

+ 12 - 1
PixiEditor/Models/Layers/Layer.cs

@@ -7,7 +7,18 @@ namespace PixiEditor.Models.Layers
     public class Layer : BasicLayer
     public class Layer : BasicLayer
     {
     {
         private WriteableBitmap _layerBitmap;
         private WriteableBitmap _layerBitmap;
-        public string Name { get; set; }
+        public string Name { get; set; }
+
+        private bool _isActive = false;
+        public bool IsActive
+        {
+            get => _isActive;
+            set
+            {
+                _isActive = value;
+                RaisePropertyChanged("IsActive");
+            }
+        }
         private bool _isVisible = true;
         private bool _isVisible = true;
         public bool IsVisible
         public bool IsVisible
         {
         {

+ 12 - 0
PixiEditor/ViewModels/ViewModelMain.cs

@@ -32,6 +32,7 @@ namespace PixiEditor.ViewModels
         public RelayCommand SetActiveLayerCommand { get; set; }
         public RelayCommand SetActiveLayerCommand { get; set; }
         public RelayCommand NewLayerCommand { get; set; }
         public RelayCommand NewLayerCommand { get; set; }
         public RelayCommand ReloadImageCommand { get; set; }
         public RelayCommand ReloadImageCommand { get; set; }
+        public RelayCommand DeleteLayerCommand { get; set; }
 
 
         private double _mouseXonCanvas;
         private double _mouseXonCanvas;
 
 
@@ -142,6 +143,7 @@ namespace PixiEditor.ViewModels
             OpenFileCommand = new RelayCommand(OpenFile);
             OpenFileCommand = new RelayCommand(OpenFile);
             SetActiveLayerCommand = new RelayCommand(SetActiveLayer);
             SetActiveLayerCommand = new RelayCommand(SetActiveLayer);
             NewLayerCommand = new RelayCommand(NewLayer, CanCreateNewLayer);
             NewLayerCommand = new RelayCommand(NewLayer, CanCreateNewLayer);
+            DeleteLayerCommand = new RelayCommand(DeleteLayer, CanDeleteLayer);
             ToolSet = new List<Tool> { new PixiTools.PenTool(), new PixiTools.FloodFill(), new PixiTools.LineTool(),
             ToolSet = new List<Tool> { new PixiTools.PenTool(), new PixiTools.FloodFill(), new PixiTools.LineTool(),
             new PixiTools.CircleTool(), new PixiTools.RectangleTool(), new PixiTools.EarserTool(), new PixiTools.BrightnessTool() };       
             new PixiTools.CircleTool(), new PixiTools.RectangleTool(), new PixiTools.EarserTool(), new PixiTools.BrightnessTool() };       
             UndoManager.SetMainRoot(this);
             UndoManager.SetMainRoot(this);
@@ -167,6 +169,16 @@ namespace PixiEditor.ViewModels
             BitmapUtility.SetActiveLayer((int)parameter);
             BitmapUtility.SetActiveLayer((int)parameter);
         }
         }
 
 
+        public void DeleteLayer(object parameter)
+        {
+            BitmapUtility.RemoveLayer((int)parameter);
+        }
+
+        public bool CanDeleteLayer(object property)
+        {
+            return BitmapUtility.Layers.Count > 1;
+        }
+
         #region Undo/Redo
         #region Undo/Redo
         /// <summary>
         /// <summary>
         /// Undo last action
         /// Undo last action

+ 21 - 12
PixiEditor/Views/MainWindow.xaml

@@ -6,6 +6,7 @@
         xmlns:vm="clr-namespace:PixiEditor.ViewModels"
         xmlns:vm="clr-namespace:PixiEditor.ViewModels"
         xmlns:vws="clr-namespace:PixiEditor.Views"
         xmlns:vws="clr-namespace:PixiEditor.Views"
         xmlns:helpers="clr-namespace:PixiEditor.Helpers"
         xmlns:helpers="clr-namespace:PixiEditor.Helpers"
+        xmlns:converters="clr-namespace:PixiEditor.Helpers.Converters"
         xmlns:behaviors="clr-namespace:PixiEditor.Helpers.Behaviours"
         xmlns:behaviors="clr-namespace:PixiEditor.Helpers.Behaviours"
         xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
         xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
         xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
         xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
@@ -17,6 +18,7 @@
         <vm:ViewModelMain x:Key="ViewModelMain"/>
         <vm:ViewModelMain x:Key="ViewModelMain"/>
         <BooleanToVisibilityConverter x:Key="BoolToVisibilityConverter"/>
         <BooleanToVisibilityConverter x:Key="BoolToVisibilityConverter"/>
         <helpers:ToolSizeToIntConverter x:Key="ToolSizeToIntConverter"/>
         <helpers:ToolSizeToIntConverter x:Key="ToolSizeToIntConverter"/>
+        <converters:BoolToColorConverter x:Key="BoolToColorConverter"/>
     </Window.Resources>
     </Window.Resources>
     <Window.InputBindings>
     <Window.InputBindings>
         <KeyBinding 
         <KeyBinding 
@@ -108,7 +110,7 @@
                 </vws:MenuButton.Item>
                 </vws:MenuButton.Item>
             </vws:MenuButton>
             </vws:MenuButton>
         </WrapPanel>
         </WrapPanel>
-        <Grid Grid.Column="1" Grid.Row="1" Background="DimGray" Margin="0,5,0,0">
+        <Grid Grid.Column="1" Grid.Row="1" Background="#303030" Margin="0,5,5,0">
             <Grid>
             <Grid>
                 <vws:MainDrawingPanel CenterOnStart="True">
                 <vws:MainDrawingPanel CenterOnStart="True">
                     <vws:MainDrawingPanel.Item>
                     <vws:MainDrawingPanel.Item>
@@ -127,7 +129,7 @@
                             <i:Interaction.Behaviors>
                             <i:Interaction.Behaviors>
                                 <behaviors:MouseBehaviour MouseX="{Binding MouseXOnCanvas, Mode=OneWayToSource}" MouseY="{Binding MouseYOnCanvas, Mode=OneWayToSource}"/>
                                 <behaviors:MouseBehaviour MouseX="{Binding MouseXOnCanvas, Mode=OneWayToSource}" MouseY="{Binding MouseYOnCanvas, Mode=OneWayToSource}"/>
                             </i:Interaction.Behaviors>
                             </i:Interaction.Behaviors>
-                            <Image Source="/Images/transparentbg.png" Height="{Binding BitmapUtility.ActiveLayer.Height}" Width="{Binding BitmapUtility.ActiveLayer.Width}" Opacity="0.2" Stretch="UniformToFill"/>
+                            <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}"/>
                             <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 ItemsSource="{Binding BitmapUtility.Layers}">
                                 <ItemsControl.ItemsPanel>
                                 <ItemsControl.ItemsPanel>
@@ -147,7 +149,7 @@
             </Grid>
             </Grid>
         </Grid>
         </Grid>
 
 
-        <StackPanel Grid.Row="1" Grid.Column="0" Margin="0,5,5,0" Background="#363434" Grid.RowSpan="2">
+        <StackPanel 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">
             <TextBox Style="{StaticResource DarkTextBoxStyle}" Margin="0,10,0,0" Text="{Binding ToolSize, Mode=TwoWay,Converter={StaticResource ToolSizeToIntConverter}}" TextAlignment="Center" MaxLength="4">
                 <i:Interaction.Behaviors>
                 <i:Interaction.Behaviors>
                     <behaviors:TextBoxNumericFinisherBehavior/>
                     <behaviors:TextBoxNumericFinisherBehavior/>
@@ -195,7 +197,7 @@
             </Button>
             </Button>
         </StackPanel>
         </StackPanel>
 
 
-        <DockPanel Grid.Column="2" Grid.Row="1">
+        <DockPanel Grid.Column="2" Grid.Row="1" Background="#404040">
             <Grid DockPanel.Dock="Top" HorizontalAlignment="Center" Width="100"  Margin="0,20,0,0" Height="100">
             <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 Height="70" Width="70" HorizontalAlignment="Left" VerticalAlignment="Top" Stroke="Black" StrokeThickness="1" Panel.ZIndex="1">
                 <Rectangle.Fill>
                 <Rectangle.Fill>
@@ -210,8 +212,8 @@
             </Rectangle>
             </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}"/>
             <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>
         </Grid>
-        
-        <xcad:DockingManager Grid.Column="2" Grid.Row="1" DockPanel.Dock="Top">
+
+            <xcad:DockingManager Grid.Column="2" Grid.Row="1" DockPanel.Dock="Top">
             <xcad:DockingManager.Style>
             <xcad:DockingManager.Style>
                 <Style TargetType="xcad:DockingManager">
                 <Style TargetType="xcad:DockingManager">
                     <Setter Property="Foreground" Value="Snow"/>
                     <Setter Property="Foreground" Value="Snow"/>
@@ -223,7 +225,7 @@
                         <xcad:LayoutAnchorable ContentId="layers" Title="Layers" CanHide="False" CanClose="False" CanAutoHide="False" CanDockAsTabbedDocument="False" CanFloat="True">
                         <xcad:LayoutAnchorable ContentId="layers" Title="Layers" CanHide="False" CanClose="False" CanAutoHide="False" CanDockAsTabbedDocument="False" CanFloat="True">
                             <StackPanel  Orientation="Vertical">
                             <StackPanel  Orientation="Vertical">
                                 <Button Command="{Binding NewLayerCommand}" Height="30" Content="New Layer" HorizontalAlignment="Stretch" Margin="5" Style="{StaticResource DarkRoundButton}"/>
                                 <Button Command="{Binding NewLayerCommand}" Height="30" Content="New Layer" HorizontalAlignment="Stretch" Margin="5" Style="{StaticResource DarkRoundButton}"/>
-                                    <ItemsControl ItemsSource="{Binding BitmapUtility.Layers}" AlternationCount="9999">
+                                    <ItemsControl ItemsSource="{Binding BitmapUtility.Layers}" x:Name="layersItemsControl" AlternationCount="9999">
                                         <ItemsControl.ItemsPanel>
                                         <ItemsControl.ItemsPanel>
                                             <ItemsPanelTemplate>
                                             <ItemsPanelTemplate>
                                                 <ui:ReversedOrderStackPanel Orientation="Vertical"/>
                                                 <ui:ReversedOrderStackPanel Orientation="Vertical"/>
@@ -231,13 +233,20 @@
                                         </ItemsControl.ItemsPanel>
                                         </ItemsControl.ItemsPanel>
                                         <ItemsControl.ItemTemplate>
                                         <ItemsControl.ItemTemplate>
                                             <DataTemplate>
                                             <DataTemplate>
-                                                <Border BorderThickness="1" BorderBrush="Gray" MinWidth="60">
-                                                <DockPanel>
-                                                    <CheckBox VerticalAlignment="Center" Command="{Binding Path=DataContext.ReloadImageCommand, RelativeSource={RelativeSource AncestorType={x:Type Window}}}" IsThreeState="False" IsChecked="{Binding Path=IsVisible}"/>
-                                                    <Button Style="{StaticResource BaseDarkButton}" Background="Transparent" FontSize="16" DockPanel.Dock="Left" Content="{Binding Name}" Command="{Binding RelativeSource={RelativeSource AncestorType={x:Type Window}}, 
+                                                <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" Content="{Binding Name}" Command="{Binding RelativeSource={RelativeSource AncestorType={x:Type Window}}, 
                             Path=DataContext.SetActiveLayerCommand}" CommandParameter="{Binding RelativeSource={RelativeSource Mode=TemplatedParent},
                             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)}"/>
                             Path=(ItemsControl.AlternationIndex)}"/>
-                                                </DockPanel>
+                                                                </ContextMenu>
+                                                            </Button.ContextMenu>
+                                                        </Button>
+                                                    </DockPanel>
                                                 </Border>
                                                 </Border>
                                             </DataTemplate>
                                             </DataTemplate>
                                     </ItemsControl.ItemTemplate>
                                     </ItemsControl.ItemTemplate>

+ 38 - 36
PixiEditor/Views/NewFilePopup.xaml

@@ -12,41 +12,43 @@
     <Window.Resources>
     <Window.Resources>
         <vm:NewFileMenuViewModel x:Key="NewFileMenuViewModel"/>
         <vm:NewFileMenuViewModel x:Key="NewFileMenuViewModel"/>
     </Window.Resources>
     </Window.Resources>
-    <Grid Background="#303030">
-        <Grid.RowDefinitions>
-            <RowDefinition Height="25*"/>
-            <RowDefinition Height="577*"/>
-        </Grid.RowDefinitions>
-        <Grid Grid.Row="0" Background="#FF2C2C2C">
-            <i:Interaction.Triggers>
-                <i:EventTrigger EventName="MouseDown">
-                    <i:InvokeCommandAction Command="{Binding DragMoveCommand}"/>
-                </i:EventTrigger>
-            </i:Interaction.Triggers>
-            <Button Width="20" Height="20" VerticalAlignment="Top" HorizontalAlignment="Right" BorderThickness="0" Command="{Binding CloseCommand}" CommandParameter="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}}">
-            <Button.Background>
-                <ImageBrush ImageSource="/Images/Cross.png" Stretch="Uniform"/>
-            </Button.Background>
-        </Button>
+    <Border BorderBrush="Black" BorderThickness="1">
+        <Grid Background="#404040">
+            <Grid.RowDefinitions>
+                <RowDefinition Height="25*"/>
+                <RowDefinition Height="577*"/>
+            </Grid.RowDefinitions>
+            <Grid Grid.Row="0" Background="#303030">
+                <i:Interaction.Triggers>
+                    <i:EventTrigger EventName="MouseDown">
+                        <i:InvokeCommandAction Command="{Binding DragMoveCommand}"/>
+                    </i:EventTrigger>
+                </i:Interaction.Triggers>
+                <Button Width="20" Height="20" VerticalAlignment="Top" HorizontalAlignment="Right" BorderThickness="0" Command="{Binding CloseCommand}" CommandParameter="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}}">
+                    <Button.Background>
+                        <ImageBrush ImageSource="/Images/Cross.png" Stretch="Uniform"/>
+                    </Button.Background>
+                </Button>
+            </Grid>
+            <StackPanel HorizontalAlignment="Center" Margin="0,50,0,0" Background="#303030" VerticalAlignment="Top" Grid.Row="1" Width="350" Height="150">
+                <DockPanel Margin="50,35,0,0">
+                    <TextBlock Height="30" Foreground="Snow" Text="Height:" TextAlignment="Center" FontSize="16" HorizontalAlignment="Center" VerticalAlignment="Center"/>
+                    <TextBox Height="30" Width="150" Style="{StaticResource DarkTextBoxStyle}" FontSize="16" HorizontalAlignment="Left" TextAlignment="Center" Margin="5,0,0,0" Text="{Binding ElementName=newFilePopup, Path=FileHeight, Mode=TwoWay}" MaxLength="4">
+                        <i:Interaction.Behaviors>
+                            <helpers:AllowableCharactersTextBoxBehavior RegularExpression="^[0-9./-]+$" MaxLength="4"/>
+                        </i:Interaction.Behaviors>
+                    </TextBox>
+                </DockPanel>
+                <DockPanel Margin="50,10,0,0">
+                    <TextBlock Height="30" Foreground="Snow" Text="Width:" TextAlignment="Center" FontSize="16" HorizontalAlignment="Center" VerticalAlignment="Center"/>
+                    <TextBox Height="30" Width="150" Style="{StaticResource DarkTextBoxStyle}" FontSize="16" HorizontalAlignment="Left" Margin="10,0,0,0" TextAlignment="Center" Text="{Binding ElementName=newFilePopup, Path=FileWidth, Mode=TwoWay}" MaxLength="4">
+                        <i:Interaction.Behaviors>
+                            <helpers:AllowableCharactersTextBoxBehavior RegularExpression="^[0-9./-]+$" MaxLength="4"/>
+                        </i:Interaction.Behaviors>
+                    </TextBox>
+                </DockPanel>
+            </StackPanel>
+            <Button VerticalAlignment="Bottom" HorizontalAlignment="Right" FontSize="20" Height="30" Width="60" Style="{StaticResource DarkRoundButton}" Content="OK" Margin="0,0,10,10" Grid.Row="1" Command="{Binding OkCommand}" CommandParameter="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}}"/>
         </Grid>
         </Grid>
-        <StackPanel HorizontalAlignment="Center" Margin="0,50,0,0" Background="#FF2E2E2E" VerticalAlignment="Top" Grid.Row="1" Width="350" Height="150">
-            <DockPanel Margin="50,35,0,0">
-            <TextBlock Height="30" Foreground="Snow" Text="Height:" TextAlignment="Center" FontSize="16" HorizontalAlignment="Center" VerticalAlignment="Center"/>
-                <TextBox Height="30" Width="150" Style="{StaticResource DarkTextBoxStyle}" FontSize="16" HorizontalAlignment="Left" TextAlignment="Center" Margin="5,0,0,0" Text="{Binding ElementName=newFilePopup, Path=FileHeight, Mode=TwoWay}" MaxLength="4">
-                    <i:Interaction.Behaviors>
-                        <helpers:AllowableCharactersTextBoxBehavior RegularExpression="^[0-9./-]+$" MaxLength="4"/>
-                    </i:Interaction.Behaviors>
-                </TextBox>
-            </DockPanel>
-            <DockPanel Margin="50,10,0,0">
-                <TextBlock Height="30" Foreground="Snow" Text="Width:" TextAlignment="Center" FontSize="16" HorizontalAlignment="Center" VerticalAlignment="Center"/>
-                <TextBox Height="30" Width="150" Style="{StaticResource DarkTextBoxStyle}" FontSize="16" HorizontalAlignment="Left" Margin="10,0,0,0" TextAlignment="Center" Text="{Binding ElementName=newFilePopup, Path=FileWidth, Mode=TwoWay}" MaxLength="4">
-                    <i:Interaction.Behaviors>
-                        <helpers:AllowableCharactersTextBoxBehavior RegularExpression="^[0-9./-]+$" MaxLength="4"/>
-                    </i:Interaction.Behaviors>
-                </TextBox>
-            </DockPanel>
-        </StackPanel>
-        <Button VerticalAlignment="Bottom" HorizontalAlignment="Right" FontSize="20" Height="30" Width="60" Style="{StaticResource DarkRoundButton}" Content="OK" Margin="0,0,10,10" Grid.Row="1" Command="{Binding OkCommand}" CommandParameter="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}}"/>
-    </Grid>
+    </Border>
 </Window>
 </Window>