summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Platform.Tizen/Renderers/LayoutRenderer.cs
diff options
context:
space:
mode:
authorSeungkeun Lee <sngn.lee@samsung.com>2017-06-29 13:07:21 +0900
committerKangho Hur <kangho.hur@samsung.com>2017-07-10 11:11:28 +0900
commitd225cdbe5a7879ad5fd8b9ab553ac3918928a70f (patch)
tree2558a9dcd91f8bdf839bcdbe7832dc8c43e1c8ce /Xamarin.Forms.Platform.Tizen/Renderers/LayoutRenderer.cs
parent92c44dc97f1d467e123ce076e3ffed953fe7cddb (diff)
downloadxamarin-forms-d225cdbe5a7879ad5fd8b9ab553ac3918928a70f.tar.gz
xamarin-forms-d225cdbe5a7879ad5fd8b9ab553ac3918928a70f.tar.bz2
xamarin-forms-d225cdbe5a7879ad5fd8b9ab553ac3918928a70f.zip
Refactoring Renderers
- Apply Dispose pattern - Handle IBatchable interface on VisualElementRenderer - Make pair Event subscribe/unsubscribe Change-Id: I65018652132494722d52b1d62798f1cf1f6fc6fd
Diffstat (limited to 'Xamarin.Forms.Platform.Tizen/Renderers/LayoutRenderer.cs')
-rw-r--r--Xamarin.Forms.Platform.Tizen/Renderers/LayoutRenderer.cs17
1 files changed, 10 insertions, 7 deletions
diff --git a/Xamarin.Forms.Platform.Tizen/Renderers/LayoutRenderer.cs b/Xamarin.Forms.Platform.Tizen/Renderers/LayoutRenderer.cs
index c2df8061..226afbb2 100644
--- a/Xamarin.Forms.Platform.Tizen/Renderers/LayoutRenderer.cs
+++ b/Xamarin.Forms.Platform.Tizen/Renderers/LayoutRenderer.cs
@@ -7,14 +7,14 @@ namespace Xamarin.Forms.Platform.Tizen
/// </summary>
public class LayoutRenderer : ViewRenderer<Layout, Native.Canvas>
{
- bool _isLayoutUpdatedRegistered = false;
+ bool _layoutUpdatedRegistered = false;
public void RegisterOnLayoutUpdated()
{
- if (!_isLayoutUpdatedRegistered)
+ if (!_layoutUpdatedRegistered)
{
Control.LayoutUpdated += OnLayoutUpdated;
- _isLayoutUpdatedRegistered = true;
+ _layoutUpdatedRegistered = true;
}
}
@@ -22,8 +22,7 @@ namespace Xamarin.Forms.Platform.Tizen
{
if (null == Control)
{
- var canvas = new Native.Canvas(Forms.Context.MainWindow);
- SetNativeControl(canvas);
+ SetNativeControl(new Native.Canvas(Forms.Context.MainWindow));
}
base.OnElementChanged(e);
@@ -31,9 +30,13 @@ namespace Xamarin.Forms.Platform.Tizen
protected override void Dispose(bool disposing)
{
- if (_isLayoutUpdatedRegistered)
+ if (disposing)
{
- Control.LayoutUpdated -= OnLayoutUpdated;
+ if (_layoutUpdatedRegistered)
+ {
+ Control.LayoutUpdated -= OnLayoutUpdated;
+ _layoutUpdatedRegistered = false;
+ }
}
base.Dispose(disposing);