summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Platform.iOS/ViewRenderer.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Xamarin.Forms.Platform.iOS/ViewRenderer.cs')
-rw-r--r--Xamarin.Forms.Platform.iOS/ViewRenderer.cs8
1 files changed, 7 insertions, 1 deletions
diff --git a/Xamarin.Forms.Platform.iOS/ViewRenderer.cs b/Xamarin.Forms.Platform.iOS/ViewRenderer.cs
index 5b3be1c3..1186fb4c 100644
--- a/Xamarin.Forms.Platform.iOS/ViewRenderer.cs
+++ b/Xamarin.Forms.Platform.iOS/ViewRenderer.cs
@@ -41,11 +41,17 @@ namespace Xamarin.Forms.Platform.iOS
return Control.SizeThatFits(size);
}
+ /// <summary>
+ /// Determines whether the native control is disposed of when this renderer is disposed
+ /// Can be overridden in deriving classes
+ /// </summary>
+ protected virtual bool ManageNativeControlLifetime => true;
+
protected override void Dispose(bool disposing)
{
base.Dispose(disposing);
- if (disposing && Control != null)
+ if (disposing && Control != null && ManageNativeControlLifetime)
{
Control.Dispose();
Control = null;