|
@@ -4,8 +4,10 @@
|
|
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
|
xmlns:local="clr-namespace:PixiEditor.Views"
|
|
|
+ xmlns:converters="clr-namespace:PixiEditor.Helpers.Converters"
|
|
|
+ xmlns:enums="clr-namespace:PixiEditor.Models.Enums"
|
|
|
mc:Ignorable="d"
|
|
|
- d:DesignHeight="110" d:DesignWidth="215" Name="uc">
|
|
|
+ d:DesignHeight="220" d:DesignWidth="290" Name="uc">
|
|
|
<UserControl.Resources>
|
|
|
<Style TargetType="local:SizeInput">
|
|
|
<Setter Property="HorizontalAlignment" Value="Left"/>
|
|
@@ -17,30 +19,70 @@
|
|
|
<Setter Property="Height" Value="30"/>
|
|
|
</Style>
|
|
|
</UserControl.Resources>
|
|
|
- <StackPanel Background="{StaticResource MainColor}">
|
|
|
- <DockPanel Margin="5,10,0,0" HorizontalAlignment="Center" VerticalAlignment="Center">
|
|
|
+ <DockPanel Background="{StaticResource MainColor}">
|
|
|
+ <DockPanel DockPanel.Dock="Top" Margin="5,10,0,0" HorizontalAlignment="Stretch" VerticalAlignment="Center"
|
|
|
+ Visibility="{Binding SizeUnitSelectionVisibility, ElementName=uc}">
|
|
|
+ <StackPanel x:Name="UnitSelectionPanel" Orientation="Vertical" >
|
|
|
+ <StackPanel Orientation="Horizontal" >
|
|
|
+ <RadioButton x:Name="PercentageRb"
|
|
|
+ Foreground="White"
|
|
|
+ FontSize="16"
|
|
|
+ GroupName="Unit"
|
|
|
+ Checked="PercentageRb_Checked"
|
|
|
+ IsChecked="{Binding Path=SelectedUnit,
|
|
|
+ ElementName=uc,
|
|
|
+ Converter={converters:EnumBooleanConverter},
|
|
|
+ ConverterParameter=Percentage
|
|
|
+ }"
|
|
|
+ >Percentage:</RadioButton>
|
|
|
+ <local:SizeInput x:Name="PercentageSizePicker"
|
|
|
+ Unit="Percentage"
|
|
|
+ Width ="135"
|
|
|
+ Size="{Binding Path=ChosenPercentageSize, ElementName=uc, Mode=TwoWay}"
|
|
|
+ />
|
|
|
+ </StackPanel>
|
|
|
+ <Separator Margin="10,20,10,10" Background="{StaticResource AccentColor}" Height="1" />
|
|
|
+ <RadioButton x:Name="AbsoluteRb"
|
|
|
+ Foreground="White"
|
|
|
+ FontSize="16"
|
|
|
+ GroupName="Unit"
|
|
|
+ Checked="AbsoluteRb_Checked"
|
|
|
+ IsChecked="{Binding Path=SelectedUnit,
|
|
|
+ ElementName=uc,
|
|
|
+ Converter={converters:EnumBooleanConverter},
|
|
|
+ ConverterParameter=Pixel}"
|
|
|
+ >Absolute:</RadioButton>
|
|
|
+ </StackPanel>
|
|
|
+ </DockPanel>
|
|
|
+
|
|
|
+ <DockPanel DockPanel.Dock="Top" Margin="5,10,0,0" HorizontalAlignment="Center" VerticalAlignment="Center">
|
|
|
<TextBlock Height="20" Foreground="Snow" Text="Width:" TextAlignment="Center" FontSize="16"
|
|
|
HorizontalAlignment="Center" VerticalAlignment="Center" />
|
|
|
<local:SizeInput x:Name="WidthPicker"
|
|
|
- IsEnabled="{Binding EditingEnabled, ElementName=uc}"
|
|
|
PreserveAspectRatio="{Binding Path=IsChecked, ElementName=aspectRatio}"
|
|
|
AspectRatioValue="{Binding Path=ChosenHeight, ElementName=uc}"
|
|
|
AspectRatioControl="{Binding ElementName=HeightPicker}"
|
|
|
NextControl="{Binding ElementName=HeightPicker}"
|
|
|
- Size="{Binding Path=ChosenWidth, ElementName=uc, Mode=TwoWay}" />
|
|
|
+ Size="{Binding Path=ChosenWidth, ElementName=uc, Mode=TwoWay}"
|
|
|
+ Unit="Pixel"
|
|
|
+ />
|
|
|
</DockPanel>
|
|
|
- <DockPanel Margin="5,10,0,0" HorizontalAlignment="Center" VerticalAlignment="Center">
|
|
|
+ <DockPanel DockPanel.Dock="Top" Margin="5,10,0,0" HorizontalAlignment="Center" VerticalAlignment="Center">
|
|
|
<TextBlock Height="20" Foreground="Snow" Text="Height:" TextAlignment="Center" FontSize="16"
|
|
|
HorizontalAlignment="Center" VerticalAlignment="Center" />
|
|
|
<local:SizeInput x:Name="HeightPicker"
|
|
|
- IsEnabled="{Binding EditingEnabled, ElementName=uc}"
|
|
|
Margin="5,0,0,0"
|
|
|
PreserveAspectRatio="{Binding Path=IsChecked, ElementName=aspectRatio}"
|
|
|
AspectRatioValue="{Binding Path=ChosenWidth, ElementName=uc}"
|
|
|
AspectRatioControl="{Binding ElementName=WidthPicker}"
|
|
|
NextControl="{Binding NextControl, ElementName=uc}"
|
|
|
- Size="{Binding ChosenHeight, ElementName=uc, Mode=TwoWay}" />
|
|
|
+ Size="{Binding ChosenHeight, ElementName=uc, Mode=TwoWay}"
|
|
|
+ Unit="Pixel"
|
|
|
+ IsEnabled="{Binding IsChecked, ElementName=PercentageRb}"
|
|
|
+ />
|
|
|
+ </DockPanel>
|
|
|
+ <DockPanel DockPanel.Dock="Top">
|
|
|
+ <CheckBox Name="aspectRatio" Content="Preserve aspect ratio" Foreground="White" HorizontalAlignment="Left" Margin="50,10,0,0" />
|
|
|
</DockPanel>
|
|
|
- <CheckBox Name="aspectRatio" Content="Preserve aspect ratio" Foreground="White" HorizontalAlignment="Left" Margin="50,10,0,0" />
|
|
|
- </StackPanel>
|
|
|
+ </DockPanel>
|
|
|
</UserControl>
|