Skip to content

Commit

Permalink
test: Created a sample illustrating GH Bug #2879
Browse files Browse the repository at this point in the history
  • Loading branch information
carldebilly committed Mar 27, 2020
1 parent c88da52 commit cebb508
Show file tree
Hide file tree
Showing 3 changed files with 103 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/SamplesApp/UITests.Shared/UITests.Shared.projitems
Original file line number Diff line number Diff line change
Expand Up @@ -421,6 +421,10 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="$(MSBuildThisFileDirectory)Windows_UI_Xaml\UIElementTests\UIElement_Layout_Bug2879.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="$(MSBuildThisFileDirectory)Windows_UI_Xaml\UIElementTests\UIElement_Layout_Constrains.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
Expand Down Expand Up @@ -3326,6 +3330,9 @@
<Compile Include="$(MSBuildThisFileDirectory)Windows_UI_Xaml\UIElementTests\UIElement_ArrangeOverride_Alignment.xaml.cs">
<DependentUpon>UIElement_ArrangeOverride_Alignment.xaml</DependentUpon>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)Windows_UI_Xaml\UIElementTests\UIElement_Layout_Bug2879.xaml.cs">
<DependentUpon>UIElement_Layout_Bug2879.xaml</DependentUpon>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)Windows_UI_Xaml\UIElementTests\UIElement_Layout_Constrains.xaml.cs">
<DependentUpon>UIElement_Layout_Constrains.xaml</DependentUpon>
</Compile>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
<Page
x:Class="UITests.Windows_UI_Xaml.UIElementTests.UIElement_Layout_Bug2879"
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 VerticalAlignment="Center" Spacing="8" MaxWidth="350">
<TextBlock>
This is an illustration of
<Hyperlink NavigateUri="https://github.com/unoplatform/uno/issues/2879">Bug #2879</Hyperlink>.
To trigger the bug, press few times on the follow button:
</TextBlock>
<ToggleButton Background="LightGray"
x:Name="toggle"
HorizontalAlignment="Center">Change State</ToggleButton>
<Grid Background="Gray"
Margin="8,3,8,15"
Padding="0,6,0,13"
CornerRadius="13"
MinHeight="80">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>

<StackPanel Background="Gold"
Padding="20,5">
<TextBlock FontSize="20" Text="qwertyuiopasdfghjklxcvbnmqwertyu" HorizontalAlignment="Left" TextWrapping="Wrap" />
</StackPanel>

<StackPanel Background="Red"
Visibility="{Binding IsChecked, ElementName=toggle}"
Grid.Column="1"
Width="100" />
</Grid>
<TextBlock>State OFF (should be like this when unpressed)</TextBlock>
<Grid Background="Gray"
Margin="8,3,8,15"
Padding="0,6,0,13"
CornerRadius="13"
MinHeight="80">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>

<StackPanel Background="Gold"
Padding="20,5">
<TextBlock FontSize="20" Text="qwertyuiopasdfghjklxcvbnmqwertyu" HorizontalAlignment="Left" TextWrapping="Wrap" />
</StackPanel>

<StackPanel Background="Red"
Visibility="Collapsed"
Grid.Column="1"
Width="100" />
</Grid>
<TextBlock>State ON (should be like this when pressed)</TextBlock>
<Grid Background="Gray"
Margin="8,3,8,15"
Padding="0,6,0,13"
CornerRadius="13"
MinHeight="80">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>

<StackPanel Background="Gold"
Padding="20,5">
<TextBlock FontSize="20" Text="qwertyuiopasdfghjklxcvbnmqwertyu" HorizontalAlignment="Left" TextWrapping="Wrap" />
</StackPanel>

<StackPanel Background="Red"
Grid.Column="1"
Width="100" />
</Grid>

</StackPanel>
</Page>
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
using Uno.UI.Samples.Controls;
using Windows.UI.Xaml.Controls;

namespace UITests.Windows_UI_Xaml.UIElementTests
{
[Sample("UIElement", "GH Bugs")]
public sealed partial class UIElement_Layout_Bug2879 : Page
{
public UIElement_Layout_Bug2879()
{
this.InitializeComponent();
}
}
}

0 comments on commit cebb508

Please sign in to comment.