53 lines
2.9 KiB
XML
53 lines
2.9 KiB
XML
<UserControl x:Class="AuroraUIComponent.UserControls.UCMagnification"
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
xmlns:local="clr-namespace:AuroraUIComponent.UserControls"
|
|
xmlns:uiconverter="clr-namespace:AuroraUIComponent.UIConverter"
|
|
d:DataContext="{d:DesignInstance Type=local:UCMagnification}"
|
|
mc:Ignorable="d"
|
|
d:DesignHeight="500" d:DesignWidth="800">
|
|
<UserControl.Resources>
|
|
<uiconverter:MinConverter x:Key="convMin"/>
|
|
</UserControl.Resources>
|
|
<Grid Background="DarkBlue">
|
|
<Rectangle x:Name="Rect">
|
|
<Rectangle.Width>
|
|
<MultiBinding Converter="{StaticResource convMin}">
|
|
<Binding Path="ActualHeight" RelativeSource="{RelativeSource AncestorType={x:Type Window}}"/>
|
|
<Binding Path="ActualWidth" RelativeSource="{RelativeSource AncestorType={x:Type Window}}"/>
|
|
</MultiBinding>
|
|
</Rectangle.Width>
|
|
<Rectangle.Height>
|
|
<MultiBinding Converter="{StaticResource convMin}">
|
|
<Binding Path="ActualHeight" RelativeSource="{RelativeSource AncestorType={x:Type Window}}"/>
|
|
<Binding Path="ActualWidth" RelativeSource="{RelativeSource AncestorType={x:Type Window}}"/>
|
|
</MultiBinding>
|
|
</Rectangle.Height>
|
|
</Rectangle>
|
|
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="5" Panel.ZIndex="1">
|
|
<TextBlock x:Name="TextCaption"/>
|
|
</StackPanel>
|
|
<StackPanel>
|
|
<UniformGrid x:Name="RatioControl" HorizontalAlignment="Right" VerticalAlignment="Top" Height="30" Rows="1">
|
|
<Button Content="x1" Width="50" Click="Button_Click_x1"/>
|
|
<Button Content="x2" Click="Button_Click_x2"/>
|
|
<Button Content="x5" Click="Button_Click_x5"/>
|
|
<Button Content="x8" Click="Button_Click_x8"/>
|
|
<Button Content="x10" Click="Button_Click_x10"/>
|
|
<Button Content="x20" Click="Button_Click_x20"/>
|
|
</UniformGrid>
|
|
<Grid Width="{Binding ActualWidth, ElementName=RatioControl}" HorizontalAlignment="Right">
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="50"/>
|
|
<ColumnDefinition Width="1*"/>
|
|
</Grid.ColumnDefinitions>
|
|
<TextBlock x:Name="TextRatio"/>
|
|
<Slider Grid.Column="1" x:Name="RatioSlider"
|
|
ValueChanged="Slider_ValueChanged" PreviewMouseUp="RatioSlider_PreviewMouseUp" Minimum="1" Maximum="20" />
|
|
</Grid>
|
|
</StackPanel>
|
|
</Grid>
|
|
</UserControl>
|