This repository has been archived by the owner on May 1, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[UWP] Fix incorrect Button rendering inside CollectionView ItemTempla…
…te (#14598) * Fix Button not rendering inside CollectionView templates on UWP * Unsubscribe loading event * Fix build Co-authored-by: Gerald Versluis <gerald.versluis@microsoft.com> Co-authored-by: Gerald Versluis <gerald@verslu.is>
- Loading branch information
1 parent
50cd14f
commit 0e1ba44
Showing
4 changed files
with
132 additions
and
0 deletions.
There are no files selected for viewing
80 changes: 80 additions & 0 deletions
80
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue13588.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,80 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<controls:TestContentPage | ||
xmlns:controls="clr-namespace:Xamarin.Forms.Controls" | ||
xmlns="http://xamarin.com/schemas/2014/forms" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" | ||
xmlns:d="http://xamarin.com/schemas/2014/forms/design" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
mc:Ignorable="d" | ||
x:Class="Xamarin.Forms.Controls.Issues.Issue13588" | ||
Title="Issue 13588"> | ||
<Grid | ||
RowSpacing="0"> | ||
<Grid.RowDefinitions> | ||
<RowDefinition Height="Auto" /> | ||
<RowDefinition Height="*" /> | ||
</Grid.RowDefinitions> | ||
<Label | ||
Padding="12" | ||
BackgroundColor="Black" | ||
TextColor="White" | ||
Text="If Buttons inside CollectionView renders correctly, the test has passed."/> | ||
<CollectionView | ||
Grid.Row="1"> | ||
<CollectionView.ItemsSource> | ||
<x:Array Type="{x:Type x:String}"> | ||
<x:String>mono</x:String> | ||
<x:String>monodroid</x:String> | ||
<x:String>monotouch</x:String> | ||
<x:String>monorail</x:String> | ||
<x:String>monodevelop</x:String> | ||
<x:String>monotone</x:String> | ||
<x:String>monopoly</x:String> | ||
<x:String>monomodal</x:String> | ||
<x:String>mononucleosis</x:String> | ||
</x:Array> | ||
</CollectionView.ItemsSource> | ||
<CollectionView.ItemTemplate> | ||
<DataTemplate> | ||
<Grid> | ||
<Grid.ColumnDefinitions> | ||
<ColumnDefinition Width="*" /> | ||
<ColumnDefinition Width="*" /> | ||
<ColumnDefinition Width="*" /> | ||
<ColumnDefinition Width="40" /> | ||
</Grid.ColumnDefinitions> | ||
<Label | ||
Margin="10,5,10,0" | ||
FontAttributes="Bold" | ||
VerticalOptions="Center" | ||
HorizontalOptions="StartAndExpand" | ||
Text="{Binding}" | ||
LineBreakMode="WordWrap" > | ||
</Label> | ||
<Label | ||
Margin="10,0,10,0" | ||
Grid.Column="1" | ||
VerticalOptions="Center" | ||
HorizontalOptions="Start" | ||
LineBreakMode="WordWrap" | ||
Text="Status" /> | ||
<!-- Button having the display issue--> | ||
<Button | ||
Grid.Column="3" | ||
Text="X" | ||
VerticalOptions="Center" | ||
HorizontalOptions="End"> | ||
</Button> | ||
<!-- Button having the display issue--> | ||
<Button | ||
Grid.Column="2" | ||
Text="Retry" | ||
VerticalOptions="Center" | ||
HorizontalOptions="Center"> | ||
</Button> | ||
</Grid> | ||
</DataTemplate> | ||
</CollectionView.ItemTemplate> | ||
</CollectionView> | ||
</Grid> | ||
</controls:TestContentPage> |
41 changes: 41 additions & 0 deletions
41
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue13588.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,41 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Collections.ObjectModel; | ||
using System.Windows.Input; | ||
using Xamarin.Forms.CustomAttributes; | ||
using Xamarin.Forms.Internals; | ||
using Xamarin.Forms.Xaml; | ||
|
||
#if UITEST | ||
using Xamarin.UITest; | ||
using Xamarin.UITest.Queries; | ||
using NUnit.Framework; | ||
using Xamarin.Forms.Core.UITests; | ||
#endif | ||
|
||
namespace Xamarin.Forms.Controls.Issues | ||
{ | ||
#if UITEST | ||
[NUnit.Framework.Category(UITestCategories.CollectionView)] | ||
#endif | ||
#if APP | ||
[XamlCompilation(XamlCompilationOptions.Compile)] | ||
#endif | ||
[Preserve(AllMembers = true)] | ||
[Issue(IssueTracker.Github, 13588, "[Bug] Button inside collectionview not appearing until UWP window is resized #13552", PlatformAffected.UWP)] | ||
public partial class Issue13588 : TestContentPage | ||
{ | ||
public Issue13588() | ||
{ | ||
#if APP | ||
Title = "Issue 13588"; | ||
InitializeComponent(); | ||
#endif | ||
} | ||
|
||
protected override void Init() | ||
{ | ||
|
||
} | ||
} | ||
} |
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