From 0226ce604ea3a60716173bd2f2241c224cc0ff31 Mon Sep 17 00:00:00 2001 From: RinaYou Date: Thu, 21 Sep 2017 15:43:13 +0900 Subject: Change file name for changing Class name Change-Id: I57774f642175c08294722292a4a6ac4b65ed7e3f --- Xamarin.Forms.Platform.Tizen/Native/ContentPage.cs | 66 ------------------ Xamarin.Forms.Platform.Tizen/Native/Page.cs | 66 ++++++++++++++++++ .../Renderers/ContentPageRenderer.cs | 80 ---------------------- .../Renderers/PageRenderer.cs | 80 ++++++++++++++++++++++ 4 files changed, 146 insertions(+), 146 deletions(-) delete mode 100644 Xamarin.Forms.Platform.Tizen/Native/ContentPage.cs create mode 100755 Xamarin.Forms.Platform.Tizen/Native/Page.cs delete mode 100644 Xamarin.Forms.Platform.Tizen/Renderers/ContentPageRenderer.cs create mode 100755 Xamarin.Forms.Platform.Tizen/Renderers/PageRenderer.cs diff --git a/Xamarin.Forms.Platform.Tizen/Native/ContentPage.cs b/Xamarin.Forms.Platform.Tizen/Native/ContentPage.cs deleted file mode 100644 index 0ade2f2b..00000000 --- a/Xamarin.Forms.Platform.Tizen/Native/ContentPage.cs +++ /dev/null @@ -1,66 +0,0 @@ -using System; -using System.Collections.Generic; -using ElmSharp; - -namespace Xamarin.Forms.Platform.Tizen.Native -{ - /// - /// A basic page which can hold a single view. - /// - public class Page : Background, IContainable - { - /// - /// The name of the part to be used when setting content. - /// - public const string ContentPartName = "overlay"; - - /// - /// Exposes the Children property, mapping it to the _canvas' Children property. - /// - public IList Children => _canvas.Children; - - /// - /// The canvas, used as a container for other objects. - /// - /// - /// The canvas holds all the Views that the ContentPage is composed of. - /// - internal Canvas _canvas; - - /// - /// Initializes a new instance of the ContentPage class. - /// - public Page(EvasObject parent) : base(parent) - { - _canvas = new Canvas(this); - SetPartContent(ContentPartName, _canvas); - } - - /// - /// Allows custom handling of events emitted when the layout has been updated. - /// - public event EventHandler LayoutUpdated - { - add - { - _canvas.LayoutUpdated += value; - } - remove - { - _canvas.LayoutUpdated -= value; - } - } - - /// - /// Handles the disposing of a ContentPage - /// - /// - /// Takes the proper care of discarding the canvas, then calls the base method. - /// - protected override void OnUnrealize() - { - _canvas.Unrealize(); - base.OnUnrealize(); - } - } -} diff --git a/Xamarin.Forms.Platform.Tizen/Native/Page.cs b/Xamarin.Forms.Platform.Tizen/Native/Page.cs new file mode 100755 index 00000000..0ade2f2b --- /dev/null +++ b/Xamarin.Forms.Platform.Tizen/Native/Page.cs @@ -0,0 +1,66 @@ +using System; +using System.Collections.Generic; +using ElmSharp; + +namespace Xamarin.Forms.Platform.Tizen.Native +{ + /// + /// A basic page which can hold a single view. + /// + public class Page : Background, IContainable + { + /// + /// The name of the part to be used when setting content. + /// + public const string ContentPartName = "overlay"; + + /// + /// Exposes the Children property, mapping it to the _canvas' Children property. + /// + public IList Children => _canvas.Children; + + /// + /// The canvas, used as a container for other objects. + /// + /// + /// The canvas holds all the Views that the ContentPage is composed of. + /// + internal Canvas _canvas; + + /// + /// Initializes a new instance of the ContentPage class. + /// + public Page(EvasObject parent) : base(parent) + { + _canvas = new Canvas(this); + SetPartContent(ContentPartName, _canvas); + } + + /// + /// Allows custom handling of events emitted when the layout has been updated. + /// + public event EventHandler LayoutUpdated + { + add + { + _canvas.LayoutUpdated += value; + } + remove + { + _canvas.LayoutUpdated -= value; + } + } + + /// + /// Handles the disposing of a ContentPage + /// + /// + /// Takes the proper care of discarding the canvas, then calls the base method. + /// + protected override void OnUnrealize() + { + _canvas.Unrealize(); + base.OnUnrealize(); + } + } +} diff --git a/Xamarin.Forms.Platform.Tizen/Renderers/ContentPageRenderer.cs b/Xamarin.Forms.Platform.Tizen/Renderers/ContentPageRenderer.cs deleted file mode 100644 index c118205b..00000000 --- a/Xamarin.Forms.Platform.Tizen/Renderers/ContentPageRenderer.cs +++ /dev/null @@ -1,80 +0,0 @@ -using System; -using EColor = ElmSharp.Color; - -namespace Xamarin.Forms.Platform.Tizen -{ - /// - /// Renderer of ContentPage. - /// - public class PageRenderer : VisualElementRenderer - { - /// - /// Native control which holds the contents. - /// - Native.Page _page; - - /// - /// Default constructor. - /// - public PageRenderer() - { - RegisterPropertyHandler(Page.BackgroundImageProperty, UpdateBackgroundImage); - } - - protected override void OnElementChanged(ElementChangedEventArgs e) - { - if (null == _page) - { - _page = new Native.Page(Forms.Context.MainWindow); - _page.LayoutUpdated += OnLayoutUpdated; - SetNativeControl(_page); - } - base.OnElementChanged(e); - } - - protected override void Dispose(bool disposing) - { - if (disposing) - { - if (_page != null) - { - _page.LayoutUpdated -= OnLayoutUpdated; - } - } - base.Dispose(disposing); - } - - protected override void UpdateBackgroundColor(bool initialize) - { - if (initialize && Element.BackgroundColor.IsDefault) - return; - - // base.UpdateBackgroundColor() is not called on purpose, we don't want the regular background setting - if (Element.BackgroundColor.IsDefault || Element.BackgroundColor.A == 0) - _page.Color = EColor.Transparent; - else - _page.Color = Element.BackgroundColor.ToNative(); - } - - protected override void UpdateLayout() - { - // empty on purpose - } - - void UpdateBackgroundImage(bool initiaize) - { - if (initiaize && string.IsNullOrWhiteSpace(Element.BackgroundImage)) - return; - - if (string.IsNullOrWhiteSpace(Element.BackgroundImage)) - _page.File = null; - else - _page.File = ResourcePath.GetPath(Element.BackgroundImage); - } - - void OnLayoutUpdated(object sender, Native.LayoutEventArgs e) - { - DoLayout(e); - } - } -} diff --git a/Xamarin.Forms.Platform.Tizen/Renderers/PageRenderer.cs b/Xamarin.Forms.Platform.Tizen/Renderers/PageRenderer.cs new file mode 100755 index 00000000..c118205b --- /dev/null +++ b/Xamarin.Forms.Platform.Tizen/Renderers/PageRenderer.cs @@ -0,0 +1,80 @@ +using System; +using EColor = ElmSharp.Color; + +namespace Xamarin.Forms.Platform.Tizen +{ + /// + /// Renderer of ContentPage. + /// + public class PageRenderer : VisualElementRenderer + { + /// + /// Native control which holds the contents. + /// + Native.Page _page; + + /// + /// Default constructor. + /// + public PageRenderer() + { + RegisterPropertyHandler(Page.BackgroundImageProperty, UpdateBackgroundImage); + } + + protected override void OnElementChanged(ElementChangedEventArgs e) + { + if (null == _page) + { + _page = new Native.Page(Forms.Context.MainWindow); + _page.LayoutUpdated += OnLayoutUpdated; + SetNativeControl(_page); + } + base.OnElementChanged(e); + } + + protected override void Dispose(bool disposing) + { + if (disposing) + { + if (_page != null) + { + _page.LayoutUpdated -= OnLayoutUpdated; + } + } + base.Dispose(disposing); + } + + protected override void UpdateBackgroundColor(bool initialize) + { + if (initialize && Element.BackgroundColor.IsDefault) + return; + + // base.UpdateBackgroundColor() is not called on purpose, we don't want the regular background setting + if (Element.BackgroundColor.IsDefault || Element.BackgroundColor.A == 0) + _page.Color = EColor.Transparent; + else + _page.Color = Element.BackgroundColor.ToNative(); + } + + protected override void UpdateLayout() + { + // empty on purpose + } + + void UpdateBackgroundImage(bool initiaize) + { + if (initiaize && string.IsNullOrWhiteSpace(Element.BackgroundImage)) + return; + + if (string.IsNullOrWhiteSpace(Element.BackgroundImage)) + _page.File = null; + else + _page.File = ResourcePath.GetPath(Element.BackgroundImage); + } + + void OnLayoutUpdated(object sender, Native.LayoutEventArgs e) + { + DoLayout(e); + } + } +} -- cgit v1.2.3