summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Controls.Issues
diff options
context:
space:
mode:
authorPaul DiPietro <paul.dipietro@me.com>2016-04-06 22:53:52 -0700
committerJason Smith <jason.smith@xamarin.com>2016-04-06 22:53:52 -0700
commite3191821bae99fb52d32644566cd14a8f496e36a (patch)
treeb7c2921ff3e6485e4de6b3dc1570eca7ecfb8cea /Xamarin.Forms.Controls.Issues
parentca9b08deab496fed361cbec2043507a977eedf61 (diff)
downloadxamarin-forms-e3191821bae99fb52d32644566cd14a8f496e36a.tar.gz
xamarin-forms-e3191821bae99fb52d32644566cd14a8f496e36a.tar.bz2
xamarin-forms-e3191821bae99fb52d32644566cd14a8f496e36a.zip
[iOS] ViewCellRenderer did not set RealCellProperty
In the iOS ViewCellRenderer, GetRealCell in ViewCellPropertyChanged was returning null and passing it to UpdateIsEnabled. SetRealCell was never being called in ViewCellRenderer and the RealCellProperty was never being set.
Diffstat (limited to 'Xamarin.Forms.Controls.Issues')
-rw-r--r--Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla36955.cs62
-rw-r--r--Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Xamarin.Forms.Controls.Issues.Shared.projitems1
2 files changed, 63 insertions, 0 deletions
diff --git a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla36955.cs b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla36955.cs
new file mode 100644
index 00000000..4f1a8e79
--- /dev/null
+++ b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla36955.cs
@@ -0,0 +1,62 @@
+using System;
+
+using Xamarin.Forms.CustomAttributes;
+#if UITEST
+using Xamarin.UITest;
+using Xamarin.UITest.iOS;
+using Xamarin.UITest.Queries;
+using NUnit.Framework;
+#endif
+
+namespace Xamarin.Forms.Controls.Issues
+{
+ [Preserve(AllMembers = true)]
+ [Issue(IssueTracker.Bugzilla, 36955, "[iOS] ViewCellRenderer.UpdateIsEnabled referencing null object", PlatformAffected.iOS)]
+ public class Bugzilla36955 : TestContentPage
+ {
+ protected override void Init()
+ {
+ var ts = new TableSection();
+ var tr = new TableRoot { ts };
+ var tv = new TableView(tr);
+
+ var sc = new SwitchCell
+ {
+ Text = "Toggle switch; nothing should crash"
+ };
+
+ var button = new Button();
+ button.SetBinding(Button.TextProperty, new Binding("On", source: sc));
+
+ var vc = new ViewCell
+ {
+ View = button
+ };
+ vc.SetBinding(IsEnabledProperty, new Binding("On", source: sc));
+
+ ts.Add(sc);
+ ts.Add(vc);
+
+ Content = tv;
+ }
+
+#if UITEST
+ [Test]
+ public void Bugzilla36955Test()
+ {
+ if (RunningApp is iOSApp)
+ {
+ AppResult[] buttonFalse = RunningApp.Query(q => q.Button().Text("False"));
+ Assert.AreEqual(buttonFalse.Length == 1, true);
+ RunningApp.Tap(q => q.Class("Switch"));
+ AppResult[] buttonTrue = RunningApp.Query(q => q.Button().Text("True"));
+ Assert.AreEqual(buttonTrue.Length == 1, true);
+ }
+ else
+ {
+ Assert.Inconclusive("Test is only run on iOS.");
+ }
+ }
+#endif
+ }
+}
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 f843a2e3..93de60b1 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
@@ -68,6 +68,7 @@
<Compile Include="$(MSBuildThisFileDirectory)Bugzilla36649.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Bugzilla36559.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Bugzilla36171.cs" />
+ <Compile Include="$(MSBuildThisFileDirectory)Bugzilla36955.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Bugzilla37462.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Bugzilla37841.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Bugzilla37863.cs" />