From 28b8e6e1dee0589eb63afbf224a59bcffc3a0dc5 Mon Sep 17 00:00:00 2001 From: "sung-su.kim" Date: Thu, 19 Jan 2017 14:26:06 +0900 Subject: [PATCH] Add description for Background and Cells Change-Id: I32d1ec54cb398c1234f9c58c88459e79197afb47 --- Tizen.Xamarin.Forms.Extension/Background.cs | 18 ++++++ Tizen.Xamarin.Forms.Extension/BackgroundOptions.cs | 15 +++++ .../Cells/BaseTypeCell.cs | 67 ++++++++++++++++++++++ .../Cells/DoubleLabelCell.cs | 64 +++++++++++++++++++++ .../Cells/MultilineCell.cs | 63 +++++++++++++++++++- Tizen.Xamarin.Forms.Extension/Cells/Type1Cell.cs | 36 ++++++++++++ Tizen.Xamarin.Forms.Extension/Cells/Type2Cell.cs | 37 ++++++++++++ Tizen.Xamarin.Forms.Extension/RadioButton.cs | 41 +++++-------- 8 files changed, 313 insertions(+), 28 deletions(-) diff --git a/Tizen.Xamarin.Forms.Extension/Background.cs b/Tizen.Xamarin.Forms.Extension/Background.cs index d4e66a7..841be01 100755 --- a/Tizen.Xamarin.Forms.Extension/Background.cs +++ b/Tizen.Xamarin.Forms.Extension/Background.cs @@ -2,18 +2,36 @@ using Xamarin.Forms; namespace Tizen.Xamarin.Forms.Extension { + /// + /// Background class provides the properties for Background. + /// + /// + /// + /// new Background + /// { + /// Image = new FileImageSource { File = "icon.png" }, + /// Option = BackgroundOptions.Tile, + /// } + /// + /// public class Background : View { public static readonly BindableProperty ImageProperty = BindableProperty.Create("Image", typeof(FileImageSource), typeof(Background), default(FileImageSource)); public static readonly BindableProperty OptionProperty = BindableProperty.Create("Option", typeof(BackgroundOptions), typeof(Background), BackgroundOptions.Scale); + /// + /// Gets or Sets the Image on the background. This identifier is the image path to the image. + /// public FileImageSource Image { get { return (FileImageSource)GetValue(ImageProperty); } set { SetValue(ImageProperty, value); } } + /// + /// Gets or Sets the BackgroundOption on the background. This identifiers on how a background is to display its image. + /// public BackgroundOptions Option { get { return (BackgroundOptions)GetValue(OptionProperty); } diff --git a/Tizen.Xamarin.Forms.Extension/BackgroundOptions.cs b/Tizen.Xamarin.Forms.Extension/BackgroundOptions.cs index bb5cdc3..20af6b3 100755 --- a/Tizen.Xamarin.Forms.Extension/BackgroundOptions.cs +++ b/Tizen.Xamarin.Forms.Extension/BackgroundOptions.cs @@ -1,10 +1,25 @@ namespace Tizen.Xamarin.Forms.Extension { + /// + /// Enumeration of identifiers on how a background widget is to display its image, if it is set to use an image file. + /// public enum BackgroundOptions { + /// + /// Center the background image + /// Center, + /// + /// Scale the background image, retaining the aspect ratio + /// Scale, + /// + /// Stretch the background image to fill the widget's area + /// Stretch, + /// + /// Tile background image at its original size + /// Tile } } diff --git a/Tizen.Xamarin.Forms.Extension/Cells/BaseTypeCell.cs b/Tizen.Xamarin.Forms.Extension/Cells/BaseTypeCell.cs index 5eeaa37..d26429c 100644 --- a/Tizen.Xamarin.Forms.Extension/Cells/BaseTypeCell.cs +++ b/Tizen.Xamarin.Forms.Extension/Cells/BaseTypeCell.cs @@ -3,6 +3,43 @@ using Xamarin.Forms; namespace Tizen.Xamarin.Forms.Extension { + /// + /// BaseTypeCell containing Text, TextEnd, Sub, Icon and Checkbox(IsCheckVisible). + /// + /// + /// BaseTypeCell is a abstract class inherited from a cell.
+ /// Type1Cell Class and Type2Cell Class are used to inherit this class.
+ /// Properties are used equally and are only slightly different position.
+ /// Each property is displayed in the specified position.
+ /// The specified position is shown below.
+ ///
+ /// Type1Cell + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + ///
Icon Text TextEndCheckBox
Sub
+ ///
+ /// Type2Cell + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + ///
Icon Sub CheckBox
Text TextEnd
+ /// Type2Cell is almost same with Type1Cell except for the position of sub line. + ///
public abstract class BaseTypeCell : Cell { public static readonly BindableProperty TextProperty = BindableProperty.Create("Text", typeof(string), typeof(BaseTypeCell), default(string)); @@ -27,6 +64,9 @@ namespace Tizen.Xamarin.Forms.Extension public static readonly BindableProperty IconHeightProperty = BindableProperty.Create("IconHeight", typeof(int), typeof(MultilineCell), 0); + /// + /// BaseTypeCell's constructor + /// public BaseTypeCell() { Disappearing += (sender, e) => @@ -35,24 +75,36 @@ namespace Tizen.Xamarin.Forms.Extension }; } + /// + /// Gets or sets the the Text displayed as the content of Item. + /// public string Text { get { return (string)GetValue(TextProperty); } set { SetValue(TextProperty, value); } } + /// + /// Gets or sets the the TextEnd displayed as the content of Item. + /// public string TextEnd { get { return (string)GetValue(TextEndProperty); } set { SetValue(TextEndProperty, value); } } + /// + /// Gets or sets the the Sub displayed as the content of Item. + /// public string Sub { get { return (string)GetValue(SubProperty); } set { SetValue(SubProperty, value); } } + /// + /// Gets or sets the Image on the left side of the item + /// [TypeConverter(typeof(ImageSourceConverter))] public ImageSource Icon { @@ -60,30 +112,45 @@ namespace Tizen.Xamarin.Forms.Extension set { SetValue(IconProperty, value); } } + /// + /// true or false, to indicate whether the checkbox is displayed on the right side of the item + /// public bool IsCheckVisible { get { return (bool)GetValue(IsCheckVisibleProperty); } set { SetValue(IsCheckVisibleProperty, value); } } + /// + /// true or false, to indicate whether the checkbox has been toggled. + /// public bool IsChecked { get { return (bool)GetValue(IsCheckedProperty); } set { SetValue(IsCheckedProperty, value); } } + /// + /// Gets or sets the Icon's width + /// public int IconWidth { get { return (int)GetValue(IconWidthProperty); } set { SetValue(IconWidthProperty, value); } } + /// + /// Gets or sets the Icon's height + /// public int IconHeight { get { return (int)GetValue(IconHeightProperty); } set { SetValue(IconHeightProperty, value); } } + /// + /// Event that is raised when checkbox is toggled. + /// public event EventHandler Toggled; void OnSourcePropertyChanged(ImageSource oldvalue, ImageSource newvalue) diff --git a/Tizen.Xamarin.Forms.Extension/Cells/DoubleLabelCell.cs b/Tizen.Xamarin.Forms.Extension/Cells/DoubleLabelCell.cs index 58d2409..23948e5 100644 --- a/Tizen.Xamarin.Forms.Extension/Cells/DoubleLabelCell.cs +++ b/Tizen.Xamarin.Forms.Extension/Cells/DoubleLabelCell.cs @@ -2,6 +2,43 @@ using Xamarin.Forms; namespace Tizen.Xamarin.Forms.Extension { + /// + /// DoubleLabelCell containing Text, Sub, Icon and End. + /// + /// + /// DoubleLabelCell is a class inherited from a cell.
+ /// Each property is displayed in the specified position.
+ /// The specified position is shown below.
+ ///
+ /// + /// + /// + /// + /// + /// + /// + /// + /// + ///
IconTextEnd
Sub
+ ///
+ /// + /// + /// new DataTemplate(() => + /// { + /// return new DoubleLabelCell + /// { + /// Text = "Test Text", + /// Sub = "Test Sub", + /// Icon = ImageSource.FromFile("icon.png"), + /// End = ImageSource.FromFile("end.png"), + /// IconWidth = 80, + /// IconHeight = 100, + /// EndWidth = 80, + /// EndHeight = 100, + /// }; + /// }); + /// + /// public class DoubleLabelCell : Cell { public static readonly BindableProperty TextProperty = BindableProperty.Create("Text", typeof(string), typeof(DoubleLabelCell), default(string)); @@ -22,6 +59,9 @@ namespace Tizen.Xamarin.Forms.Extension public static readonly BindableProperty EndHeightProperty = BindableProperty.Create("EndHeight", typeof(int), typeof(DoubleLabelCell), 0); + /// + /// MultilineCell's constructor + /// public DoubleLabelCell() { Disappearing += (sender, e) => @@ -30,18 +70,27 @@ namespace Tizen.Xamarin.Forms.Extension }; } + /// + /// Gets or sets the text from the central top of the item + /// public string Text { get { return (string)GetValue(TextProperty); } set { SetValue(TextProperty, value); } } + /// + /// Gets or sets the sub from the central bottom of the item + /// public string Sub { get { return (string)GetValue(SubProperty); } set { SetValue(SubProperty, value); } } + /// + /// Gets or sets the Image on the left side of the item + /// [TypeConverter(typeof(ImageSourceConverter))] public ImageSource Icon { @@ -49,18 +98,27 @@ namespace Tizen.Xamarin.Forms.Extension set { SetValue(IconProperty, value); } } + /// + /// Gets or sets the Icon's width + /// public int IconWidth { get { return (int)GetValue(IconWidthProperty); } set { SetValue(IconWidthProperty, value); } } + /// + /// Gets or sets the Icon's height + /// public int IconHeight { get { return (int)GetValue(IconHeightProperty); } set { SetValue(IconHeightProperty, value); } } + /// + /// Gets or sets the Image on the right side of the item + /// [TypeConverter(typeof(ImageSourceConverter))] public ImageSource End { @@ -68,12 +126,18 @@ namespace Tizen.Xamarin.Forms.Extension set { SetValue(EndProperty, value); } } + /// + /// Gets or sets the End's width + /// public int EndWidth { get { return (int)GetValue(EndWidthProperty); } set { SetValue(EndWidthProperty, value); } } + /// + /// Gets or sets the End's width + /// public int EndHeight { get { return (int)GetValue(IconHeightProperty); } diff --git a/Tizen.Xamarin.Forms.Extension/Cells/MultilineCell.cs b/Tizen.Xamarin.Forms.Extension/Cells/MultilineCell.cs index f0f03e2..4b8ecef 100644 --- a/Tizen.Xamarin.Forms.Extension/Cells/MultilineCell.cs +++ b/Tizen.Xamarin.Forms.Extension/Cells/MultilineCell.cs @@ -3,6 +3,41 @@ using Xamarin.Forms; namespace Tizen.Xamarin.Forms.Extension { + /// + /// MultilineCell containing Icons, Text, Multiline, and Checkbox(IsCheckVisible). + /// + /// + /// MultilineCell is a class inherited from a cell.
+ /// Each property is displayed in the specified position.
+ /// The specified position is shown below.
+ ///
+ /// + /// + /// + /// + /// + /// + /// + /// + /// + ///
Icon Text Checkbox
Multiline
+ ///
+ /// + /// + /// new DataTemplate(() => + /// { + /// return new MultilineCell + /// { + /// Text = "Test Text", + /// Multiline = "Test Multiline", + /// Icon = ImageSource.FromFile("icon.png"), + /// IsCheckVisible = true, + /// IconWidth = 80, + /// IconHeight = 100, + /// }; + /// }); + /// + /// public class MultilineCell : Cell { public static readonly BindableProperty TextProperty = BindableProperty.Create("Text", typeof(string), typeof(MultilineCell), default(string)); @@ -25,7 +60,9 @@ namespace Tizen.Xamarin.Forms.Extension public static readonly BindableProperty IconHeightProperty = BindableProperty.Create("IconHeight", typeof(int), typeof(MultilineCell), 0); - + /// + /// MultilineCell's constructor + /// public MultilineCell() { Disappearing += (sender, e) => @@ -34,18 +71,27 @@ namespace Tizen.Xamarin.Forms.Extension }; } + /// + /// Gets or sets the text from the central top of the item + /// public string Text { get { return (string)GetValue(TextProperty); } set { SetValue(TextProperty, value); } } + /// + /// Gets or sets the Multiline from the central bottom of the item + /// public string Multiline { get { return (string)GetValue(MultilineProperty); } set { SetValue(MultilineProperty, value); } } + /// + /// Gets or sets the Image on the left side of the item + /// [TypeConverter(typeof(ImageSourceConverter))] public ImageSource Icon { @@ -53,30 +99,45 @@ namespace Tizen.Xamarin.Forms.Extension set { SetValue(IconProperty, value); } } + /// + /// true or false, to indicate whether the checkbox is displayed on the right side of the item + /// public bool IsCheckVisible { get { return (bool)GetValue(IsCheckVisibleProperty); } set { SetValue(IsCheckVisibleProperty, value); } } + /// + /// true or false, to indicate whether the checkbox has been toggled. + /// public bool IsChecked { get { return (bool)GetValue(IsCheckedProperty); } set { SetValue(IsCheckedProperty, value); } } + /// + /// Gets or sets the Icon's width + /// public int IconWidth { get { return (int)GetValue(IconWidthProperty); } set { SetValue(IconWidthProperty, value); } } + /// + /// Gets or sets the Icon's Height + /// public int IconHeight { get { return (int)GetValue(IconHeightProperty); } set { SetValue(IconHeightProperty, value); } } + /// + /// Event that is raised when checkbox is toggled. + /// public event EventHandler Toggled; void OnSourcePropertyChanged(ImageSource oldvalue, ImageSource newvalue) diff --git a/Tizen.Xamarin.Forms.Extension/Cells/Type1Cell.cs b/Tizen.Xamarin.Forms.Extension/Cells/Type1Cell.cs index 88e8e50..9beb190 100644 --- a/Tizen.Xamarin.Forms.Extension/Cells/Type1Cell.cs +++ b/Tizen.Xamarin.Forms.Extension/Cells/Type1Cell.cs @@ -2,6 +2,42 @@ using Xamarin.Forms; namespace Tizen.Xamarin.Forms.Extension { + /// + /// Type1Cell is a class inherited from a BaseTypeCell. + /// + /// + /// Each property is displayed in the specified position.
+ /// The specified position is shown below.
+ ///
+ /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + ///
Icon Text TextEndCheckBox
Sub
+ ///
+ /// + /// + /// new DataTemplate(() => + /// { + /// return new Type1Cell + /// { + /// Text = "Test Text", + /// TextEnd = "TestEnd Text", + /// Sub = "Test Sub", + /// Icon = ImageSource.FromFile("icon.png"), + /// IsCheckVisible = true, + /// IconWidth = 80, + /// IconHeight = 100, + /// }; + /// }); + /// + /// public class Type1Cell : BaseTypeCell { } diff --git a/Tizen.Xamarin.Forms.Extension/Cells/Type2Cell.cs b/Tizen.Xamarin.Forms.Extension/Cells/Type2Cell.cs index b185e48..9ef36dd 100644 --- a/Tizen.Xamarin.Forms.Extension/Cells/Type2Cell.cs +++ b/Tizen.Xamarin.Forms.Extension/Cells/Type2Cell.cs @@ -2,6 +2,43 @@ using Xamarin.Forms; namespace Tizen.Xamarin.Forms.Extension { + /// + /// Type2Cell is a class inherited from a BaseTypeCell. + /// + /// + /// Each property is displayed in the specified position.
+ /// The specified position is shown below.
+ ///
+ /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + ///
Icon Sub CheckBox
Text TextEnd
+ /// Type2Cell is almost same with Type1Cell except for the position of sub line. + ///
+ /// + /// + /// new DataTemplate(() => + /// { + /// return new Type2Cell + /// { + /// Text = "Test Text", + /// TextEnd = "TestEnd Text", + /// Sub = "Test Sub", + /// Icon = ImageSource.FromFile("icon.png"), + /// IsCheckVisible = true, + /// IconWidth = 80, + /// IconHeight = 100, + /// }; + /// }); + /// + /// public class Type2Cell : BaseTypeCell { } diff --git a/Tizen.Xamarin.Forms.Extension/RadioButton.cs b/Tizen.Xamarin.Forms.Extension/RadioButton.cs index 20b30db..8d51f73 100755 --- a/Tizen.Xamarin.Forms.Extension/RadioButton.cs +++ b/Tizen.Xamarin.Forms.Extension/RadioButton.cs @@ -6,52 +6,39 @@ namespace Tizen.Xamarin.Forms.Extension /// /// The RadioButton is a widget that allows for 1 or more options to be displayed and have the user choose only 1 of them. /// + /// + /// + /// var radioButton = new RadioButton + /// { + /// Text = "Radio 1", + /// GroupName = "Group 1", + /// IsSelected = false, + /// } + /// radioButton.Selected += (s,e) => { ... }; + /// + /// public class RadioButton : View { - /// - /// BindableProperty. Backing store for the Text bindable property. - /// public static readonly BindableProperty TextProperty = BindableProperty.Create("Text", typeof(string), typeof(RadioButton), default(string)); - /// - /// BindableProperty. Backing store for the TextColor bindable property. - /// public static readonly BindableProperty TextColorProperty = BindableProperty.Create("TextColor", typeof(Color), typeof(RadioButton), Color.Default); - /// - /// BindableProperty. Backing store for the Font bindable property. - /// public static readonly BindableProperty FontProperty = BindableProperty.Create("Font", typeof(Font), typeof(RadioButton), default(Font), propertyChanged: FontStructPropertyChanged); - /// - /// BindableProperty. Backing store for the FontFamily bindable property. - /// public static readonly BindableProperty FontFamilyProperty = BindableProperty.Create("FontFamily", typeof(string), typeof(RadioButton), default(string), propertyChanged: SpecificFontPropertyChanged); - /// - /// BindableProperty. Backing store for the FontSize bindable property. - /// public static readonly BindableProperty FontSizeProperty = BindableProperty.Create("FontSize", typeof(double), typeof(RadioButton), -1.0, propertyChanged: SpecificFontPropertyChanged, defaultValueCreator: bindable => Device.GetNamedSize(NamedSize.Default, (RadioButton)bindable)); - /// - /// BindableProperty. Backing store for the FontAttributes bindable property. - /// public static readonly BindableProperty FontAttributesProperty = BindableProperty.Create("FontAttributes", typeof(FontAttributes), typeof(RadioButton), FontAttributes.None, propertyChanged: SpecificFontPropertyChanged); - /// - /// BindableProperty. Backing store for the IsSelected bindable property. - /// public static readonly BindableProperty IsSelectedProperty = BindableProperty.Create("IsSelected", typeof(bool), typeof(RadioButton), false, propertyChanged: IsSelectedPropertyChanged); - /// - /// BindableProperty. Backing store for the GroupName bindable property. - /// public static readonly BindableProperty GroupNameProperty = BindableProperty.Create("GroupName", typeof(string), typeof(RadioButton), default(string)); /// @@ -82,7 +69,7 @@ namespace Tizen.Xamarin.Forms.Extension } /// - /// Gets the font family to which the font for the RadioButton text belongs. + /// Gets or sets the font family to which the font for the RadioButton text belongs. /// public string FontFamily { @@ -100,7 +87,7 @@ namespace Tizen.Xamarin.Forms.Extension } /// - /// Gets a value that indicates whether the font for the RadioButton text is bold, italic, or neither. + /// Gets or sets a value that indicates whether the font for the RadioButton text is bold, italic, or neither. /// public FontAttributes FontAttributes { @@ -118,7 +105,7 @@ namespace Tizen.Xamarin.Forms.Extension } /// - /// Gets or sets a Boolean value that indicates whether this RadioButton is Selected. + /// Gets or sets a Boolean value that indicates whether this RadioButton is selected. /// public bool IsSelected { -- 2.7.4