diff options
author | Piotr Szydelko <p.szydelko@samsung.com> | 2016-11-24 11:09:33 +0100 |
---|---|---|
committer | Konrad Lipner <k.lipner@samsung.com> | 2016-11-28 19:54:21 +0900 |
commit | 82c4d45b5478dcae70b51e2f73160204aad50f0f (patch) | |
tree | 5da4ca2acf0669f21c567d133f60a6a23b3642cc | |
parent | 972f26cacd7a49dde527d708b245c0872adc4d21 (diff) | |
download | xamarin-forms-82c4d45b5478dcae70b51e2f73160204aad50f0f.tar.gz xamarin-forms-82c4d45b5478dcae70b51e2f73160204aad50f0f.tar.bz2 xamarin-forms-82c4d45b5478dcae70b51e2f73160204aad50f0f.zip |
Add description to Native.MasterDetailPage
Change-Id: Ia4523d1fd435354ac586c7cc8738e4e61c09a1fd
Signed-off-by: Piotr Szydelko <p.szydelko@samsung.com>
-rw-r--r-- | Xamarin.Forms.Platform.Tizen/Native/MasterDetailPage.cs | 84 |
1 files changed, 84 insertions, 0 deletions
diff --git a/Xamarin.Forms.Platform.Tizen/Native/MasterDetailPage.cs b/Xamarin.Forms.Platform.Tizen/Native/MasterDetailPage.cs index ccd4df14..5751aaf8 100644 --- a/Xamarin.Forms.Platform.Tizen/Native/MasterDetailPage.cs +++ b/Xamarin.Forms.Platform.Tizen/Native/MasterDetailPage.cs @@ -3,36 +3,85 @@ using ElmSharp; namespace Xamarin.Forms.Platform.Tizen.Native { + /// <summary> + /// The native widget which provides Xamarin.MasterDetailPage features. + /// </summary> public class MasterDetailPage : Box { + /// <summary> + /// The portion of the screen that the MasterPage takes in Split mode. + /// </summary> static readonly double s_splitRatio = 0.35; + /// <summary> + /// The portion of the screen that the MasterPage takes in Popover mode. + /// </summary> static readonly double s_popoverRatio = 0.8; + /// <summary> + /// The default master behavior (a.k.a mode). + /// </summary> static readonly MasterBehavior s_defaultMasterBehavior = (Device.Idiom == TargetIdiom.Phone) ? MasterBehavior.Popover : MasterBehavior.SplitOnLandscape; + /// <summary> + /// The MasterPage native container. + /// </summary> readonly Canvas _masterCanvas; + /// <summary> + /// The DetailPage native container. + /// </summary> readonly Canvas _detailCanvas; + /// <summary> + /// The container for <c>_masterCanvas</c> and <c>_detailCanvas</c> used in split mode. + /// </summary> readonly Panes _splitPane; + /// <summary> + /// The container for <c>_masterCanvas</c> used in popover mode. + /// </summary> readonly Panel _drawer; + /// <summary> + /// The <see cref="MasterBehavior"/> property value. + /// </summary> MasterBehavior _masterBehavior = s_defaultMasterBehavior; + /// <summary> + /// The actual MasterDetailPage mode - either split or popover. It depends on <c>_masterBehavior</c> and screen orientation. + /// </summary> MasterBehavior _internalMasterBehavior = MasterBehavior.Popover; + /// <summary> + /// The <see cref="Master"/> property value. + /// </summary> EvasObject _master; + /// <summary> + /// The <see cref="Detail"/> property value. + /// </summary> EvasObject _detail; + /// <summary> + /// The main widget - either <see cref="_splitPlane"/> or <see cref="_detailPage"/>, depending on the mode. + /// </summary> EvasObject _mainWidget; + /// <summary> + /// The <see cref="IsPresented"/> property value. + /// </summary> bool _isPresented; + /// <summary> + /// The <see cref="IsGestureEnabled"/> property value. + /// </summary> bool _isGestureEnabled; + /// <summary> + /// Initializes a new instance of the <see cref="Xamarin.Forms.Platform.Tizen.Native.MasterDetailPage"/> class. + /// </summary> + /// <param name="parent">Parent evas object.</param> public MasterDetailPage(EvasObject parent) : base(parent) { // we control the layout ourselves @@ -100,8 +149,15 @@ namespace Xamarin.Forms.Platform.Tizen.Native }; } + /// <summary> + /// Occurs when the MasterPage is shown or hidden. + /// </summary> public event EventHandler IsPresentedChanged; + /// <summary> + /// Gets or sets the MasterDetailPage behavior. + /// </summary> + /// <value>The behavior of the <c>MasterDetailPage</c> requested by the user.</value> public MasterBehavior MasterBehavior { get @@ -120,6 +176,10 @@ namespace Xamarin.Forms.Platform.Tizen.Native } } + /// <summary> + /// Gets or sets the content of the MasterPage. + /// </summary> + /// <value>The MasterPage.</value> public EvasObject Master { get @@ -139,6 +199,10 @@ namespace Xamarin.Forms.Platform.Tizen.Native } } + /// <summary> + /// Gets or sets the content of the DetailPage. + /// </summary> + /// <value>The DetailPage.</value> public EvasObject Detail { get @@ -158,6 +222,10 @@ namespace Xamarin.Forms.Platform.Tizen.Native } } + /// <summary> + /// Gets or sets a value indicating whether the MasterPage is shown. + /// </summary> + /// <value><c>true</c> if the MasterPage is presented.</value> public bool IsPresented { get @@ -175,6 +243,10 @@ namespace Xamarin.Forms.Platform.Tizen.Native } } + /// <summary> + /// Gets or sets a value indicating whether a MasterDetailPage allows showing MasterPage with swipe gesture. + /// </summary> + /// <value><c>true</c> if the MasterPage can be revealed with a gesture.</value> public bool IsGestureEnabled { get @@ -192,6 +264,10 @@ namespace Xamarin.Forms.Platform.Tizen.Native } } + /// <summary> + /// Updates the geometry of the selected page. + /// </summary> + /// <param name="page">Master or Detail page to be updated.</param> void UpdatePageGeometry(EvasObject page) { if (page != null) @@ -209,10 +285,14 @@ namespace Xamarin.Forms.Platform.Tizen.Native } } + /// <summary> + /// Updates <see cref="_internalMasterBehavior"/> according to <see cref="MasterDetailBehavior"/> set by the user and current screen orientation. + /// </summary> void UpdateMasterBehavior() { var behavior = (_masterBehavior == MasterBehavior.Default) ? s_defaultMasterBehavior : _masterBehavior; + // Screen orientation affects those 2 behaviors if (behavior == MasterBehavior.SplitOnLandscape || behavior == MasterBehavior.SplitOnPortrait) { @@ -237,6 +317,9 @@ namespace Xamarin.Forms.Platform.Tizen.Native } } + /// <summary> + /// Composes the structure of all the necessary widgets. + /// </summary> void ConfigureLayout() { _drawer.SetContent(null, true); @@ -248,6 +331,7 @@ namespace Xamarin.Forms.Platform.Tizen.Native UnPackAll(); + // the structure for split mode and for popover mode looks differently if (_internalMasterBehavior == MasterBehavior.Split) { _splitPane.SetPartContent("left", _masterCanvas, true); |