-
Notifications
You must be signed in to change notification settings - Fork 743
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(grid): Added a new sample that is dynamically updating Grid posi…
…tioning of an element.
- Loading branch information
1 parent
96b8086
commit 18aa879
Showing
6 changed files
with
97 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
66 changes: 66 additions & 0 deletions
66
...esApp/UITests.Shared/Windows_UI_Xaml_Controls/GridTestsControl/Grid_DynamicRowColumn.xaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
<Page | ||
x:Class="UITests.Windows_UI_Xaml_Controls.GridTestsControl.Grid_DynamicRowColumn" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
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" | ||
mc:Ignorable="d" | ||
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"> | ||
|
||
<StackPanel Spacing="4"> | ||
<StackPanel Orientation="Horizontal"> | ||
<TextBlock Width="120">Column Widths</TextBlock> | ||
<Slider Minimum="0" Maximum="100" Value="20" x:Name="width" Width="200" /> | ||
<TextBlock Text="{Binding Value, ElementName=width}" x:Name="widths" /> | ||
</StackPanel> | ||
|
||
<StackPanel Orientation="Horizontal"> | ||
<TextBlock Width="120">Column Heights</TextBlock> | ||
<Slider Minimum="0" Maximum="100" Value="20" x:Name="height" Width="200" /> | ||
<TextBlock Text="{Binding Value, ElementName=height}" x:Name="heights" /> | ||
</StackPanel> | ||
|
||
<StackPanel Orientation="Horizontal"> | ||
<TextBlock Width="120">Column</TextBlock> | ||
<Slider Minimum="0" Maximum="4" Value="2" x:Name="col" Width="200" /> | ||
</StackPanel> | ||
|
||
<StackPanel Orientation="Horizontal"> | ||
<TextBlock Width="120">Row</TextBlock> | ||
<Slider Minimum="0" Maximum="4" Value="2" x:Name="row" Width="200" /> | ||
</StackPanel> | ||
|
||
<StackPanel Orientation="Horizontal"> | ||
<TextBlock Width="120">Column Span</TextBlock> | ||
<Slider Minimum="1" Maximum="4" Value="2" x:Name="colspan" Width="200" /> | ||
</StackPanel> | ||
|
||
<StackPanel Orientation="Horizontal"> | ||
<TextBlock Width="120">Row Span</TextBlock> | ||
<Slider Minimum="1" Maximum="4" Value="2" x:Name="rowspan" Width="200" /> | ||
</StackPanel> | ||
|
||
<Grid Margin="20" RowSpacing="5" ColumnSpacing="5" Background="Blue" HorizontalAlignment="Left" x:Name="sut"> | ||
<Grid.ColumnDefinitions> | ||
<ColumnDefinition Width="{Binding Text, ElementName=widths}" /> | ||
<ColumnDefinition Width="{Binding Text, ElementName=widths}" /> | ||
<ColumnDefinition Width="{Binding Text, ElementName=widths}" /> | ||
<ColumnDefinition Width="{Binding Text, ElementName=widths}" /> | ||
<ColumnDefinition Width="{Binding Text, ElementName=widths}" /> | ||
</Grid.ColumnDefinitions> | ||
<Grid.RowDefinitions> | ||
<RowDefinition Height="{Binding Text, ElementName=heights}" /> | ||
<RowDefinition Height="{Binding Text, ElementName=heights}" /> | ||
<RowDefinition Height="{Binding Text, ElementName=heights}" /> | ||
<RowDefinition Height="{Binding Text, ElementName=heights}" /> | ||
<RowDefinition Height="{Binding Text, ElementName=heights}" /> | ||
</Grid.RowDefinitions> | ||
|
||
<Rectangle Fill="Red" | ||
Grid.Column="{Binding Value, ElementName=col}" | ||
Grid.Row="{Binding Value, ElementName=row}" | ||
Grid.ColumnSpan="{Binding Value, ElementName=colspan}" | ||
Grid.RowSpan="{Binding Value, ElementName=rowspan}" /> | ||
</Grid> | ||
</StackPanel> | ||
</Page> |
14 changes: 14 additions & 0 deletions
14
...pp/UITests.Shared/Windows_UI_Xaml_Controls/GridTestsControl/Grid_DynamicRowColumn.xaml.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
using Windows.UI.Xaml.Controls; | ||
using Uno.UI.Samples.Controls; | ||
|
||
namespace UITests.Windows_UI_Xaml_Controls.GridTestsControl | ||
{ | ||
[Sample] | ||
public sealed partial class Grid_DynamicRowColumn : Page | ||
{ | ||
public Grid_DynamicRowColumn() | ||
{ | ||
this.InitializeComponent(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters