|
@@ -1,14 +1,16 @@
|
|
|
<controls:UserControl x:Class="PixiEditor.AvaloniaUI.Views.Input.AnchorPointPicker"
|
|
|
- x:ClassModifier="internal"
|
|
|
- xmlns="https://github.com/avaloniaui"
|
|
|
- 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:views="clr-namespace:PixiEditor.Views"
|
|
|
- xmlns:ui="clr-namespace:PixiEditor.Extensions.UI;assembly=PixiEditor.Extensions"
|
|
|
- xmlns:controls="https://github.com/avaloniaui"
|
|
|
- mc:Ignorable="d"
|
|
|
- d:DesignHeight="78" d:DesignWidth="78">
|
|
|
+ x:ClassModifier="internal"
|
|
|
+ xmlns="https://github.com/avaloniaui"
|
|
|
+ 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:views="clr-namespace:PixiEditor.Views"
|
|
|
+ xmlns:ui="clr-namespace:PixiEditor.Extensions.UI;assembly=PixiEditor.Extensions"
|
|
|
+ xmlns:controls="https://github.com/avaloniaui"
|
|
|
+ xmlns:enums="clr-namespace:PixiEditor.ChangeableDocument.Enums;assembly=PixiEditor.ChangeableDocument"
|
|
|
+ xmlns:converters="clr-namespace:PixiEditor.AvaloniaUI.Helpers.Converters"
|
|
|
+ mc:Ignorable="d" Name="picker"
|
|
|
+ d:DesignHeight="78" d:DesignWidth="78">
|
|
|
<Grid Name="container">
|
|
|
<Grid.RowDefinitions>
|
|
|
<RowDefinition Height="26" />
|
|
@@ -20,32 +22,135 @@
|
|
|
<ColumnDefinition Width="26" />
|
|
|
<ColumnDefinition Width="26" />
|
|
|
</Grid.ColumnDefinitions>
|
|
|
- <ToggleButton IsChecked="True" IsCheckedChanged="ToggleButton_Checked" PointerPressed="ToggleButton_Click" Margin="0.25"
|
|
|
- Classes="AnchorPointToggleButtonStyle" ui:Translator.TooltipKey="TOP_LEFT" Grid.Row="0" Name="topLeft"
|
|
|
- Grid.Column="0" CornerRadius="5,0,0,0"/>
|
|
|
- <ToggleButton IsCheckedChanged="ToggleButton_Checked" PointerPressed="ToggleButton_Click" Margin="0.25"
|
|
|
- Classes="AnchorPointToggleButtonStyle" Grid.Row="0" ui:Translator.TooltipKey="TOP_CENTER" Name="topCenter"
|
|
|
- Grid.Column="1" />
|
|
|
- <ToggleButton IsCheckedChanged="ToggleButton_Checked" PointerPressed="ToggleButton_Click" Margin="0.25" Name="topRight"
|
|
|
- Classes="AnchorPointToggleButtonStyle" ui:Translator.TooltipKey="TOP_RIGHT" CornerRadius="0,5,0,0" Grid.Row="0"
|
|
|
- Grid.Column="2" />
|
|
|
- <ToggleButton IsCheckedChanged="ToggleButton_Checked" PointerPressed="ToggleButton_Click" Margin="0.25"
|
|
|
- Classes="AnchorPointToggleButtonStyle" Grid.Row="1" ui:Translator.TooltipKey="MIDDLE_LEFT" Name="middleLeft"
|
|
|
- Grid.Column="0" />
|
|
|
- <ToggleButton IsCheckedChanged="ToggleButton_Checked" PointerPressed="ToggleButton_Click" Margin="0.25"
|
|
|
+ <ToggleButton Click="ToggleButton_Click" Margin="0.25"
|
|
|
+ Classes="AnchorPointToggleButtonStyle" ui:Translator.TooltipKey="TOP_LEFT" Grid.Row="0"
|
|
|
+ Name="topLeft"
|
|
|
+ Grid.Column="0" CornerRadius="5,0,0,0">
|
|
|
+ <ToggleButton.IsChecked>
|
|
|
+ <MultiBinding Converter="{converters:AnchorPointVisibilityConverter}">
|
|
|
+ <Binding ElementName="picker" Path="AnchorPoint" />
|
|
|
+ <Binding>
|
|
|
+ <Binding.Source>
|
|
|
+ <enums:ResizeAnchor>TopLeft</enums:ResizeAnchor>
|
|
|
+ </Binding.Source>
|
|
|
+ </Binding>
|
|
|
+ </MultiBinding>
|
|
|
+ </ToggleButton.IsChecked>
|
|
|
+ </ToggleButton>
|
|
|
+ <ToggleButton Click="ToggleButton_Click" Margin="0.25"
|
|
|
+ Classes="AnchorPointToggleButtonStyle" Grid.Row="0" ui:Translator.TooltipKey="TOP_CENTER"
|
|
|
+ Name="topCenter"
|
|
|
+ Grid.Column="1">
|
|
|
+ <ToggleButton.IsChecked>
|
|
|
+ <MultiBinding Converter="{converters:AnchorPointVisibilityConverter}">
|
|
|
+ <Binding ElementName="picker" Path="AnchorPoint" />
|
|
|
+ <Binding>
|
|
|
+ <Binding.Source>
|
|
|
+ <enums:ResizeAnchor>Top</enums:ResizeAnchor>
|
|
|
+ </Binding.Source>
|
|
|
+ </Binding>
|
|
|
+ </MultiBinding>
|
|
|
+ </ToggleButton.IsChecked>
|
|
|
+ </ToggleButton>
|
|
|
+ <ToggleButton Click="ToggleButton_Click" Margin="0.25" Name="topRight"
|
|
|
+ Classes="AnchorPointToggleButtonStyle" ui:Translator.TooltipKey="TOP_RIGHT"
|
|
|
+ CornerRadius="0,5,0,0" Grid.Row="0"
|
|
|
+ Grid.Column="2">
|
|
|
+ <ToggleButton.IsChecked>
|
|
|
+ <MultiBinding Converter="{converters:AnchorPointVisibilityConverter}">
|
|
|
+ <Binding ElementName="picker" Path="AnchorPoint" />
|
|
|
+ <Binding>
|
|
|
+ <Binding.Source>
|
|
|
+ <enums:ResizeAnchor>TopRight</enums:ResizeAnchor>
|
|
|
+ </Binding.Source>
|
|
|
+ </Binding>
|
|
|
+ </MultiBinding>
|
|
|
+ </ToggleButton.IsChecked>
|
|
|
+ </ToggleButton>
|
|
|
+ <ToggleButton Click="ToggleButton_Click" Margin="0.25"
|
|
|
+ Classes="AnchorPointToggleButtonStyle" Grid.Row="1" ui:Translator.TooltipKey="MIDDLE_LEFT"
|
|
|
+ Name="middleLeft"
|
|
|
+ Grid.Column="0">
|
|
|
+ <ToggleButton.IsChecked>
|
|
|
+ <MultiBinding Converter="{converters:AnchorPointVisibilityConverter}">
|
|
|
+ <Binding ElementName="picker" Path="AnchorPoint" />
|
|
|
+ <Binding>
|
|
|
+ <Binding.Source>
|
|
|
+ <enums:ResizeAnchor>Left</enums:ResizeAnchor>
|
|
|
+ </Binding.Source>
|
|
|
+ </Binding>
|
|
|
+ </MultiBinding>
|
|
|
+ </ToggleButton.IsChecked>
|
|
|
+ </ToggleButton>
|
|
|
+ <ToggleButton Click="ToggleButton_Click" Margin="0.25"
|
|
|
Classes="AnchorPointToggleButtonStyle" Grid.Row="1" Grid.Column="1" Name="middleCenter"
|
|
|
- ui:Translator.TooltipKey="MIDDLE_CENTER" />
|
|
|
- <ToggleButton IsCheckedChanged="ToggleButton_Checked" PointerPressed="ToggleButton_Click" Margin="0.25"
|
|
|
+ ui:Translator.TooltipKey="MIDDLE_CENTER">
|
|
|
+ <ToggleButton.IsChecked>
|
|
|
+ <MultiBinding Converter="{converters:AnchorPointVisibilityConverter}">
|
|
|
+ <Binding ElementName="picker" Path="AnchorPoint" />
|
|
|
+ <Binding>
|
|
|
+ <Binding.Source>
|
|
|
+ <enums:ResizeAnchor>Center</enums:ResizeAnchor>
|
|
|
+ </Binding.Source>
|
|
|
+ </Binding>
|
|
|
+ </MultiBinding>
|
|
|
+ </ToggleButton.IsChecked>
|
|
|
+ </ToggleButton>
|
|
|
+ <ToggleButton Click="ToggleButton_Click" Margin="0.25"
|
|
|
Classes="AnchorPointToggleButtonStyle" Grid.Row="1" Grid.Column="2" Name="middleRight"
|
|
|
- ui:Translator.TooltipKey="MIDDLE_RIGHT" />
|
|
|
- <ToggleButton IsCheckedChanged="ToggleButton_Checked" PointerPressed="ToggleButton_Click" Margin="0.25"
|
|
|
+ ui:Translator.TooltipKey="MIDDLE_RIGHT">
|
|
|
+ <ToggleButton.IsChecked>
|
|
|
+ <MultiBinding Converter="{converters:AnchorPointVisibilityConverter}">
|
|
|
+ <Binding ElementName="picker" Path="AnchorPoint" />
|
|
|
+ <Binding>
|
|
|
+ <Binding.Source>
|
|
|
+ <enums:ResizeAnchor>Right</enums:ResizeAnchor>
|
|
|
+ </Binding.Source>
|
|
|
+ </Binding>
|
|
|
+ </MultiBinding>
|
|
|
+ </ToggleButton.IsChecked>
|
|
|
+ </ToggleButton>
|
|
|
+ <ToggleButton Click="ToggleButton_Click" Margin="0.25"
|
|
|
Classes="AnchorPointToggleButtonStyle" Grid.Row="2" Grid.Column="0" Name="bottomLeft"
|
|
|
- ui:Translator.TooltipKey="BOTTOM_LEFT" CornerRadius="0,0,0,5" />
|
|
|
- <ToggleButton IsCheckedChanged="ToggleButton_Checked" PointerPressed="ToggleButton_Click" Margin="0.25"
|
|
|
+ ui:Translator.TooltipKey="BOTTOM_LEFT" CornerRadius="0,0,0,5">
|
|
|
+ <ToggleButton.IsChecked>
|
|
|
+ <MultiBinding Converter="{converters:AnchorPointVisibilityConverter}">
|
|
|
+ <Binding ElementName="picker" Path="AnchorPoint" />
|
|
|
+ <Binding>
|
|
|
+ <Binding.Source>
|
|
|
+ <enums:ResizeAnchor>BottomLeft</enums:ResizeAnchor>
|
|
|
+ </Binding.Source>
|
|
|
+ </Binding>
|
|
|
+ </MultiBinding>
|
|
|
+ </ToggleButton.IsChecked>
|
|
|
+ </ToggleButton>
|
|
|
+ <ToggleButton Click="ToggleButton_Click" Margin="0.25"
|
|
|
Classes="AnchorPointToggleButtonStyle" Grid.Row="2" Grid.Column="1" Name="bottomCenter"
|
|
|
- ui:Translator.TooltipKey="BOTTOM_CENTER" />
|
|
|
- <ToggleButton IsCheckedChanged="ToggleButton_Checked" PointerPressed="ToggleButton_Click" Margin="0.25" Name="bottomRight"
|
|
|
+ ui:Translator.TooltipKey="BOTTOM_CENTER">
|
|
|
+ <ToggleButton.IsChecked>
|
|
|
+ <MultiBinding Converter="{converters:AnchorPointVisibilityConverter}">
|
|
|
+ <Binding ElementName="picker" Path="AnchorPoint" />
|
|
|
+ <Binding>
|
|
|
+ <Binding.Source>
|
|
|
+ <enums:ResizeAnchor>Bottom</enums:ResizeAnchor>
|
|
|
+ </Binding.Source>
|
|
|
+ </Binding>
|
|
|
+ </MultiBinding>
|
|
|
+ </ToggleButton.IsChecked>
|
|
|
+ </ToggleButton>
|
|
|
+ <ToggleButton Click="ToggleButton_Click" Margin="0.25" Name="bottomRight"
|
|
|
Classes="AnchorPointToggleButtonStyle" CornerRadius="0,0,5,0" Grid.Row="2" Grid.Column="2"
|
|
|
- ui:Translator.TooltipKey="BOTTOM_RIGHT" />
|
|
|
+ ui:Translator.TooltipKey="BOTTOM_RIGHT">
|
|
|
+ <ToggleButton.IsChecked>
|
|
|
+ <MultiBinding Converter="{converters:AnchorPointVisibilityConverter}">
|
|
|
+ <Binding ElementName="picker" Path="AnchorPoint" />
|
|
|
+ <Binding>
|
|
|
+ <Binding.Source>
|
|
|
+ <enums:ResizeAnchor>BottomRight</enums:ResizeAnchor>
|
|
|
+ </Binding.Source>
|
|
|
+ </Binding>
|
|
|
+ </MultiBinding>
|
|
|
+ </ToggleButton.IsChecked>
|
|
|
+ </ToggleButton>
|
|
|
</Grid>
|
|
|
-</controls:UserControl>
|
|
|
+</controls:UserControl>
|