diff options
author | E.Z. Hart <hartez@users.noreply.github.com> | 2016-12-14 17:13:17 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-12-14 17:13:17 -0700 |
commit | 8f1bb7b4b2ae8fd182c3874f208a12d549d230dd (patch) | |
tree | ab5f5c4b784065827248d2b4ea40dde23571f90b /Xamarin.Forms.Controls.Issues | |
parent | 1c5de535739e92d0c6dca335c024503b08d1a2af (diff) | |
download | xamarin-forms-8f1bb7b4b2ae8fd182c3874f208a12d549d230dd.tar.gz xamarin-forms-8f1bb7b4b2ae8fd182c3874f208a12d549d230dd.tar.bz2 xamarin-forms-8f1bb7b4b2ae8fd182c3874f208a12d549d230dd.zip |
Fix potential NRE in ConditionalFocusLayout (#587)2.3.3.175
Diffstat (limited to 'Xamarin.Forms.Controls.Issues')
2 files changed, 53 insertions, 0 deletions
diff --git a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla38989.cs b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla38989.cs new file mode 100644 index 00000000..a16f1adf --- /dev/null +++ b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla38989.cs @@ -0,0 +1,52 @@ +using System.Collections.Generic; +using Xamarin.Forms.CustomAttributes; +using Xamarin.Forms.Internals; +#if UITEST +using NUnit.Framework; + +#endif + +namespace Xamarin.Forms.Controls.Issues +{ + [Preserve(AllMembers = true)] + [Issue(IssueTracker.Bugzilla, 38989, "[Android] NullReferenceException when using a custom ViewCellRenderer ", + PlatformAffected.Android)] + public class Bugzilla38989 : TestContentPage + { + const string Success = "If you can see this, the test passed."; + +#if UITEST && __ANDROID__ + [Test] + public void Bugzilla38989Test() + { + RunningApp.WaitForElement(q => q.Marked(Success)); + } +#endif + + protected override void Init() + { + var successLabel = new Label { Text = Success }; + + var lv = new ListView(); + var items = new List<string> { "data", "does not", "matter" }; + + lv.ItemTemplate = new DataTemplate(typeof(_38989CustomViewCell)); + + lv.ItemsSource = items; + + Content = new StackLayout { Children = { successLabel, lv } }; + } + + [Preserve(AllMembers = true)] + public class _38989CustomViewCell : ViewCell + { + public _38989CustomViewCell() + { + var label = new Label(); + label.SetBinding(Label.TextProperty, "."); + + View = label; + } + } + } +}
\ No newline at end of file diff --git a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Xamarin.Forms.Controls.Issues.Shared.projitems b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Xamarin.Forms.Controls.Issues.Shared.projitems index 290835a2..76c721f1 100644 --- a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Xamarin.Forms.Controls.Issues.Shared.projitems +++ b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Xamarin.Forms.Controls.Issues.Shared.projitems @@ -85,6 +85,7 @@ <DependentUpon>Bugzilla38827.xaml</DependentUpon> <SubType>Code</SubType> </Compile> + <Compile Include="$(MSBuildThisFileDirectory)Bugzilla38989.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Bugzilla39395.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Bugzilla39461.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Bugzilla39483.xaml.cs"> |