-
Notifications
You must be signed in to change notification settings - Fork 742
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(background_sizing): Added support for the BackgroundSizing Depen…
…dencyProperty + a sample for it.
- Loading branch information
1 parent
d712ce4
commit c3f8315
Showing
18 changed files
with
328 additions
and
31 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
220 changes: 220 additions & 0 deletions
220
...plesApp/UITests.Shared/Windows_UI_Xaml/FrameworkElementTests/DynamicBackgroundSizing.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,220 @@ | ||
<Page | ||
x:Class="UITests.Windows_UI_Xaml.FrameworkElementTests.DynamicBackgroundSizing" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:local="using:UITests.Windows_UI_Xaml.FrameworkElementTests" | ||
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="5" Margin="15"> | ||
<TextBlock FontSize="18"> | ||
This sample illustrate the difference background sizing options | ||
</TextBlock> | ||
|
||
<StackPanel Orientation="Horizontal" Spacing="10"> | ||
<ComboBox x:Name="dynamic" Header="Dynamic Sizing:"> | ||
<ComboBoxItem IsSelected="True">InnerBorderEdge</ComboBoxItem> | ||
<ComboBoxItem>OuterBorderEdge</ComboBoxItem> | ||
</ComboBox> | ||
<ComboBox x:Name="radius" Header="CornerRadius:"> | ||
<ComboBoxItem IsSelected="True">0</ComboBoxItem> | ||
<ComboBoxItem>10</ComboBoxItem> | ||
<ComboBoxItem>20</ComboBoxItem> | ||
</ComboBox> | ||
</StackPanel> | ||
<Grid ColumnSpacing="4" RowSpacing="4"> | ||
<Grid.RowDefinitions> | ||
<RowDefinition Height="Auto" /> | ||
<RowDefinition Height="50" /> | ||
<RowDefinition Height="50" /> | ||
<RowDefinition Height="50" /> | ||
<RowDefinition Height="50" /> | ||
<RowDefinition Height="50" /> | ||
</Grid.RowDefinitions> | ||
<Grid.ColumnDefinitions> | ||
<ColumnDefinition Width="Auto" /> | ||
<ColumnDefinition Width="50" /> | ||
<ColumnDefinition Width="50" /> | ||
<ColumnDefinition Width="50" /> | ||
<ColumnDefinition Width="50" /> | ||
</Grid.ColumnDefinitions> | ||
|
||
<TextBlock Grid.Row="1">Border:</TextBlock> | ||
<TextBlock Grid.Row="2">CntPresenter:</TextBlock> | ||
<TextBlock Grid.Row="3">Grid:</TextBlock> | ||
<TextBlock Grid.Row="4">RelPanel:</TextBlock> | ||
<TextBlock Grid.Row="5">StackPanel:</TextBlock> | ||
|
||
<TextBlock Grid.Column="1">Default</TextBlock> | ||
<TextBlock Grid.Column="2">Inner</TextBlock> | ||
<TextBlock Grid.Column="3">Outer</TextBlock> | ||
<TextBlock Grid.Column="4">Dynamic</TextBlock> | ||
|
||
<Border | ||
Grid.Row="1" | ||
Grid.Column="1" | ||
Background="Green" | ||
BorderBrush="#80FF0000" | ||
BorderThickness="15" /> | ||
|
||
<Border | ||
Grid.Row="1" | ||
Grid.Column="2" | ||
Background="Green" | ||
BorderBrush="#80FF0000" | ||
BorderThickness="15" | ||
BackgroundSizing="InnerBorderEdge" /> | ||
|
||
<Border | ||
Grid.Row="1" | ||
Grid.Column="3" | ||
Background="Green" | ||
BorderBrush="#80FF0000" | ||
BorderThickness="15" | ||
BackgroundSizing="OuterBorderEdge"/> | ||
|
||
<Border | ||
Grid.Row="1" | ||
Grid.Column="4" | ||
Background="Green" | ||
BorderBrush="#80FF0000" | ||
BorderThickness="15" | ||
CornerRadius="{Binding SelectedItem.Content, ElementName=radius}" | ||
BackgroundSizing="{Binding SelectedItem.Content, ElementName=dynamic}"/> | ||
|
||
<ContentPresenter | ||
Grid.Row="2" | ||
Grid.Column="1" | ||
Background="Green" | ||
BorderBrush="#80FF0000" | ||
BorderThickness="15" /> | ||
|
||
<ContentPresenter | ||
Grid.Row="2" | ||
Grid.Column="2" | ||
Background="Green" | ||
BorderBrush="#80FF0000" | ||
BorderThickness="15" | ||
BackgroundSizing="InnerBorderEdge" /> | ||
|
||
<ContentPresenter | ||
Grid.Row="2" | ||
Grid.Column="3" | ||
Background="Green" | ||
BorderBrush="#80FF0000" | ||
BorderThickness="15" | ||
BackgroundSizing="OuterBorderEdge"/> | ||
|
||
<ContentPresenter | ||
Grid.Row="2" | ||
Grid.Column="4" | ||
Background="Green" | ||
BorderBrush="#80FF0000" | ||
BorderThickness="15" | ||
CornerRadius="{Binding SelectedItem.Content, ElementName=radius}" | ||
BackgroundSizing="{Binding SelectedItem.Content, ElementName=dynamic}"/> | ||
|
||
|
||
<Grid | ||
Grid.Row="3" | ||
Grid.Column="1" | ||
Background="Green" | ||
BorderBrush="#80FF0000" | ||
BorderThickness="15" /> | ||
|
||
<Grid | ||
Grid.Row="3" | ||
Grid.Column="2" | ||
Background="Green" | ||
BorderBrush="#80FF0000" | ||
BorderThickness="15" | ||
BackgroundSizing="InnerBorderEdge" /> | ||
|
||
<Grid | ||
Grid.Row="3" | ||
Grid.Column="3" | ||
Background="Green" | ||
BorderBrush="#80FF0000" | ||
BorderThickness="15" | ||
BackgroundSizing="OuterBorderEdge"/> | ||
|
||
<Grid | ||
Grid.Row="3" | ||
Grid.Column="4" | ||
Background="Green" | ||
BorderBrush="#80FF0000" | ||
BorderThickness="15" | ||
CornerRadius="{Binding SelectedItem.Content, ElementName=radius}" | ||
BackgroundSizing="{Binding SelectedItem.Content, ElementName=dynamic}"/> | ||
|
||
|
||
<RelativePanel | ||
Grid.Row="4" | ||
Grid.Column="1" | ||
Background="Green" | ||
BorderBrush="#80FF0000" | ||
BorderThickness="15" /> | ||
|
||
<RelativePanel | ||
Grid.Row="4" | ||
Grid.Column="2" | ||
Background="Green" | ||
BorderBrush="#80FF0000" | ||
BorderThickness="15" | ||
BackgroundSizing="InnerBorderEdge" /> | ||
|
||
<RelativePanel | ||
Grid.Row="4" | ||
Grid.Column="3" | ||
Background="Green" | ||
BorderBrush="#80FF0000" | ||
BorderThickness="15" | ||
BackgroundSizing="OuterBorderEdge"/> | ||
|
||
<RelativePanel | ||
Grid.Row="4" | ||
Grid.Column="4" | ||
Background="Green" | ||
BorderBrush="#80FF0000" | ||
BorderThickness="15" | ||
CornerRadius="{Binding SelectedItem.Content, ElementName=radius}" | ||
BackgroundSizing="{Binding SelectedItem.Content, ElementName=dynamic}"/> | ||
|
||
|
||
<StackPanel | ||
Grid.Row="5" | ||
Grid.Column="1" | ||
Background="Green" | ||
BorderBrush="#80FF0000" | ||
BorderThickness="15" /> | ||
|
||
<StackPanel | ||
Grid.Row="5" | ||
Grid.Column="2" | ||
Background="Green" | ||
BorderBrush="#80FF0000" | ||
BorderThickness="15" | ||
BackgroundSizing="InnerBorderEdge" /> | ||
|
||
<StackPanel | ||
Grid.Row="5" | ||
Grid.Column="3" | ||
Background="Green" | ||
BorderBrush="#80FF0000" | ||
BorderThickness="15" | ||
BackgroundSizing="OuterBorderEdge"/> | ||
|
||
<StackPanel | ||
Grid.Row="5" | ||
Grid.Column="4" | ||
Background="Green" | ||
BorderBrush="#80FF0000" | ||
BorderThickness="15" | ||
CornerRadius="{Binding SelectedItem.Content, ElementName=radius}" | ||
BackgroundSizing="{Binding SelectedItem.Content, ElementName=dynamic}"/> | ||
</Grid> | ||
|
||
</StackPanel> | ||
</Page> |
14 changes: 14 additions & 0 deletions
14
...sApp/UITests.Shared/Windows_UI_Xaml/FrameworkElementTests/DynamicBackgroundSizing.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.FrameworkElementTests | ||
{ | ||
[Sample("FrameworkElement")] | ||
public sealed partial class DynamicBackgroundSizing : Page | ||
{ | ||
public DynamicBackgroundSizing() | ||
{ | ||
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
19 changes: 0 additions & 19 deletions
19
src/Uno.UI/Generated/3.0.0.0/Windows.UI.Xaml.Controls/BackgroundSizing.cs
This file was deleted.
Oops, something went wrong.
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
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
Oops, something went wrong.