Enhance document in CalendarView, dialog 35/125035/1
authorSeunghyun Choi <sh4682.choi@samsung.com>
Thu, 13 Apr 2017 11:22:00 +0000 (20:22 +0900)
committerSeunghyun Choi <sh4682.choi@samsung.com>
Thu, 13 Apr 2017 11:22:07 +0000 (20:22 +0900)
 - Add document to BindableProperty
 - Add document for the Dialog's Buttons
 - Fixed Defect(null Exception) in CalendarView

Change-Id: I2acdae3a859685e9c9a50c6d155ee4d598cc6a42
Signed-off-by: Seunghyun Choi <sh4682.choi@samsung.com>
Tizen.Xamarin.Forms.Extension/CalendarView.cs
Tizen.Xamarin.Forms.Extension/Dialog.cs

index ffa466c..a5fb393 100644 (file)
@@ -19,6 +19,9 @@ namespace Tizen.Xamarin.Forms.Extension
     /// </example>
     public class CalendarView : View
     {
+        /// <summary>
+        /// BindableProperty.Identifies the MinimumDate bindable property.
+        /// </summary>
         public static readonly BindableProperty MinimumDateProperty = BindableProperty.Create(nameof(MinimumDate), typeof(DateTime), typeof(CalendarView), new DateTime(1902, 1, 1), coerceValue: (bindable, value) =>
         {
             DateTime dateTime = (DateTime)value;
@@ -29,6 +32,9 @@ namespace Tizen.Xamarin.Forms.Extension
             return dateTime;
         });
 
+        /// <summary>
+        /// BindableProperty.Identifies the MaximumDate bindable property.
+        /// </summary>
         public static readonly BindableProperty MaximumDateProperty = BindableProperty.Create(nameof(MaximumDate), typeof(DateTime), typeof(CalendarView), new DateTime(2037, 12, 31), coerceValue: (bindable, value) =>
         {
             DateTime dateTime = (DateTime)value;
@@ -39,16 +45,32 @@ namespace Tizen.Xamarin.Forms.Extension
             return dateTime;
         });
 
+        /// <summary>
+        /// BindableProperty.Identifies the FirstDayOfWeek bindable property.
+        /// </summary>
         public static readonly BindableProperty FirstDayOfWeekProperty = BindableProperty.Create(nameof(FirstDayOfWeek), typeof(DayOfWeek), typeof(CalendarView), DayOfWeek.Sunday);
 
+        /// <summary>
+        /// BindableProperty.Identifies the WeekDayNames bindable property.
+        /// </summary>
         public static readonly BindableProperty WeekDayNamesProperty = BindableProperty.Create(nameof(WeekDayNames), typeof(IReadOnlyList<string>), typeof(CalendarView), new List<string> { "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" }, validateValue: (bindable, value) =>
         {
             List<string> weekDayNames = (List<string>)value;
-            int count = weekDayNames.Count;
+            if (weekDayNames != null)
+            {
+                int count = weekDayNames.Count;
 
-            return (count == 7);
+                return (count == 7);
+            }
+            else
+            {
+                return false;
+            }
         });
 
+        /// <summary>
+        /// BindableProperty.Identifies the SelectedDate bindable property.
+        /// </summary>
         public static readonly BindableProperty SelectedDateProperty = BindableProperty.Create(nameof(SelectedDate), typeof(DateTime), typeof(CalendarView), DateTime.Today, defaultBindingMode: BindingMode.TwoWay, propertyChanged: (bindable, oldValue, newValue) =>
         {
             ((CalendarView)bindable).SelectedDateChanged?.Invoke(bindable, new DateChangedEventArgs((DateTime)oldValue, (DateTime)newValue));
index 9d7699a..ca76813 100644 (file)
@@ -4,7 +4,7 @@ using Xamarin.Forms;
 namespace Tizen.Xamarin.Forms.Extension
 {
     /// <summary>
-    /// The dialog widget displays its content with a particular direction.
+    /// The dialog widget displays its content with buttons and title.
     /// </summary>
     /// <example>
     /// <code>
@@ -40,16 +40,34 @@ namespace Tizen.Xamarin.Forms.Extension
     /// </example>
     public class Dialog : BindableObject
     {
+        /// <summary>
+        /// BindableProperty.Identifies the Content bindable property.
+        /// </summary>
         public static readonly BindableProperty ContentProperty = BindableProperty.Create(nameof(Content), typeof(View), typeof(Dialog), null);
 
+        /// <summary>
+        /// BindableProperty.Identifies the Positive bindable property.
+        /// </summary>
         public static readonly BindableProperty PositiveProperty = BindableProperty.Create(nameof(Positive), typeof(Button), typeof(Dialog), null);
 
+        /// <summary>
+        /// BindableProperty.Identifies the Neutral bindable property.
+        /// </summary>
         public static readonly BindableProperty NeutralProperty = BindableProperty.Create(nameof(Neutral), typeof(Button), typeof(Dialog), null);
 
+        /// <summary>
+        /// BindableProperty.Identifies the Negative bindable property.
+        /// </summary>
         public static readonly BindableProperty NegativeProperty = BindableProperty.Create(nameof(Negative), typeof(Button), typeof(Dialog), null);
 
+        /// <summary>
+        /// BindableProperty.Identifies the Title bindable property.
+        /// </summary>
         public static readonly BindableProperty TitleProperty = BindableProperty.Create(nameof(Title), typeof(string), typeof(Dialog), null);
 
+        /// <summary>
+        /// BindableProperty.Identifies the Subtitle bindable property.
+        /// </summary>
         public static readonly BindableProperty SubtitleProperty = BindableProperty.Create(nameof(Subtitle), typeof(string), typeof(Dialog), null);
 
         IDialog _dialog = null;
@@ -121,6 +139,9 @@ namespace Tizen.Xamarin.Forms.Extension
 
         /// <summary>
         /// Gets or sets positive button of the Dialog.
+        /// This button is on the Left.
+        /// When used alone, it is variable in size.(Can increase to the size of dialog)
+        /// Dialog's all buttons style is bottom
         /// </summary>
         public Button Positive
         {
@@ -130,6 +151,8 @@ namespace Tizen.Xamarin.Forms.Extension
 
         /// <summary>
         /// Gets or sets neutral button of the Dialog.
+        /// This button is on the center.
+        /// When used alone or used with Positive, its size is half the size of the dialog and is on the right.
         /// </summary>
         public Button Neutral
         {
@@ -139,6 +162,7 @@ namespace Tizen.Xamarin.Forms.Extension
 
         /// <summary>
         /// Gets or sets negative button of the Dialog.
+        /// This button is always on the right and is displayed at a fixed size.
         /// </summary>
         public Button Negative
         {