diff options
Diffstat (limited to 'Xamarin.Forms.Platform.Tizen/Renderers/ScrollViewRenderer.cs')
-rw-r--r-- | Xamarin.Forms.Platform.Tizen/Renderers/ScrollViewRenderer.cs | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/Xamarin.Forms.Platform.Tizen/Renderers/ScrollViewRenderer.cs b/Xamarin.Forms.Platform.Tizen/Renderers/ScrollViewRenderer.cs index 27914f4b..570cb5da 100644 --- a/Xamarin.Forms.Platform.Tizen/Renderers/ScrollViewRenderer.cs +++ b/Xamarin.Forms.Platform.Tizen/Renderers/ScrollViewRenderer.cs @@ -29,7 +29,7 @@ namespace Xamarin.Forms.Platform.Tizen if (Control == null) { ///TODO: If 'Watch' target idiom is added, it should be replaced something like Device.Idiom == TargetIdiom.Watch. - if (Forms.GetProfile() == "wearable" ) + if (Forms.GetProfile() == "wearable") { SetNativeControl(new CircleScroller(Forms.Context.MainWindow)); } @@ -77,16 +77,31 @@ namespace Xamarin.Forms.Platform.Tizen { if (_content != null) { + if (_content is Native.Box contentBox) + { + contentBox.LayoutUpdated -= OnContentLayoutUpdated; + } Control.SetContent(null, true); + _content.Unrealize(); + _content = null; } - _content = Platform.GetOrCreateRenderer(Element.Content).NativeView; - - if (_content != null) + if (Element.Content != null) { + _content = Platform.GetOrCreateRenderer(Element.Content).NativeView; + if (_content is Native.Box contentBox) + { + contentBox.LayoutUpdated += OnContentLayoutUpdated; + } Control.SetContent(_content, true); UpdateContentSize(); } + + } + + void OnContentLayoutUpdated(object sender, Native.LayoutEventArgs e) + { + UpdateContentSize(); } void UpdateAll() |