User Tools

Site Tools


notes:uwp:layout

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision Both sides next revision
notes:uwp:layout [2017/02/16]
admin [StackPanel]
notes:uwp:layout [2017/02/16]
admin [StackPanel]
Line 538: Line 538:
 </code> </code>
  
 +Example: Dock buttons to the right-bottom corner using the //StackPanel//'s alignment properties:
 +
 +<code xml>
 +<Page x:Class="TestApp.MainPage"
 +      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
 +      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
 +      xmlns:local="using:TestApp">
 +    <Grid>
 +        <Grid.ColumnDefinitions>
 +            <ColumnDefinition Width="Auto" />
 +            <ColumnDefinition />
 +        </Grid.ColumnDefinitions>
 +
 +        <Grid.RowDefinitions>
 +            <RowDefinition Height="Auto" />
 +            <RowDefinition Height="Auto" />
 +            <RowDefinition />
 +        </Grid.RowDefinitions>
 +
 +        <TextBlock Text="First Name" VerticalAlignment="Center" Margin="8" />
 +        <TextBox Grid.Column="1" Margin="8" />
 +
 +        <TextBlock Grid.Row="1" Text="Last Name" VerticalAlignment="Center" Margin="8" />
 +        <TextBox Grid.Row="1" Grid.Column="1" Margin="8" />
 +
 +        <StackPanel Orientation="Horizontal"
 +                    HorizontalAlignment="Right"
 +                    VerticalAlignment="Bottom"
 +                    Grid.Row="2" 
 +                    Grid.ColumnSpan="2">
 +            <Button Content="Save" Width="80" Margin="8" />
 +            <Button Content="Cancel" Width="80" Margin="8" />
 +        </StackPanel>
 +    </Grid>
 +</Page>
 +</code>
  
 ====UseLayoutRounding==== ====UseLayoutRounding====
notes/uwp/layout.txt ยท Last modified: 2020/08/26 (external edit)