summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.ControlGallery.iOS
diff options
context:
space:
mode:
authorRui Marinho <me@ruimarinho.net>2017-05-24 17:29:09 (GMT)
committerJason Smith <jason.smith@xamarin.com>2017-05-24 17:29:09 (GMT)
commit8f7b1f7f17f462caa05b84a96ea23ba622c1b771 (patch)
tree1322c0377ddc603326ce30102ebb85b70370001f /Xamarin.Forms.ControlGallery.iOS
parentcd61a94c5e2f16c4423bbb1e8b7b74287f491984 (diff)
downloadxamarin-forms-8f7b1f7f17f462caa05b84a96ea23ba622c1b771.zip
xamarin-forms-8f7b1f7f17f462caa05b84a96ea23ba622c1b771.tar.gz
xamarin-forms-8f7b1f7f17f462caa05b84a96ea23ba622c1b771.tar.bz2
[iOS] Handle user popping pages out of order (#934)
* [iOS] Handle when user can call pop a page that was already disposed/removed * [Controls] Fix bug number
Diffstat (limited to 'Xamarin.Forms.ControlGallery.iOS')
-rw-r--r--Xamarin.Forms.ControlGallery.iOS/CustomRendererBugzila38731.cs29
-rw-r--r--Xamarin.Forms.ControlGallery.iOS/Xamarin.Forms.ControlGallery.iOS.csproj1
2 files changed, 30 insertions, 0 deletions
diff --git a/Xamarin.Forms.ControlGallery.iOS/CustomRendererBugzila38731.cs b/Xamarin.Forms.ControlGallery.iOS/CustomRendererBugzila38731.cs
new file mode 100644
index 0000000..0ae8d96
--- /dev/null
+++ b/Xamarin.Forms.ControlGallery.iOS/CustomRendererBugzila38731.cs
@@ -0,0 +1,29 @@
+using UIKit;
+using Xamarin.Forms;
+using Xamarin.Forms.ControlGallery.iOS;
+using Xamarin.Forms.Controls.Issues;
+
+[assembly: ExportRenderer(typeof(Bugzilla38731), typeof(CustomRendererBugzila38731))]
+[assembly: ExportRenderer(typeof(Bugzilla38731.PageTwo), typeof(CustomRendererBugzila38731))]
+[assembly: ExportRenderer(typeof(Bugzilla38731.PageThree), typeof(CustomRendererBugzila38731))]
+[assembly: ExportRenderer(typeof(Bugzilla38731.PageFour), typeof(CustomRendererBugzila38731))]
+
+namespace Xamarin.Forms.ControlGallery.iOS
+{
+ public class CustomRendererBugzila38731 : Platform.iOS.PageRenderer
+ {
+ public override void ViewWillAppear(bool animated)
+ {
+ base.ViewWillAppear(animated);
+
+ if (NavigationController.ViewControllers.Length > 1)
+ {
+ NavigationController.TopViewController.NavigationItem.SetLeftBarButtonItem(new UIBarButtonItem(
+ UIImage.FromFile("bank.png"), UIBarButtonItemStyle.Plain, (sender, args) =>
+ {
+ NavigationController.PopViewController(true);
+ }), true);
+ }
+ }
+ }
+}
diff --git a/Xamarin.Forms.ControlGallery.iOS/Xamarin.Forms.ControlGallery.iOS.csproj b/Xamarin.Forms.ControlGallery.iOS/Xamarin.Forms.ControlGallery.iOS.csproj
index 4e2e770..00d23ec 100644
--- a/Xamarin.Forms.ControlGallery.iOS/Xamarin.Forms.ControlGallery.iOS.csproj
+++ b/Xamarin.Forms.ControlGallery.iOS/Xamarin.Forms.ControlGallery.iOS.csproj
@@ -169,6 +169,7 @@
<Compile Include="Properties\AssemblyInfo.cs" />
<None Include="packages.config" />
<Compile Include="CustomRenderers.cs" />
+ <Compile Include="CustomRendererBugzila38731.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Xamarin.Forms.Controls\Xamarin.Forms.Controls.csproj">