Browse Source

Add LayoutTransformControl

pull/9012/head
Wiesław Šoltés 4 years ago
parent
commit
db35037dfb
  1. 66
      samples/ControlCatalog/Pages/AdornerLayerPage.xaml

66
samples/ControlCatalog/Pages/AdornerLayerPage.xaml

@ -6,25 +6,49 @@
d:DesignHeight="800" d:DesignHeight="800"
d:DesignWidth="400" d:DesignWidth="400"
mc:Ignorable="d"> mc:Ignorable="d">
<Grid RowDefinitions="100,42,*" ColumnDefinitions="50,200,*">
<Button Content="Adorned Button" <DockPanel>
HorizontalAlignment="Stretch" HorizontalContentAlignment="Center" <Grid ColumnDefinitions="Auto,*" RowDefinitions="Auto" Margin="16" DockPanel.Dock="Top">
VerticalContentAlignment="Center" VerticalAlignment="Stretch" <TextBlock Grid.Column="0" Grid.Row="0">Rotation</TextBlock>
Grid.Row="1" Grid.Column="1"> <Slider Name="rotation" Maximum="360" Grid.Column="1" Grid.Row="0"/>
<AdornerLayer.Adorner> </Grid>
<Canvas x:Name="AdornerCanvas"
HorizontalAlignment="Stretch" <Grid ColumnDefinitions="24,Auto,24"
VerticalAlignment="Stretch" RowDefinitions="24,Auto,24"
Background="Cyan" HorizontalAlignment="Center"
IsHitTestVisible="False" VerticalAlignment="Center">
Opacity="0.3" <Border Background="{DynamicResource SystemAccentColor}" Grid.Column="1" Grid.Row="0"/>
IsVisible="True"> <Border Background="{DynamicResource SystemAccentColor}" Grid.Column="0" Grid.Row="1"/>
<Line StartPoint="-10000,0" EndPoint="10000,0" Stroke="Cyan" StrokeThickness="1" /> <Border Background="{DynamicResource SystemAccentColor}" Grid.Column="2" Grid.Row="1"/>
<Line StartPoint="-10000,42" EndPoint="10000,42" Stroke="Cyan" StrokeThickness="1" /> <Border Background="{DynamicResource SystemAccentColor}" Grid.Column="1" Grid.Row="2"/>
<Line StartPoint="0,-10000" EndPoint="0,10000" Stroke="Cyan" StrokeThickness="1" />
<Line StartPoint="200,-10000" EndPoint="200,10000" Stroke="Cyan" StrokeThickness="1" /> <LayoutTransformControl Name="layoutTransform" Grid.Column="1" Grid.Row="1">
</Canvas> <LayoutTransformControl.LayoutTransform>
</AdornerLayer.Adorner> <RotateTransform Angle="{Binding #rotation.Value}"/>
</Button> </LayoutTransformControl.LayoutTransform>
</Grid>
<Button Content="Adorned Button"
HorizontalAlignment="Stretch" HorizontalContentAlignment="Center"
VerticalContentAlignment="Center" VerticalAlignment="Stretch"
Width="200" Height="42">
<AdornerLayer.Adorner>
<Canvas x:Name="AdornerCanvas"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
Background="Cyan"
IsHitTestVisible="False"
Opacity="0.3"
IsVisible="True">
<Line StartPoint="-10000,0" EndPoint="10000,0" Stroke="Cyan" StrokeThickness="1" />
<Line StartPoint="-10000,42" EndPoint="10000,42" Stroke="Cyan" StrokeThickness="1" />
<Line StartPoint="0,-10000" EndPoint="0,10000" Stroke="Cyan" StrokeThickness="1" />
<Line StartPoint="200,-10000" EndPoint="200,10000" Stroke="Cyan" StrokeThickness="1" />
</Canvas>
</AdornerLayer.Adorner>
</Button>
</LayoutTransformControl>
</Grid>
</DockPanel>
</UserControl> </UserControl>

Loading…
Cancel
Save