diff --git a/Xamarin.Forms.Platform.Tizen/FormsApplication.cs b/Xamarin.Forms.Platform.Tizen/FormsApplication.cs index cdae33d3d..5999e5fd0 100644 --- a/Xamarin.Forms.Platform.Tizen/FormsApplication.cs +++ b/Xamarin.Forms.Platform.Tizen/FormsApplication.cs @@ -131,18 +131,6 @@ namespace Xamarin.Forms.Platform.Tizen throw new InvalidOperationException("Call Forms.Init (UIApplication) before this"); } - if (_platform != null) - { - _platform.SetPage(page); - return; - } - - _platform = Platform.CreatePlatform(BaseLayout); - _platform.HasAlpha = MainWindow.Alpha; - BaseLayout.SetContent(_platform.GetRootNativeView()); - - _platform.RootNativeViewChanged += (s, e) => BaseLayout.SetContent(e.RootNativeView); - if (_application != null) { _application.Platform = _platform; @@ -191,6 +179,11 @@ namespace Xamarin.Forms.Platform.Tizen } } }; + + _platform = Platform.CreatePlatform(BaseLayout); + _platform.HasAlpha = MainWindow.Alpha; + BaseLayout.SetContent(_platform.GetRootNativeView()); + _platform.RootNativeViewChanged += (s, e) => BaseLayout.SetContent(e.RootNativeView); } public void Run() diff --git a/Xamarin.Forms.Platform.Tizen/LightweightPlatform.cs b/Xamarin.Forms.Platform.Tizen/LightweightPlatform.cs index bf1f4080f..26fe695f4 100644 --- a/Xamarin.Forms.Platform.Tizen/LightweightPlatform.cs +++ b/Xamarin.Forms.Platform.Tizen/LightweightPlatform.cs @@ -51,7 +51,7 @@ namespace Xamarin.Forms.Platform.Tizen _page.Platform = this; - var renderer = Platform.AttachRenderer(_page); + var renderer = Platform.CreateRenderer(_page); _rootView = renderer.NativeView; RootNativeViewChanged?.Invoke(this, new RootNativeViewChangedEventArgs(_rootView)); _rootView.Show(); diff --git a/Xamarin.Forms.Platform.Tizen/Platform.cs b/Xamarin.Forms.Platform.Tizen/Platform.cs index 0d13654c4..724fc534d 100644 --- a/Xamarin.Forms.Platform.Tizen/Platform.cs +++ b/Xamarin.Forms.Platform.Tizen/Platform.cs @@ -35,19 +35,17 @@ namespace Xamarin.Forms.Platform.Tizen /// Gets the renderer associated with the view. If it doesn't exist, creates a new one. /// /// Renderer associated with the view. - /// View for which the renderer is going to be returned. - public static IVisualElementRenderer GetOrCreateRenderer(VisualElement view) + /// VisualElement for which the renderer is going to be returned. + public static IVisualElementRenderer GetOrCreateRenderer(VisualElement element) { - return GetRenderer(view) ?? AttachRenderer(view); + return GetRenderer(element) ?? CreateRenderer(element); } - internal static IVisualElementRenderer AttachRenderer(VisualElement view) + internal static IVisualElementRenderer CreateRenderer(VisualElement element) { - IVisualElementRenderer visualElementRenderer = Registrar.Registered.GetHandlerForObject(view) ?? new DefaultRenderer(); - - visualElementRenderer.SetElement(view); - - return visualElementRenderer; + IVisualElementRenderer renderer = Registrar.Registered.GetHandlerForObject(element) ?? new DefaultRenderer(); + renderer.SetElement(element); + return renderer; } internal static ITizenPlatform CreatePlatform(EvasObject parent) @@ -160,7 +158,7 @@ namespace Xamarin.Forms.Platform.Tizen Page = newRoot; Page.Platform = this; - IVisualElementRenderer pageRenderer = Platform.AttachRenderer(Page); + IVisualElementRenderer pageRenderer = Platform.CreateRenderer(Page); var naviItem = _internalNaviframe.Push(pageRenderer.NativeView); naviItem.TitleBarVisible = false; @@ -282,7 +280,7 @@ namespace Xamarin.Forms.Platform.Tizen async Task INavigation.PushModalAsync(Page modal, bool animated) { var previousPage = CurrentPageController; - Device.BeginInvokeOnMainThread(()=> previousPage?.SendDisappearing()); + Device.BeginInvokeOnMainThread(() => previousPage?.SendDisappearing()); _navModel.PushModal(modal);