From d9ba98cb47f0120ddb1aad55315ac310ea4d61cb Mon Sep 17 00:00:00 2001 From: Fang Xiaohui Date: Wed, 13 Oct 2021 14:53:46 +0800 Subject: [PATCH] [NUI] Add bindable properties to Components. --- .../Controls/AlertDialog.cs | 62 ++- .../Controls/AlertDialogBindableProperty.cs | 99 ++++ src/Tizen.NUI.Components/Controls/Button.cs | 156 ++++++ .../Controls/ButtonBindableProperty.cs | 242 +++++++++ src/Tizen.NUI.Components/Controls/Control.cs | 30 ++ .../Controls/DatePicker.cs | 31 ++ src/Tizen.NUI.Components/Controls/Dialog.cs | 31 ++ .../Controls/FlexibleView/FlexibleView.cs | 61 +++ .../Controls/ImageScrollBar.cs | 50 +- src/Tizen.NUI.Components/Controls/Loading.cs | 30 ++ src/Tizen.NUI.Components/Controls/Menu.cs | 38 +- .../Controls/MenuBindableProperty.cs | 63 +++ .../Controls/Navigation/AppBar.cs | 62 ++- .../Navigation/AppBarBindableProperty.cs | 99 ++++ .../Controls/Navigation/ContentPage.cs | 26 +- .../Navigation/ContentPageBindableProperty.cs | 46 ++ .../Controls/Navigation/DialogPage.cs | 52 +- .../Navigation/DialogPageBindableProperty.cs | 81 +++ .../Controls/Navigation/Navigator.cs | 31 ++ .../Controls/Navigation/Page.cs | 61 +++ .../Controls/Pagination.cs | 62 ++- .../Controls/PaginationBindableProperty.cs | 99 ++++ src/Tizen.NUI.Components/Controls/Picker.cs | 38 +- .../Controls/PickerBindableProperty.cs | 62 +++ src/Tizen.NUI.Components/Controls/Popup.cs | 86 +++- .../Controls/PopupBindableProperty.cs | 134 +++++ src/Tizen.NUI.Components/Controls/Progress.cs | 86 +++- .../Controls/ProgressBindableProperty.cs | 134 +++++ .../Controls/RecyclerView/CollectionView.cs | 126 ++++- .../CollectionViewBindableProperty.cs | 189 +++++++ .../RecyclerView/Item/DefaultGridItem.cs | 38 +- .../Item/DefaultGridItemBindableProperty.cs | 63 +++ .../RecyclerView/Item/DefaultLinearItem.cs | 50 +- .../Item/DefaultLinearItemBindableProperty.cs | 81 +++ .../RecyclerView/Item/DefaultTitleItem.cs | 26 +- .../Item/DefaultTitleItemBindableProperty.cs | 45 ++ .../Controls/RecyclerView/RecyclerView.cs | 64 ++- .../Controls/ScrollBarBindableProperty.cs | 80 +++ .../Controls/ScrollableBase.cs | 204 +++++++- .../ScrollableBaseBindableProperty.cs | 296 +++++++++++ src/Tizen.NUI.Components/Controls/Slider.cs | 310 +++++++++++- .../Controls/SliderBindableProperty.cs | 460 ++++++++++++++++++ src/Tizen.NUI.Components/Controls/Switch.cs | 50 +- .../Controls/SwitchBindableProperty.cs | 81 +++ src/Tizen.NUI.Components/Controls/Tab.cs | 134 ++++- .../Controls/TabBindableProperty.cs | 207 ++++++++ .../Controls/TimePicker.cs | 61 +++ src/Tizen.NUI.Components/Controls/Toast.cs | 102 +++- .../Controls/ToastBindableProperty.cs | 153 ++++++ 49 files changed, 4837 insertions(+), 35 deletions(-) create mode 100755 src/Tizen.NUI.Components/Controls/AlertDialogBindableProperty.cs create mode 100755 src/Tizen.NUI.Components/Controls/ButtonBindableProperty.cs mode change 100644 => 100755 src/Tizen.NUI.Components/Controls/Dialog.cs create mode 100755 src/Tizen.NUI.Components/Controls/MenuBindableProperty.cs create mode 100755 src/Tizen.NUI.Components/Controls/Navigation/AppBarBindableProperty.cs create mode 100755 src/Tizen.NUI.Components/Controls/Navigation/ContentPageBindableProperty.cs create mode 100755 src/Tizen.NUI.Components/Controls/Navigation/DialogPageBindableProperty.cs create mode 100755 src/Tizen.NUI.Components/Controls/PaginationBindableProperty.cs create mode 100755 src/Tizen.NUI.Components/Controls/PickerBindableProperty.cs create mode 100755 src/Tizen.NUI.Components/Controls/PopupBindableProperty.cs create mode 100755 src/Tizen.NUI.Components/Controls/ProgressBindableProperty.cs create mode 100755 src/Tizen.NUI.Components/Controls/RecyclerView/CollectionViewBindableProperty.cs create mode 100755 src/Tizen.NUI.Components/Controls/RecyclerView/Item/DefaultGridItemBindableProperty.cs create mode 100755 src/Tizen.NUI.Components/Controls/RecyclerView/Item/DefaultLinearItemBindableProperty.cs create mode 100755 src/Tizen.NUI.Components/Controls/RecyclerView/Item/DefaultTitleItemBindableProperty.cs create mode 100755 src/Tizen.NUI.Components/Controls/ScrollBarBindableProperty.cs create mode 100755 src/Tizen.NUI.Components/Controls/ScrollableBaseBindableProperty.cs create mode 100755 src/Tizen.NUI.Components/Controls/SliderBindableProperty.cs mode change 100644 => 100755 src/Tizen.NUI.Components/Controls/Switch.cs create mode 100755 src/Tizen.NUI.Components/Controls/SwitchBindableProperty.cs create mode 100755 src/Tizen.NUI.Components/Controls/TabBindableProperty.cs create mode 100755 src/Tizen.NUI.Components/Controls/ToastBindableProperty.cs diff --git a/src/Tizen.NUI.Components/Controls/AlertDialog.cs b/src/Tizen.NUI.Components/Controls/AlertDialog.cs index 9e3a60039..216acbe2b 100755 --- a/src/Tizen.NUI.Components/Controls/AlertDialog.cs +++ b/src/Tizen.NUI.Components/Controls/AlertDialog.cs @@ -26,7 +26,7 @@ namespace Tizen.NUI.Components /// AlertDialog class shows a dialog with title, message and action buttons. /// /// 9 - public class AlertDialog : Control + public partial class AlertDialog : Control { private string title = null; private string message = null; @@ -160,6 +160,18 @@ namespace Tizen.NUI.Components /// /// 9 public string Title + { + get + { + return GetValue(TitleProperty) as string; + } + set + { + SetValue(TitleProperty, value); + NotifyPropertyChanged(); + } + } + private string InternalTitle { get { @@ -189,6 +201,18 @@ namespace Tizen.NUI.Components /// /// 9 public View TitleContent + { + get + { + return GetValue(TitleContentProperty) as View; + } + set + { + SetValue(TitleContentProperty, value); + NotifyPropertyChanged(); + } + } + private View InternalTitleContent { get { @@ -228,6 +252,18 @@ namespace Tizen.NUI.Components /// /// 9 public string Message + { + get + { + return GetValue(MessageProperty) as string; + } + set + { + SetValue(MessageProperty, value); + NotifyPropertyChanged(); + } + } + private string InternalMessage { get { @@ -257,6 +293,18 @@ namespace Tizen.NUI.Components /// /// 9 public View Content + { + get + { + return GetValue(ContentProperty) as View; + } + set + { + SetValue(ContentProperty, value); + NotifyPropertyChanged(); + } + } + private View InternalContent { get { @@ -341,6 +389,18 @@ namespace Tizen.NUI.Components /// /// 9 public View ActionContent + { + get + { + return GetValue(ActionContentProperty) as View; + } + set + { + SetValue(ActionContentProperty, value); + NotifyPropertyChanged(); + } + } + private View InternalActionContent { get { diff --git a/src/Tizen.NUI.Components/Controls/AlertDialogBindableProperty.cs b/src/Tizen.NUI.Components/Controls/AlertDialogBindableProperty.cs new file mode 100755 index 000000000..d25c68dd4 --- /dev/null +++ b/src/Tizen.NUI.Components/Controls/AlertDialogBindableProperty.cs @@ -0,0 +1,99 @@ +using System.ComponentModel; +using Tizen.NUI.BaseComponents; +using Tizen.NUI.Binding; + +namespace Tizen.NUI.Components +{ + public partial class AlertDialog + { + /// + /// TitleProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty TitleProperty = BindableProperty.Create(nameof(Title), typeof(string), typeof(AlertDialog), default(string), propertyChanged: (bindable, oldValue, newValue) => + { + var instance = (AlertDialog)bindable; + if (newValue != null) + { + instance.InternalTitle = newValue as string; + } + }, + defaultValueCreator: (bindable) => + { + var instance = (AlertDialog)bindable; + return instance.InternalTitle; + }); + + /// + /// TitleContentProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty TitleContentProperty = BindableProperty.Create(nameof(TitleContent), typeof(View), typeof(AlertDialog), null, propertyChanged: (bindable, oldValue, newValue) => + { + var instance = (AlertDialog)bindable; + if (newValue != null) + { + instance.InternalTitleContent = newValue as View; + } + }, + defaultValueCreator: (bindable) => + { + var instance = (AlertDialog)bindable; + return instance.InternalTitleContent; + }); + + /// + /// MessageProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty MessageProperty = BindableProperty.Create(nameof(Message), typeof(string), typeof(AlertDialog), default(string), propertyChanged: (bindable, oldValue, newValue) => + { + var instance = (AlertDialog)bindable; + if (newValue != null) + { + instance.InternalMessage = newValue as string; + } + }, + defaultValueCreator: (bindable) => + { + var instance = (AlertDialog)bindable; + return instance.InternalMessage; + }); + + /// + /// ContentProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty ContentProperty = BindableProperty.Create(nameof(Content), typeof(View), typeof(AlertDialog), null, propertyChanged: (bindable, oldValue, newValue) => + { + var instance = (AlertDialog)bindable; + if (newValue != null) + { + instance.InternalContent = newValue as View; + } + }, + defaultValueCreator: (bindable) => + { + var instance = (AlertDialog)bindable; + return instance.InternalContent; + }); + + /// + /// ActionContentProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty ActionContentProperty = BindableProperty.Create(nameof(ActionContent), typeof(View), typeof(AlertDialog), null, propertyChanged: (bindable, oldValue, newValue) => + { + var instance = (AlertDialog)bindable; + if (newValue != null) + { + instance.InternalActionContent = newValue as View; + } + }, + defaultValueCreator: (bindable) => + { + var instance = (AlertDialog)bindable; + return instance.InternalActionContent; + }); + } +} diff --git a/src/Tizen.NUI.Components/Controls/Button.cs b/src/Tizen.NUI.Components/Controls/Button.cs index 05cec8ef2..d6e8305f4 100755 --- a/src/Tizen.NUI.Components/Controls/Button.cs +++ b/src/Tizen.NUI.Components/Controls/Button.cs @@ -353,6 +353,18 @@ namespace Tizen.NUI.Components /// /// 6 public string Text + { + get + { + return GetValue(TextProperty) as string; + } + set + { + SetValue(TextProperty, value); + NotifyPropertyChanged(); + } + } + private string InternalText { get { @@ -390,6 +402,18 @@ namespace Tizen.NUI.Components /// /// 6 public string TranslatableText + { + get + { + return GetValue(TranslatableTextProperty) as string; + } + set + { + SetValue(TranslatableTextProperty, value); + NotifyPropertyChanged(); + } + } + private string InternalTranslatableText { get { @@ -406,6 +430,18 @@ namespace Tizen.NUI.Components /// /// 6 public float PointSize + { + get + { + return (float)GetValue(PointSizeProperty); + } + set + { + SetValue(PointSizeProperty, value); + NotifyPropertyChanged(); + } + } + private float InternalPointSize { get { @@ -422,6 +458,18 @@ namespace Tizen.NUI.Components /// /// 6 public string FontFamily + { + get + { + return GetValue(FontFamilyProperty) as string; + } + set + { + SetValue(FontFamilyProperty, value); + NotifyPropertyChanged(); + } + } + private string InternalFontFamily { get { @@ -438,6 +486,18 @@ namespace Tizen.NUI.Components /// /// 6 public Color TextColor + { + get + { + return GetValue(TextColorProperty) as Color; + } + set + { + SetValue(TextColorProperty, value); + NotifyPropertyChanged(); + } + } + private Color InternalTextColor { get { @@ -454,6 +514,18 @@ namespace Tizen.NUI.Components /// /// 6 public HorizontalAlignment TextAlignment + { + get + { + return (HorizontalAlignment)GetValue(TextAlignmentProperty); + } + set + { + SetValue(TextAlignmentProperty, value); + NotifyPropertyChanged(); + } + } + private HorizontalAlignment InternalTextAlignment { get { @@ -470,6 +542,18 @@ namespace Tizen.NUI.Components /// /// 6 public string IconURL + { + get + { + return GetValue(IconURLProperty) as string; + } + set + { + SetValue(IconURLProperty, value); + NotifyPropertyChanged(); + } + } + private string InternalIconURL { get { @@ -486,6 +570,18 @@ namespace Tizen.NUI.Components /// [EditorBrowsable(EditorBrowsableState.Never)] public Size IconSize + { + get + { + return GetValue(IconSizeProperty) as Size; + } + set + { + SetValue(IconSizeProperty, value); + NotifyPropertyChanged(); + } + } + private Size InternalIconSize { get => Icon.Size; set => Icon.Size = value; @@ -498,6 +594,18 @@ namespace Tizen.NUI.Components /// /// 6 public StringSelector TextSelector + { + get + { + return GetValue(TextSelectorProperty) as StringSelector; + } + set + { + SetValue(TextSelectorProperty, value); + NotifyPropertyChanged(); + } + } + private StringSelector InternalTextSelector { get => buttonText == null ? null : new StringSelector(buttonText.TextSelector); set @@ -520,6 +628,18 @@ namespace Tizen.NUI.Components /// Thrown when setting null value. /// 6 public StringSelector TranslatableTextSelector + { + get + { + return GetValue(TranslatableTextSelectorProperty) as StringSelector; + } + set + { + SetValue(TranslatableTextSelectorProperty, value); + NotifyPropertyChanged(); + } + } + private StringSelector InternalTranslatableTextSelector { get => buttonText == null ? null : new StringSelector(buttonText.TranslatableTextSelector); set @@ -542,6 +662,18 @@ namespace Tizen.NUI.Components /// Thrown when setting null value. /// 6 public ColorSelector TextColorSelector + { + get + { + return GetValue(TextColorSelectorProperty) as ColorSelector; + } + set + { + SetValue(TextColorSelectorProperty, value); + NotifyPropertyChanged(); + } + } + private ColorSelector InternalTextColorSelector { get => buttonText == null ? null : new ColorSelector(buttonText.TextColorSelector); set @@ -564,6 +696,18 @@ namespace Tizen.NUI.Components /// Thrown when setting null value. /// 6 public FloatSelector PointSizeSelector + { + get + { + return GetValue(PointSizeSelectorProperty) as FloatSelector; + } + set + { + SetValue(PointSizeSelectorProperty, value); + NotifyPropertyChanged(); + } + } + private FloatSelector InternalPointSizeSelector { get => buttonText == null ? null : new FloatSelector(buttonText.PointSizeSelector); set @@ -586,6 +730,18 @@ namespace Tizen.NUI.Components /// Thrown when setting null value. /// 6 public StringSelector IconURLSelector + { + get + { + return GetValue(IconURLSelectorProperty) as StringSelector; + } + set + { + SetValue(IconURLSelectorProperty, value); + NotifyPropertyChanged(); + } + } + private StringSelector InternalIconURLSelector { get => buttonIcon == null ? null : new StringSelector(buttonIcon.ResourceUrlSelector); set diff --git a/src/Tizen.NUI.Components/Controls/ButtonBindableProperty.cs b/src/Tizen.NUI.Components/Controls/ButtonBindableProperty.cs new file mode 100755 index 000000000..9c35857e2 --- /dev/null +++ b/src/Tizen.NUI.Components/Controls/ButtonBindableProperty.cs @@ -0,0 +1,242 @@ +using System.ComponentModel; +using Tizen.NUI.Binding; + +namespace Tizen.NUI.Components +{ + public partial class Button + { + /// + /// TextProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty TextProperty = BindableProperty.Create(nameof(Text), typeof(string), typeof(Button), default(string), propertyChanged: (bindable, oldValue, newValue) => + { + var instance = (Button)bindable; + if (newValue != null) + { + instance.InternalText = newValue as string; + } + }, + defaultValueCreator: (bindable) => + { + var instance = (Button)bindable; + return instance.InternalText; + }); + + /// + /// TranslatableTextProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty TranslatableTextProperty = BindableProperty.Create(nameof(TranslatableText), typeof(string), typeof(Button), default(string), propertyChanged: (bindable, oldValue, newValue) => + { + var instance = (Button)bindable; + if (newValue != null) + { + instance.InternalTranslatableText = newValue as string; + } + }, + defaultValueCreator: (bindable) => + { + var instance = (Button)bindable; + return instance.InternalTranslatableText; + }); + + /// + /// PointSizeProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty PointSizeProperty = BindableProperty.Create(nameof(PointSize), typeof(float), typeof(Button), default(float), propertyChanged: (bindable, oldValue, newValue) => + { + var instance = (Button)bindable; + if (newValue != null) + { + instance.InternalPointSize = (float)newValue; + } + }, + defaultValueCreator: (bindable) => + { + var instance = (Button)bindable; + return instance.InternalPointSize; + }); + + /// + /// FontFamilyProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty FontFamilyProperty = BindableProperty.Create(nameof(FontFamily), typeof(string), typeof(Button), default(string), propertyChanged: (bindable, oldValue, newValue) => + { + var instance = (Button)bindable; + if (newValue != null) + { + instance.InternalFontFamily = newValue as string; + } + }, + defaultValueCreator: (bindable) => + { + var instance = (Button)bindable; + return instance.InternalFontFamily; + }); + + /// + /// TextColorProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty TextColorProperty = BindableProperty.Create(nameof(TextColor), typeof(Color), typeof(Button), null, propertyChanged: (bindable, oldValue, newValue) => + { + var instance = (Button)bindable; + if (newValue != null) + { + instance.InternalTextColor = newValue as Color; + } + }, + defaultValueCreator: (bindable) => + { + var instance = (Button)bindable; + return instance.InternalTextColor; + }); + + /// + /// TextAlignmentProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty TextAlignmentProperty = BindableProperty.Create(nameof(TextAlignment), typeof(HorizontalAlignment), typeof(Button), default(HorizontalAlignment), propertyChanged: (bindable, oldValue, newValue) => + { + var instance = (Button)bindable; + if (newValue != null) + { + instance.InternalTextAlignment = (HorizontalAlignment)newValue; + } + }, + defaultValueCreator: (bindable) => + { + var instance = (Button)bindable; + return instance.InternalTextAlignment; + }); + + /// + /// IconURLProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty IconURLProperty = BindableProperty.Create(nameof(IconURL), typeof(string), typeof(Button), default(string), propertyChanged: (bindable, oldValue, newValue) => + { + var instance = (Button)bindable; + if (newValue != null) + { + instance.InternalIconURL = newValue as string; + } + }, + defaultValueCreator: (bindable) => + { + var instance = (Button)bindable; + return instance.InternalIconURL; + }); + + /// + /// IconSizeProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty IconSizeProperty = BindableProperty.Create(nameof(IconSize), typeof(Size), typeof(Button), null, propertyChanged: (bindable, oldValue, newValue) => + { + var instance = (Button)bindable; + if (newValue != null) + { + instance.InternalIconSize = newValue as Size; + } + }, + defaultValueCreator: (bindable) => + { + var instance = (Button)bindable; + return instance.InternalIconSize; + }); + + /// + /// TextSelectorProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty TextSelectorProperty = BindableProperty.Create(nameof(TextSelector), typeof(StringSelector), typeof(Button), null, propertyChanged: (bindable, oldValue, newValue) => + { + var instance = (Button)bindable; + if (newValue != null) + { + instance.InternalTextSelector = newValue as StringSelector; + } + }, + defaultValueCreator: (bindable) => + { + var instance = (Button)bindable; + return instance.InternalTextSelector; + }); + + /// + /// TranslatableTextSelectorProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty TranslatableTextSelectorProperty = BindableProperty.Create(nameof(TranslatableTextSelector), typeof(StringSelector), typeof(Button), null, propertyChanged: (bindable, oldValue, newValue) => + { + var instance = (Button)bindable; + if (newValue != null) + { + instance.InternalTranslatableTextSelector = newValue as StringSelector; + } + }, + defaultValueCreator: (bindable) => + { + var instance = (Button)bindable; + return instance.InternalTranslatableTextSelector; + }); + + /// + /// TextColorSelectorProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty TextColorSelectorProperty = BindableProperty.Create(nameof(TextColorSelector), typeof(ColorSelector), typeof(Button), null, propertyChanged: (bindable, oldValue, newValue) => + { + var instance = (Button)bindable; + if (newValue != null) + { + instance.InternalTextColorSelector = newValue as ColorSelector; + } + }, + defaultValueCreator: (bindable) => + { + var instance = (Button)bindable; + return instance.InternalTextColorSelector; + }); + + /// + /// PointSizeSelectorProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty PointSizeSelectorProperty = BindableProperty.Create(nameof(PointSizeSelector), typeof(FloatSelector), typeof(Button), null, propertyChanged: (bindable, oldValue, newValue) => + { + var instance = (Button)bindable; + if (newValue != null) + { + instance.InternalPointSizeSelector = newValue as FloatSelector; + } + }, + defaultValueCreator: (bindable) => + { + var instance = (Button)bindable; + return instance.InternalPointSizeSelector; + }); + + /// + /// IconURLSelectorProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty IconURLSelectorProperty = BindableProperty.Create(nameof(IconURLSelector), typeof(StringSelector), typeof(Button), null, propertyChanged: (bindable, oldValue, newValue) => + { + var instance = (Button)bindable; + if (newValue != null) + { + instance.InternalIconURLSelector = newValue as StringSelector; + } + }, + defaultValueCreator: (bindable) => + { + var instance = (Button)bindable; + return instance.InternalIconURLSelector; + }); + } +} diff --git a/src/Tizen.NUI.Components/Controls/Control.cs b/src/Tizen.NUI.Components/Controls/Control.cs index 9e2da96cd..0c51794ad 100755 --- a/src/Tizen.NUI.Components/Controls/Control.cs +++ b/src/Tizen.NUI.Components/Controls/Control.cs @@ -32,6 +32,24 @@ namespace Tizen.NUI.Components [EditorBrowsable(EditorBrowsableState.Never)] public class Control : VisualView { + /// + /// FeedbackProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty FeedbackProperty = BindableProperty.Create(nameof(Feedback), typeof(bool), typeof(Control), default(bool), propertyChanged: (bindable, oldValue, newValue) => + { + var instance = (Control)bindable; + if (newValue != null) + { + instance.InternalFeedback = (bool)newValue; + } + }, + defaultValueCreator: (bindable) => + { + var instance = (Control)bindable; + return instance.InternalFeedback; + }); + /// Internal used. [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty CommandProperty = BindableProperty.Create(nameof(Command), typeof(ICommand), typeof(Control), null, propertyChanged: (bo, o, n) => ((Control)bo).OnCommandChanged()); @@ -99,6 +117,18 @@ namespace Tizen.NUI.Components /// [EditorBrowsable(EditorBrowsableState.Never)] public bool Feedback + { + get + { + return (bool)GetValue(FeedbackProperty); + } + set + { + SetValue(FeedbackProperty, value); + NotifyPropertyChanged(); + } + } + private bool InternalFeedback { get => feedback != null; set diff --git a/src/Tizen.NUI.Components/Controls/DatePicker.cs b/src/Tizen.NUI.Components/Controls/DatePicker.cs index e5e053738..c7223b42c 100755 --- a/src/Tizen.NUI.Components/Controls/DatePicker.cs +++ b/src/Tizen.NUI.Components/Controls/DatePicker.cs @@ -21,6 +21,7 @@ using System.Collections.ObjectModel; using System.ComponentModel; using System.Globalization; using System.Diagnostics.CodeAnalysis; +using Tizen.NUI.Binding; namespace Tizen.NUI.Components { @@ -57,6 +58,24 @@ namespace Tizen.NUI.Components /// 9 public class DatePicker : Control { + /// + /// DateProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty DateProperty = BindableProperty.Create(nameof(Date), typeof(DateTime), typeof(DatePicker), default(DateTime), propertyChanged: (bindable, oldValue, newValue) => + { + var instance = (DatePicker)bindable; + if (newValue != null) + { + instance.InternalDate = (DateTime)newValue; + } + }, + defaultValueCreator: (bindable) => + { + var instance = (DatePicker)bindable; + return instance.InternalDate; + }); + private DateTime currentDate; private Picker dayPicker; private Picker monthPicker; @@ -128,6 +147,18 @@ namespace Tizen.NUI.Components /// /// 9 public DateTime Date + { + get + { + return (DateTime)GetValue(DateProperty); + } + set + { + SetValue(DateProperty, value); + NotifyPropertyChanged(); + } + } + private DateTime InternalDate { get { diff --git a/src/Tizen.NUI.Components/Controls/Dialog.cs b/src/Tizen.NUI.Components/Controls/Dialog.cs old mode 100644 new mode 100755 index 56a0b490f..28f7b7974 --- a/src/Tizen.NUI.Components/Controls/Dialog.cs +++ b/src/Tizen.NUI.Components/Controls/Dialog.cs @@ -18,6 +18,7 @@ using System; using System.ComponentModel; using Tizen.NUI.BaseComponents; +using Tizen.NUI.Binding; namespace Tizen.NUI.Components { @@ -27,6 +28,24 @@ namespace Tizen.NUI.Components /// 9 public class Dialog : Control { + /// + /// ContentProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty ContentProperty = BindableProperty.Create(nameof(Content), typeof(View), typeof(Dialog), null, propertyChanged: (bindable, oldValue, newValue) => + { + var instance = (Dialog)bindable; + if (newValue != null) + { + instance.InternalContent = newValue as View; + } + }, + defaultValueCreator: (bindable) => + { + var instance = (Dialog)bindable; + return instance.InternalContent; + }); + private View content = null; /// @@ -68,6 +87,18 @@ namespace Tizen.NUI.Components /// /// 9 public View Content + { + get + { + return GetValue(ContentProperty) as View; + } + set + { + SetValue(ContentProperty, value); + NotifyPropertyChanged(); + } + } + private View InternalContent { get { diff --git a/src/Tizen.NUI.Components/Controls/FlexibleView/FlexibleView.cs b/src/Tizen.NUI.Components/Controls/FlexibleView/FlexibleView.cs index 73a635f42..ca69f12af 100755 --- a/src/Tizen.NUI.Components/Controls/FlexibleView/FlexibleView.cs +++ b/src/Tizen.NUI.Components/Controls/FlexibleView/FlexibleView.cs @@ -18,6 +18,7 @@ using System; using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using Tizen.NUI.BaseComponents; +using Tizen.NUI.Binding; namespace Tizen.NUI.Components { @@ -59,6 +60,42 @@ namespace Tizen.NUI.Components [EditorBrowsable(EditorBrowsableState.Never)] public partial class FlexibleView : Control { + /// + /// PaddingProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly new BindableProperty PaddingProperty = BindableProperty.Create(nameof(Padding), typeof(Extents), typeof(FlexibleView), null, propertyChanged: (bindable, oldValue, newValue) => + { + var instance = (FlexibleView)bindable; + if (newValue != null) + { + instance.InternalPadding = newValue as Extents; + } + }, + defaultValueCreator: (bindable) => + { + var instance = (FlexibleView)bindable; + return instance.InternalPadding; + }); + + /// + /// FocusedItemIndexProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty FocusedItemIndexProperty = BindableProperty.Create(nameof(FocusedItemIndex), typeof(int), typeof(FlexibleView), default(int), propertyChanged: (bindable, oldValue, newValue) => + { + var instance = (FlexibleView)bindable; + if (newValue != null) + { + instance.InternalFocusedItemIndex = (int)newValue; + } + }, + defaultValueCreator: (bindable) => + { + var instance = (FlexibleView)bindable; + return instance.InternalFocusedItemIndex; + }); + /// /// Constant value: -1. /// @@ -183,6 +220,18 @@ namespace Tizen.NUI.Components /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public new Extents Padding + { + get + { + return GetValue(PaddingProperty) as Extents; + } + set + { + SetValue(PaddingProperty, value); + NotifyPropertyChanged(); + } + } + private Extents InternalPadding { get { @@ -223,6 +272,18 @@ namespace Tizen.NUI.Components /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public int FocusedItemIndex + { + get + { + return (int)GetValue(FocusedItemIndexProperty); + } + set + { + SetValue(FocusedItemIndexProperty, value); + NotifyPropertyChanged(); + } + } + private int InternalFocusedItemIndex { get { diff --git a/src/Tizen.NUI.Components/Controls/ImageScrollBar.cs b/src/Tizen.NUI.Components/Controls/ImageScrollBar.cs index 796617218..f2b3b4ce4 100755 --- a/src/Tizen.NUI.Components/Controls/ImageScrollBar.cs +++ b/src/Tizen.NUI.Components/Controls/ImageScrollBar.cs @@ -30,7 +30,7 @@ namespace Tizen.NUI.Components /// 6 /// This will be deprecated [Obsolete("Deprecated in API8; Will be removed in API10")] - public class ScrollBar : Control + public partial class ScrollBar : Control { /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] @@ -231,6 +231,18 @@ namespace Tizen.NUI.Components /// This will be deprecated [Obsolete("Deprecated in API8; Will be removed in API10")] public Size ThumbSize + { + get + { + return GetValue(ThumbSizeProperty) as Size; + } + set + { + SetValue(ThumbSizeProperty, value); + NotifyPropertyChanged(); + } + } + private Size InternalThumbSize { get { @@ -253,6 +265,18 @@ namespace Tizen.NUI.Components /// This will be deprecated [Obsolete("Deprecated in API8; Will be removed in API10")] public string TrackImageURL + { + get + { + return GetValue(TrackImageURLProperty) as string; + } + set + { + SetValue(TrackImageURLProperty, value); + NotifyPropertyChanged(); + } + } + private string InternalTrackImageURL { get { @@ -275,6 +299,18 @@ namespace Tizen.NUI.Components /// This will be deprecated [Obsolete("Deprecated in API8; Will be removed in API10")] public Color TrackColor + { + get + { + return GetValue(TrackColorProperty) as Color; + } + set + { + SetValue(TrackColorProperty, value); + NotifyPropertyChanged(); + } + } + private Color InternalTrackColor { get { @@ -296,6 +332,18 @@ namespace Tizen.NUI.Components /// This will be deprecated [Obsolete("Deprecated in API8; Will be removed in API10")] public Color ThumbColor + { + get + { + return GetValue(ThumbColorProperty) as Color; + } + set + { + SetValue(ThumbColorProperty, value); + NotifyPropertyChanged(); + } + } + private Color InternalThumbColor { get { diff --git a/src/Tizen.NUI.Components/Controls/Loading.cs b/src/Tizen.NUI.Components/Controls/Loading.cs index 383e34a99..b54654f9e 100755 --- a/src/Tizen.NUI.Components/Controls/Loading.cs +++ b/src/Tizen.NUI.Components/Controls/Loading.cs @@ -30,6 +30,24 @@ namespace Tizen.NUI.Components /// 6 public class Loading : Control { + /// + /// ImageArrayProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty ImageArrayProperty = BindableProperty.Create(nameof(ImageArray), typeof(string[]), typeof(Loading), null, propertyChanged: (bindable, oldValue, newValue) => + { + var instance = (Loading)bindable; + if (newValue != null) + { + instance.InternalImageArray = newValue as string[]; + } + }, + defaultValueCreator: (bindable) => + { + var instance = (Loading)bindable; + return instance.InternalImageArray; + }); + /// The ImageList bindable property. [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty ImageListProperty = BindableProperty.Create(nameof(ImageList), typeof(IList), typeof(Loading), null, propertyChanged: (bindable, oldValue, newValue) => @@ -142,6 +160,18 @@ namespace Tizen.NUI.Components /// /// 6 public string[] ImageArray + { + get + { + return GetValue(ImageArrayProperty) as string[]; + } + set + { + SetValue(ImageArrayProperty, value); + NotifyPropertyChanged(); + } + } + private string[] InternalImageArray { get => (GetValue(ImageListProperty) as List)?.ToArray() ?? null; set => SetValue(ImageListProperty, value == null ? new List() : new List((string[])value)); diff --git a/src/Tizen.NUI.Components/Controls/Menu.cs b/src/Tizen.NUI.Components/Controls/Menu.cs index beeab4f7f..4f3343504 100755 --- a/src/Tizen.NUI.Components/Controls/Menu.cs +++ b/src/Tizen.NUI.Components/Controls/Menu.cs @@ -25,7 +25,7 @@ namespace Tizen.NUI.Components /// Menu is a class which contains a set of MenuItems and has one of them selected. /// /// 9 - public class Menu : Control + public partial class Menu : Control { private Window window = null; private Layer layer = null; @@ -157,6 +157,18 @@ namespace Tizen.NUI.Components /// /// 9 public View Anchor + { + get + { + return GetValue(AnchorProperty) as View; + } + set + { + SetValue(AnchorProperty, value); + NotifyPropertyChanged(); + } + } + private View InternalAnchor { get { @@ -191,6 +203,18 @@ namespace Tizen.NUI.Components /// /// 9 public RelativePosition HorizontalPositionToAnchor + { + get + { + return (RelativePosition)GetValue(HorizontalPositionToAnchorProperty); + } + set + { + SetValue(HorizontalPositionToAnchorProperty, value); + NotifyPropertyChanged(); + } + } + private RelativePosition InternalHorizontalPositionToAnchor { get { @@ -221,6 +245,18 @@ namespace Tizen.NUI.Components /// /// 9 public RelativePosition VerticalPositionToAnchor + { + get + { + return (RelativePosition)GetValue(VerticalPositionToAnchorProperty); + } + set + { + SetValue(VerticalPositionToAnchorProperty, value); + NotifyPropertyChanged(); + } + } + private RelativePosition InternalVerticalPositionToAnchor { get { diff --git a/src/Tizen.NUI.Components/Controls/MenuBindableProperty.cs b/src/Tizen.NUI.Components/Controls/MenuBindableProperty.cs new file mode 100755 index 000000000..b8b1dbb84 --- /dev/null +++ b/src/Tizen.NUI.Components/Controls/MenuBindableProperty.cs @@ -0,0 +1,63 @@ +using System.ComponentModel; +using Tizen.NUI.BaseComponents; +using Tizen.NUI.Binding; + +namespace Tizen.NUI.Components +{ + public partial class Menu + { + /// + /// AnchorProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty AnchorProperty = BindableProperty.Create(nameof(Anchor), typeof(View), typeof(Menu), null, propertyChanged: (bindable, oldValue, newValue) => + { + var instance = (Menu)bindable; + if (newValue != null) + { + instance.InternalAnchor = newValue as View; + } + }, + defaultValueCreator: (bindable) => + { + var instance = (Menu)bindable; + return instance.InternalAnchor; + }); + + /// + /// HorizontalPositionToAnchorProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty HorizontalPositionToAnchorProperty = BindableProperty.Create(nameof(HorizontalPositionToAnchor), typeof(Tizen.NUI.Components.Menu.RelativePosition), typeof(Menu), default(RelativePosition), propertyChanged: (bindable, oldValue, newValue) => + { + var instance = (Menu)bindable; + if (newValue != null) + { + instance.InternalHorizontalPositionToAnchor = (RelativePosition)newValue; + } + }, + defaultValueCreator: (bindable) => + { + var instance = (Menu)bindable; + return instance.InternalHorizontalPositionToAnchor; + }); + + /// + /// VerticalPositionToAnchorProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty VerticalPositionToAnchorProperty = BindableProperty.Create(nameof(VerticalPositionToAnchor), typeof(Tizen.NUI.Components.Menu.RelativePosition), typeof(Menu), default(RelativePosition), propertyChanged: (bindable, oldValue, newValue) => + { + var instance = (Menu)bindable; + if (newValue != null) + { + instance.InternalVerticalPositionToAnchor = (RelativePosition)newValue; + } + }, + defaultValueCreator: (bindable) => + { + var instance = (Menu)bindable; + return instance.InternalVerticalPositionToAnchor; + }); + } +} diff --git a/src/Tizen.NUI.Components/Controls/Navigation/AppBar.cs b/src/Tizen.NUI.Components/Controls/Navigation/AppBar.cs index 28e51b9e2..39cbf9e90 100755 --- a/src/Tizen.NUI.Components/Controls/Navigation/AppBar.cs +++ b/src/Tizen.NUI.Components/Controls/Navigation/AppBar.cs @@ -26,7 +26,7 @@ namespace Tizen.NUI.Components /// and action functions on Page. /// /// 9 - public class AppBar : Control + public partial class AppBar : Control { private bool autoNavigationContent = true; @@ -163,6 +163,18 @@ namespace Tizen.NUI.Components /// /// 9 public View NavigationContent + { + get + { + return GetValue(NavigationContentProperty) as View; + } + set + { + SetValue(NavigationContentProperty, value); + NotifyPropertyChanged(); + } + } + private View InternalNavigationContent { get { @@ -197,6 +209,18 @@ namespace Tizen.NUI.Components /// /// 9 public string Title + { + get + { + return GetValue(TitleProperty) as string; + } + set + { + SetValue(TitleProperty, value); + NotifyPropertyChanged(); + } + } + private string InternalTitle { get { @@ -225,6 +249,18 @@ namespace Tizen.NUI.Components /// /// 9 public View TitleContent + { + get + { + return GetValue(TitleContentProperty) as View; + } + set + { + SetValue(TitleContentProperty, value); + NotifyPropertyChanged(); + } + } + private View InternalTitleContent { get { @@ -322,6 +358,18 @@ namespace Tizen.NUI.Components /// /// 9 public View ActionContent + { + get + { + return GetValue(ActionContentProperty) as View; + } + set + { + SetValue(ActionContentProperty, value); + NotifyPropertyChanged(); + } + } + private View InternalActionContent { get { @@ -380,6 +428,18 @@ namespace Tizen.NUI.Components /// /// 9 public bool AutoNavigationContent + { + get + { + return (bool)GetValue(AutoNavigationContentProperty); + } + set + { + SetValue(AutoNavigationContentProperty, value); + NotifyPropertyChanged(); + } + } + private bool InternalAutoNavigationContent { get { diff --git a/src/Tizen.NUI.Components/Controls/Navigation/AppBarBindableProperty.cs b/src/Tizen.NUI.Components/Controls/Navigation/AppBarBindableProperty.cs new file mode 100755 index 000000000..8d8bd12c3 --- /dev/null +++ b/src/Tizen.NUI.Components/Controls/Navigation/AppBarBindableProperty.cs @@ -0,0 +1,99 @@ +using System.ComponentModel; +using Tizen.NUI.BaseComponents; +using Tizen.NUI.Binding; + +namespace Tizen.NUI.Components +{ + public partial class AppBar + { + /// + /// NavigationContentProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty NavigationContentProperty = BindableProperty.Create(nameof(NavigationContent), typeof(View), typeof(AppBar), null, propertyChanged: (bindable, oldValue, newValue) => + { + var instance = (AppBar)bindable; + if (newValue != null) + { + instance.InternalNavigationContent = newValue as View; + } + }, + defaultValueCreator: (bindable) => + { + var instance = (AppBar)bindable; + return instance.InternalNavigationContent; + }); + + /// + /// TitleProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty TitleProperty = BindableProperty.Create(nameof(Title), typeof(string), typeof(AppBar), default(string), propertyChanged: (bindable, oldValue, newValue) => + { + var instance = (AppBar)bindable; + if (newValue != null) + { + instance.InternalTitle = newValue as string; + } + }, + defaultValueCreator: (bindable) => + { + var instance = (AppBar)bindable; + return instance.InternalTitle; + }); + + /// + /// TitleContentProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty TitleContentProperty = BindableProperty.Create(nameof(TitleContent), typeof(View), typeof(AppBar), null, propertyChanged: (bindable, oldValue, newValue) => + { + var instance = (AppBar)bindable; + if (newValue != null) + { + instance.InternalTitleContent = newValue as View; + } + }, + defaultValueCreator: (bindable) => + { + var instance = (AppBar)bindable; + return instance.InternalTitleContent; + }); + + /// + /// ActionContentProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty ActionContentProperty = BindableProperty.Create(nameof(ActionContent), typeof(View), typeof(AppBar), null, propertyChanged: (bindable, oldValue, newValue) => + { + var instance = (AppBar)bindable; + if (newValue != null) + { + instance.InternalActionContent = newValue as View; + } + }, + defaultValueCreator: (bindable) => + { + var instance = (AppBar)bindable; + return instance.InternalActionContent; + }); + + /// + /// AutoNavigationContentProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty AutoNavigationContentProperty = BindableProperty.Create(nameof(AutoNavigationContent), typeof(bool), typeof(AppBar), default(bool), propertyChanged: (bindable, oldValue, newValue) => + { + var instance = (AppBar)bindable; + if (newValue != null) + { + instance.InternalAutoNavigationContent = (bool)newValue; + } + }, + defaultValueCreator: (bindable) => + { + var instance = (AppBar)bindable; + return instance.InternalAutoNavigationContent; + }); + } +} diff --git a/src/Tizen.NUI.Components/Controls/Navigation/ContentPage.cs b/src/Tizen.NUI.Components/Controls/Navigation/ContentPage.cs index 9b53d6a2a..9f4ac040a 100755 --- a/src/Tizen.NUI.Components/Controls/Navigation/ContentPage.cs +++ b/src/Tizen.NUI.Components/Controls/Navigation/ContentPage.cs @@ -24,7 +24,7 @@ namespace Tizen.NUI.Components /// ContentPage contains title app bar and content. /// /// 9 - public class ContentPage : Page + public partial class ContentPage : Page { private AppBar appBar = null; private View content = null; @@ -86,6 +86,18 @@ namespace Tizen.NUI.Components /// /// 9 public AppBar AppBar + { + get + { + return GetValue(AppBarProperty) as AppBar; + } + set + { + SetValue(AppBarProperty, value); + NotifyPropertyChanged(); + } + } + private AppBar InternalAppBar { get { @@ -123,6 +135,18 @@ namespace Tizen.NUI.Components /// /// 9 public View Content + { + get + { + return GetValue(ContentProperty) as View; + } + set + { + SetValue(ContentProperty, value); + NotifyPropertyChanged(); + } + } + private View InternalContent { get { diff --git a/src/Tizen.NUI.Components/Controls/Navigation/ContentPageBindableProperty.cs b/src/Tizen.NUI.Components/Controls/Navigation/ContentPageBindableProperty.cs new file mode 100755 index 000000000..cf5929ca4 --- /dev/null +++ b/src/Tizen.NUI.Components/Controls/Navigation/ContentPageBindableProperty.cs @@ -0,0 +1,46 @@ +using System.ComponentModel; +using Tizen.NUI.BaseComponents; +using Tizen.NUI.Binding; + +namespace Tizen.NUI.Components +{ + public partial class ContentPage + { + /// + /// AppBarProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty AppBarProperty = BindableProperty.Create(nameof(AppBar), typeof(AppBar), typeof(ContentPage), null, propertyChanged: (bindable, oldValue, newValue) => + { + var instance = (ContentPage)bindable; + if (newValue != null) + { + instance.InternalAppBar = newValue as AppBar; + } + }, + defaultValueCreator: (bindable) => + { + var instance = (ContentPage)bindable; + return instance.InternalAppBar; + }); + + /// + /// ContentProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty ContentProperty = BindableProperty.Create(nameof(Content), typeof(View), typeof(ContentPage), null, propertyChanged: (bindable, oldValue, newValue) => + { + var instance = (ContentPage)bindable; + if (newValue != null) + { + instance.InternalContent = newValue as View; + } + }, + defaultValueCreator: (bindable) => + { + var instance = (ContentPage)bindable; + return instance.InternalContent; + }); + + } +} diff --git a/src/Tizen.NUI.Components/Controls/Navigation/DialogPage.cs b/src/Tizen.NUI.Components/Controls/Navigation/DialogPage.cs index 10da0c96e..aaea2c7ae 100755 --- a/src/Tizen.NUI.Components/Controls/Navigation/DialogPage.cs +++ b/src/Tizen.NUI.Components/Controls/Navigation/DialogPage.cs @@ -26,7 +26,7 @@ namespace Tizen.NUI.Components /// DialogPage contains dialog and dimmed scrim behind the dialog. /// /// 9 - public class DialogPage : Page + public partial class DialogPage : Page { private View content = null; private View scrim = null; @@ -86,6 +86,18 @@ namespace Tizen.NUI.Components /// /// 9 public View Content + { + get + { + return GetValue(ContentProperty) as View; + } + set + { + SetValue(ContentProperty, value); + NotifyPropertyChanged(); + } + } + private View InternalContent { get { @@ -185,6 +197,18 @@ namespace Tizen.NUI.Components /// /// 9 public bool EnableScrim + { + get + { + return (bool)GetValue(EnableScrimProperty); + } + set + { + SetValue(EnableScrimProperty, value); + NotifyPropertyChanged(); + } + } + private bool InternalEnableScrim { get { @@ -217,13 +241,37 @@ namespace Tizen.NUI.Components /// Indicates to dismiss dialog by touching on scrim. /// /// 9 - public bool EnableDismissOnScrim { get; set; } = true; + public bool EnableDismissOnScrim + { + get + { + return (bool)GetValue(EnableDismissOnScrimProperty); + } + set + { + SetValue(EnableDismissOnScrimProperty, value); + NotifyPropertyChanged(); + } + } + private bool InternalEnableDismissOnScrim { get; set; } = true; /// /// The color of scrim. /// /// 9 public Color ScrimColor + { + get + { + return GetValue(ScrimColorProperty) as Color; + } + set + { + SetValue(ScrimColorProperty, value); + NotifyPropertyChanged(); + } + } + private Color InternalScrimColor { get { diff --git a/src/Tizen.NUI.Components/Controls/Navigation/DialogPageBindableProperty.cs b/src/Tizen.NUI.Components/Controls/Navigation/DialogPageBindableProperty.cs new file mode 100755 index 000000000..de8b355c2 --- /dev/null +++ b/src/Tizen.NUI.Components/Controls/Navigation/DialogPageBindableProperty.cs @@ -0,0 +1,81 @@ +using System.ComponentModel; +using Tizen.NUI.BaseComponents; +using Tizen.NUI.Binding; + +namespace Tizen.NUI.Components +{ + public partial class DialogPage + { + /// + /// ContentProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty ContentProperty = BindableProperty.Create(nameof(Content), typeof(View), typeof(DialogPage), null, propertyChanged: (bindable, oldValue, newValue) => + { + var instance = (DialogPage)bindable; + if (newValue != null) + { + instance.InternalContent = newValue as View; + } + }, + defaultValueCreator: (bindable) => + { + var instance = (DialogPage)bindable; + return instance.InternalContent; + }); + + /// + /// EnableScrimProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty EnableScrimProperty = BindableProperty.Create(nameof(EnableScrim), typeof(bool), typeof(DialogPage), default(bool), propertyChanged: (bindable, oldValue, newValue) => + { + var instance = (DialogPage)bindable; + if (newValue != null) + { + instance.InternalEnableScrim = (bool)newValue; + } + }, + defaultValueCreator: (bindable) => + { + var instance = (DialogPage)bindable; + return instance.InternalEnableScrim; + }); + + /// + /// EnableDismissOnScrimProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty EnableDismissOnScrimProperty = BindableProperty.Create(nameof(EnableDismissOnScrim), typeof(bool), typeof(DialogPage), default(bool), propertyChanged: (bindable, oldValue, newValue) => + { + var instance = (DialogPage)bindable; + if (newValue != null) + { + instance.InternalEnableDismissOnScrim = (bool)newValue; + } + }, + defaultValueCreator: (bindable) => + { + var instance = (DialogPage)bindable; + return instance.InternalEnableDismissOnScrim; + }); + + /// + /// ScrimColorProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty ScrimColorProperty = BindableProperty.Create(nameof(ScrimColor), typeof(Color), typeof(DialogPage), null, propertyChanged: (bindable, oldValue, newValue) => + { + var instance = (DialogPage)bindable; + if (newValue != null) + { + instance.InternalScrimColor = newValue as Color; + } + }, + defaultValueCreator: (bindable) => + { + var instance = (DialogPage)bindable; + return instance.InternalScrimColor; + }); + } +} diff --git a/src/Tizen.NUI.Components/Controls/Navigation/Navigator.cs b/src/Tizen.NUI.Components/Controls/Navigation/Navigator.cs index 8780afdb3..f00a4cc63 100755 --- a/src/Tizen.NUI.Components/Controls/Navigation/Navigator.cs +++ b/src/Tizen.NUI.Components/Controls/Navigation/Navigator.cs @@ -19,6 +19,7 @@ using System; using System.Collections.Generic; using System.ComponentModel; using Tizen.NUI.BaseComponents; +using Tizen.NUI.Binding; namespace Tizen.NUI.Components { @@ -73,6 +74,24 @@ namespace Tizen.NUI.Components /// 9 public class Navigator : Control { + /// + /// TransitionProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty TransitionProperty = BindableProperty.Create(nameof(Transition), typeof(Transition), typeof(Navigator), null, propertyChanged: (bindable, oldValue, newValue) => + { + var instance = (Navigator)bindable; + if (newValue != null) + { + instance.InternalTransition = newValue as Transition; + } + }, + defaultValueCreator: (bindable) => + { + var instance = (Navigator)bindable; + return instance.InternalTransition; + }); + private const int DefaultTransitionDuration = 500; //This will be replaced with view transition class instance. @@ -142,6 +161,18 @@ namespace Tizen.NUI.Components /// /// 9 public Transition Transition + { + get + { + return GetValue(TransitionProperty) as Transition; + } + set + { + SetValue(TransitionProperty, value); + NotifyPropertyChanged(); + } + } + private Transition InternalTransition { set { diff --git a/src/Tizen.NUI.Components/Controls/Navigation/Page.cs b/src/Tizen.NUI.Components/Controls/Navigation/Page.cs index 98f17c274..fba94758f 100755 --- a/src/Tizen.NUI.Components/Controls/Navigation/Page.cs +++ b/src/Tizen.NUI.Components/Controls/Navigation/Page.cs @@ -16,6 +16,7 @@ */ using System; using System.ComponentModel; +using Tizen.NUI.Binding; namespace Tizen.NUI.Components { @@ -57,6 +58,42 @@ namespace Tizen.NUI.Components /// 9 public abstract class Page : Control { + /// + /// AppearingTransitionProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty AppearingTransitionProperty = BindableProperty.Create(nameof(AppearingTransition), typeof(TransitionBase), typeof(Page), null, propertyChanged: (bindable, oldValue, newValue) => + { + var instance = (Page)bindable; + if (newValue != null) + { + instance.InternalAppearingTransition = newValue as TransitionBase; + } + }, + defaultValueCreator: (bindable) => + { + var instance = (Page)bindable; + return instance.InternalAppearingTransition; + }); + + /// + /// DisappearingTransitionProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty DisappearingTransitionProperty = BindableProperty.Create(nameof(DisappearingTransition), typeof(TransitionBase), typeof(Page), null, propertyChanged: (bindable, oldValue, newValue) => + { + var instance = (Page)bindable; + if (newValue != null) + { + instance.InternalDisappearingTransition = newValue as TransitionBase; + } + }, + defaultValueCreator: (bindable) => + { + var instance = (Page)bindable; + return instance.InternalDisappearingTransition; + }); + private Navigator navigator = null; // Default transition is Fade. @@ -99,6 +136,18 @@ namespace Tizen.NUI.Components /// [EditorBrowsable(EditorBrowsableState.Never)] public TransitionBase AppearingTransition + { + get + { + return GetValue(AppearingTransitionProperty) as TransitionBase; + } + set + { + SetValue(AppearingTransitionProperty, value); + NotifyPropertyChanged(); + } + } + private TransitionBase InternalAppearingTransition { set { @@ -115,6 +164,18 @@ namespace Tizen.NUI.Components /// [EditorBrowsable(EditorBrowsableState.Never)] public TransitionBase DisappearingTransition + { + get + { + return GetValue(DisappearingTransitionProperty) as TransitionBase; + } + set + { + SetValue(DisappearingTransitionProperty, value); + NotifyPropertyChanged(); + } + } + private TransitionBase InternalDisappearingTransition { set { diff --git a/src/Tizen.NUI.Components/Controls/Pagination.cs b/src/Tizen.NUI.Components/Controls/Pagination.cs index 9da3e445f..f7e50172d 100755 --- a/src/Tizen.NUI.Components/Controls/Pagination.cs +++ b/src/Tizen.NUI.Components/Controls/Pagination.cs @@ -28,7 +28,7 @@ namespace Tizen.NUI.Components /// Pagination shows the number of pages available and the currently active page. /// /// 8 - public class Pagination : Control + public partial class Pagination : Control { /// The IndicatorSize bindable property. [EditorBrowsable(EditorBrowsableState.Never)] @@ -149,6 +149,18 @@ namespace Tizen.NUI.Components /// [EditorBrowsable(EditorBrowsableState.Never)] public Selector LastIndicatorImageUrl + { + get + { + return GetValue(LastIndicatorImageUrlProperty) as Selector; + } + set + { + SetValue(LastIndicatorImageUrlProperty, value); + NotifyPropertyChanged(); + } + } + private Selector InternalLastIndicatorImageUrl { get => lastIndicatorImageUrl; set @@ -178,6 +190,18 @@ namespace Tizen.NUI.Components /// 8 /// Thrown when the given value is negative. public int IndicatorCount + { + get + { + return (int)GetValue(IndicatorCountProperty); + } + set + { + SetValue(IndicatorCountProperty, value); + NotifyPropertyChanged(); + } + } + private int InternalIndicatorCount { get { @@ -249,6 +273,18 @@ namespace Tizen.NUI.Components /// /// 8 public Color IndicatorColor + { + get + { + return GetValue(IndicatorColorProperty) as Color; + } + set + { + SetValue(IndicatorColorProperty, value); + NotifyPropertyChanged(); + } + } + private Color InternalIndicatorColor { get { @@ -304,6 +340,18 @@ namespace Tizen.NUI.Components /// /// 8 public Color SelectedIndicatorColor + { + get + { + return GetValue(SelectedIndicatorColorProperty) as Color; + } + set + { + SetValue(SelectedIndicatorColorProperty, value); + NotifyPropertyChanged(); + } + } + private Color InternalSelectedIndicatorColor { get { @@ -344,6 +392,18 @@ namespace Tizen.NUI.Components /// /// 8 public int SelectedIndex + { + get + { + return (int)GetValue(SelectedIndexProperty); + } + set + { + SetValue(SelectedIndexProperty, value); + NotifyPropertyChanged(); + } + } + private int InternalSelectedIndex { get { diff --git a/src/Tizen.NUI.Components/Controls/PaginationBindableProperty.cs b/src/Tizen.NUI.Components/Controls/PaginationBindableProperty.cs new file mode 100755 index 000000000..6d6b37132 --- /dev/null +++ b/src/Tizen.NUI.Components/Controls/PaginationBindableProperty.cs @@ -0,0 +1,99 @@ +using System.ComponentModel; +using Tizen.NUI.BaseComponents; +using Tizen.NUI.Binding; + +namespace Tizen.NUI.Components +{ + public partial class Pagination + { + /// + /// LastIndicatorImageUrlProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty LastIndicatorImageUrlProperty = BindableProperty.Create(nameof(LastIndicatorImageUrl), typeof(Tizen.NUI.BaseComponents.Selector), typeof(Pagination), null, propertyChanged: (bindable, oldValue, newValue) => + { + var instance = (Pagination)bindable; + if (newValue != null) + { + instance.InternalLastIndicatorImageUrl = newValue as Selector; + } + }, + defaultValueCreator: (bindable) => + { + var instance = (Pagination)bindable; + return instance.InternalLastIndicatorImageUrl; + }); + + /// + /// IndicatorCountProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty IndicatorCountProperty = BindableProperty.Create(nameof(IndicatorCount), typeof(int), typeof(Pagination), default(int), propertyChanged: (bindable, oldValue, newValue) => + { + var instance = (Pagination)bindable; + if (newValue != null) + { + instance.InternalIndicatorCount = (int)newValue; + } + }, + defaultValueCreator: (bindable) => + { + var instance = (Pagination)bindable; + return instance.InternalIndicatorCount; + }); + + /// + /// IndicatorColorProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty IndicatorColorProperty = BindableProperty.Create(nameof(IndicatorColor), typeof(Color), typeof(Pagination), null, propertyChanged: (bindable, oldValue, newValue) => + { + var instance = (Pagination)bindable; + if (newValue != null) + { + instance.InternalIndicatorColor = newValue as Color; + } + }, + defaultValueCreator: (bindable) => + { + var instance = (Pagination)bindable; + return instance.InternalIndicatorColor; + }); + + /// + /// SelectedIndicatorColorProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty SelectedIndicatorColorProperty = BindableProperty.Create(nameof(SelectedIndicatorColor), typeof(Color), typeof(Pagination), null, propertyChanged: (bindable, oldValue, newValue) => + { + var instance = (Pagination)bindable; + if (newValue != null) + { + instance.InternalSelectedIndicatorColor = newValue as Color; + } + }, + defaultValueCreator: (bindable) => + { + var instance = (Pagination)bindable; + return instance.InternalSelectedIndicatorColor; + }); + + /// + /// SelectedIndexProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty SelectedIndexProperty = BindableProperty.Create(nameof(SelectedIndex), typeof(int), typeof(Pagination), default(int), propertyChanged: (bindable, oldValue, newValue) => + { + var instance = (Pagination)bindable; + if (newValue != null) + { + instance.InternalSelectedIndex = (int)newValue; + } + }, + defaultValueCreator: (bindable) => + { + var instance = (Pagination)bindable; + return instance.InternalSelectedIndex; + }); + } +} diff --git a/src/Tizen.NUI.Components/Controls/Picker.cs b/src/Tizen.NUI.Components/Controls/Picker.cs index 65bdeb1c7..70eaf900b 100755 --- a/src/Tizen.NUI.Components/Controls/Picker.cs +++ b/src/Tizen.NUI.Components/Controls/Picker.cs @@ -53,7 +53,7 @@ namespace Tizen.NUI.Components /// a value through a scrolling motion by expressing the specified value as a list. /// /// 9 - public class Picker : Control + public partial class Picker : Control { //Tizen 6.5 base components Picker guide visible scroll item is 5. private const int scrollVisibleItems = 5; @@ -183,6 +183,18 @@ namespace Tizen.NUI.Components /// /// 9 public int CurrentValue + { + get + { + return (int)GetValue(CurrentValueProperty); + } + set + { + SetValue(CurrentValueProperty, value); + NotifyPropertyChanged(); + } + } + private int InternalCurrentValue { get { @@ -206,6 +218,18 @@ namespace Tizen.NUI.Components /// /// 9 public int MaxValue + { + get + { + return (int)GetValue(MaxValueProperty); + } + set + { + SetValue(MaxValueProperty, value); + NotifyPropertyChanged(); + } + } + private int InternalMaxValue { get { @@ -228,6 +252,18 @@ namespace Tizen.NUI.Components /// /// 9 public int MinValue + { + get + { + return (int)GetValue(MinValueProperty); + } + set + { + SetValue(MinValueProperty, value); + NotifyPropertyChanged(); + } + } + private int InternalMinValue { get { diff --git a/src/Tizen.NUI.Components/Controls/PickerBindableProperty.cs b/src/Tizen.NUI.Components/Controls/PickerBindableProperty.cs new file mode 100755 index 000000000..8d7664065 --- /dev/null +++ b/src/Tizen.NUI.Components/Controls/PickerBindableProperty.cs @@ -0,0 +1,62 @@ +using System.ComponentModel; +using Tizen.NUI.Binding; + +namespace Tizen.NUI.Components +{ + public partial class Picker + { + /// + /// CurrentValueProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty CurrentValueProperty = BindableProperty.Create(nameof(CurrentValue), typeof(int), typeof(Picker), default(int), propertyChanged: (bindable, oldValue, newValue) => + { + var instance = (Picker)bindable; + if (newValue != null) + { + instance.InternalCurrentValue = (int)newValue; + } + }, + defaultValueCreator: (bindable) => + { + var instance = (Picker)bindable; + return instance.InternalCurrentValue; + }); + + /// + /// MaxValueProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty MaxValueProperty = BindableProperty.Create(nameof(MaxValue), typeof(int), typeof(Picker), default(int), propertyChanged: (bindable, oldValue, newValue) => + { + var instance = (Picker)bindable; + if (newValue != null) + { + instance.InternalMaxValue = (int)newValue; + } + }, + defaultValueCreator: (bindable) => + { + var instance = (Picker)bindable; + return instance.InternalMaxValue; + }); + + /// + /// MinValueProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty MinValueProperty = BindableProperty.Create(nameof(MinValue), typeof(int), typeof(Picker), default(int), propertyChanged: (bindable, oldValue, newValue) => + { + var instance = (Picker)bindable; + if (newValue != null) + { + instance.InternalMinValue = (int)newValue; + } + }, + defaultValueCreator: (bindable) => + { + var instance = (Picker)bindable; + return instance.InternalMinValue; + }); + } +} diff --git a/src/Tizen.NUI.Components/Controls/Popup.cs b/src/Tizen.NUI.Components/Controls/Popup.cs index ed4d43651..14c25aefc 100755 --- a/src/Tizen.NUI.Components/Controls/Popup.cs +++ b/src/Tizen.NUI.Components/Controls/Popup.cs @@ -27,7 +27,7 @@ namespace Tizen.NUI.Components /// /// 6 [Obsolete("Deprecated in API8; Will be removed in API10")] - public class Popup : Control + public partial class Popup : Control { /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] @@ -327,6 +327,18 @@ namespace Tizen.NUI.Components /// 6 [Obsolete("Deprecated in API8; Will be removed in API10")] public string TitleText + { + get + { + return GetValue(TitleTextProperty) as string; + } + set + { + SetValue(TitleTextProperty, value); + NotifyPropertyChanged(); + } + } + private string InternalTitleText { get => Title.Text; set => Title.Text = value; @@ -338,6 +350,18 @@ namespace Tizen.NUI.Components /// 6 [Obsolete("Deprecated in API8; Will be removed in API10")] public float TitlePointSize + { + get + { + return (float)GetValue(TitlePointSizeProperty); + } + set + { + SetValue(TitlePointSizeProperty, value); + NotifyPropertyChanged(); + } + } + private float InternalTitlePointSize { get => Title.PointSize; set => Title.PointSize = value; @@ -349,6 +373,18 @@ namespace Tizen.NUI.Components /// 6 [Obsolete("Deprecated in API8; Will be removed in API10")] public Color TitleTextColor + { + get + { + return GetValue(TitleTextColorProperty) as Color; + } + set + { + SetValue(TitleTextColorProperty, value); + NotifyPropertyChanged(); + } + } + private Color InternalTitleTextColor { get => Title.TextColor; set => Title.TextColor = value; @@ -360,6 +396,18 @@ namespace Tizen.NUI.Components /// 6 [Obsolete("Deprecated in API8; Will be removed in API10")] public HorizontalAlignment TitleTextHorizontalAlignment + { + get + { + return (HorizontalAlignment)GetValue(TitleTextHorizontalAlignmentProperty); + } + set + { + SetValue(TitleTextHorizontalAlignmentProperty, value); + NotifyPropertyChanged(); + } + } + private HorizontalAlignment InternalTitleTextHorizontalAlignment { get => Title.HorizontalAlignment; set => Title.HorizontalAlignment = value; @@ -371,6 +419,18 @@ namespace Tizen.NUI.Components /// 6 [Obsolete("Deprecated in API8; Will be removed in API10")] public Position TitleTextPosition + { + get + { + return GetValue(TitleTextPositionProperty) as Position; + } + set + { + SetValue(TitleTextPositionProperty, value); + NotifyPropertyChanged(); + } + } + private Position InternalTitleTextPosition { get => Title.Position; set => Title.Position = value; @@ -382,6 +442,18 @@ namespace Tizen.NUI.Components /// 6 [Obsolete("Deprecated in API8; Will be removed in API10")] public int TitleHeight + { + get + { + return (int)GetValue(TitleHeightProperty); + } + set + { + SetValue(TitleHeightProperty, value); + NotifyPropertyChanged(); + } + } + private int InternalTitleHeight { get => (int)Title.SizeHeight; set => Title.SizeHeight = (int)value; @@ -404,6 +476,18 @@ namespace Tizen.NUI.Components /// 6 [Obsolete("Deprecated in API8; Will be removed in API10")] public int ButtonCount + { + get + { + return (int)GetValue(ButtonCountProperty); + } + set + { + SetValue(ButtonCountProperty, value); + NotifyPropertyChanged(); + } + } + private int InternalButtonCount { get; set; diff --git a/src/Tizen.NUI.Components/Controls/PopupBindableProperty.cs b/src/Tizen.NUI.Components/Controls/PopupBindableProperty.cs new file mode 100755 index 000000000..81d051fa4 --- /dev/null +++ b/src/Tizen.NUI.Components/Controls/PopupBindableProperty.cs @@ -0,0 +1,134 @@ +using System.ComponentModel; +using Tizen.NUI.Binding; + +namespace Tizen.NUI.Components +{ + public partial class Popup + { + /// + /// TitleTextProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty TitleTextProperty = BindableProperty.Create(nameof(TitleText), typeof(string), typeof(Popup), default(string), propertyChanged: (bindable, oldValue, newValue) => + { + var instance = (Popup)bindable; + if (newValue != null) + { + instance.InternalTitleText = newValue as string; + } + }, + defaultValueCreator: (bindable) => + { + var instance = (Popup)bindable; + return instance.InternalTitleText; + }); + + /// + /// TitlePointSizeProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty TitlePointSizeProperty = BindableProperty.Create(nameof(TitlePointSize), typeof(float), typeof(Popup), default(float), propertyChanged: (bindable, oldValue, newValue) => + { + var instance = (Popup)bindable; + if (newValue != null) + { + instance.InternalTitlePointSize = (float)newValue; + } + }, + defaultValueCreator: (bindable) => + { + var instance = (Popup)bindable; + return instance.InternalTitlePointSize; + }); + + /// + /// TitleTextColorProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty TitleTextColorProperty = BindableProperty.Create(nameof(TitleTextColor), typeof(Color), typeof(Popup), null, propertyChanged: (bindable, oldValue, newValue) => + { + var instance = (Popup)bindable; + if (newValue != null) + { + instance.InternalTitleTextColor = newValue as Color; + } + }, + defaultValueCreator: (bindable) => + { + var instance = (Popup)bindable; + return instance.InternalTitleTextColor; + }); + + /// + /// TitleTextHorizontalAlignmentProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty TitleTextHorizontalAlignmentProperty = BindableProperty.Create(nameof(TitleTextHorizontalAlignment), typeof(HorizontalAlignment), typeof(Popup), default(HorizontalAlignment), propertyChanged: (bindable, oldValue, newValue) => + { + var instance = (Popup)bindable; + if (newValue != null) + { + instance.InternalTitleTextHorizontalAlignment = (HorizontalAlignment)newValue; + } + }, + defaultValueCreator: (bindable) => + { + var instance = (Popup)bindable; + return instance.InternalTitleTextHorizontalAlignment; + }); + + /// + /// TitleTextPositionProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty TitleTextPositionProperty = BindableProperty.Create(nameof(TitleTextPosition), typeof(Position), typeof(Popup), null, propertyChanged: (bindable, oldValue, newValue) => + { + var instance = (Popup)bindable; + if (newValue != null) + { + instance.InternalTitleTextPosition = newValue as Position; + } + }, + defaultValueCreator: (bindable) => + { + var instance = (Popup)bindable; + return instance.InternalTitleTextPosition; + }); + + /// + /// TitleHeightProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty TitleHeightProperty = BindableProperty.Create(nameof(TitleHeight), typeof(int), typeof(Popup), default(int), propertyChanged: (bindable, oldValue, newValue) => + { + var instance = (Popup)bindable; + if (newValue != null) + { + instance.InternalTitleHeight = (int)newValue; + } + }, + defaultValueCreator: (bindable) => + { + var instance = (Popup)bindable; + return instance.InternalTitleHeight; + }); + + /// + /// ButtonCountProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty ButtonCountProperty = BindableProperty.Create(nameof(ButtonCount), typeof(int), typeof(Popup), default(int), propertyChanged: (bindable, oldValue, newValue) => + { + var instance = (Popup)bindable; + if (newValue != null) + { + instance.InternalButtonCount = (int)newValue; + } + }, + defaultValueCreator: (bindable) => + { + var instance = (Popup)bindable; + return instance.InternalButtonCount; + }); + } +} diff --git a/src/Tizen.NUI.Components/Controls/Progress.cs b/src/Tizen.NUI.Components/Controls/Progress.cs index 5bbf96356..6fd82b8f3 100755 --- a/src/Tizen.NUI.Components/Controls/Progress.cs +++ b/src/Tizen.NUI.Components/Controls/Progress.cs @@ -26,7 +26,7 @@ namespace Tizen.NUI.Components /// The Progress class is used to show the ongoing status with a long narrow bar. /// /// 6 - public class Progress : Control + public partial class Progress : Control { /// /// MaxValueProperty @@ -236,6 +236,18 @@ namespace Tizen.NUI.Components /// /// 6 public string TrackImageURL + { + get + { + return GetValue(TrackImageURLProperty) as string; + } + set + { + SetValue(TrackImageURLProperty, value); + NotifyPropertyChanged(); + } + } + private string InternalTrackImageURL { get => trackImage.ResourceUrl; set => trackImage.ResourceUrl = value; @@ -246,6 +258,18 @@ namespace Tizen.NUI.Components /// /// 6 public string ProgressImageURL + { + get + { + return GetValue(ProgressImageURLProperty) as string; + } + set + { + SetValue(ProgressImageURLProperty, value); + NotifyPropertyChanged(); + } + } + private string InternalProgressImageURL { get => progressImage.ResourceUrl; set => progressImage.ResourceUrl = value; @@ -256,6 +280,18 @@ namespace Tizen.NUI.Components /// /// 6 public string BufferImageURL + { + get + { + return GetValue(BufferImageURLProperty) as string; + } + set + { + SetValue(BufferImageURLProperty, value); + NotifyPropertyChanged(); + } + } + private string InternalBufferImageURL { get => bufferImage.ResourceUrl; set => bufferImage.ResourceUrl = value; @@ -267,6 +303,18 @@ namespace Tizen.NUI.Components /// Thrown when setting null value. /// 9 public string IndeterminateImageUrl + { + get + { + return GetValue(IndeterminateImageUrlProperty) as string; + } + set + { + SetValue(IndeterminateImageUrlProperty, value); + NotifyPropertyChanged(); + } + } + private string InternalIndeterminateImageUrl { get { @@ -297,6 +345,18 @@ namespace Tizen.NUI.Components /// /// 6 public Color TrackColor + { + get + { + return GetValue(TrackColorProperty) as Color; + } + set + { + SetValue(TrackColorProperty, value); + NotifyPropertyChanged(); + } + } + private Color InternalTrackColor { get => trackImage.BackgroundColor; set => trackImage.BackgroundColor = value; @@ -307,6 +367,18 @@ namespace Tizen.NUI.Components /// /// 6 public Color ProgressColor + { + get + { + return GetValue(ProgressColorProperty) as Color; + } + set + { + SetValue(ProgressColorProperty, value); + NotifyPropertyChanged(); + } + } + private Color InternalProgressColor { get => progressImage.BackgroundColor; set => progressImage.BackgroundColor = value; @@ -317,6 +389,18 @@ namespace Tizen.NUI.Components /// /// 6 public Color BufferColor + { + get + { + return GetValue(BufferColorProperty) as Color; + } + set + { + SetValue(BufferColorProperty, value); + NotifyPropertyChanged(); + } + } + private Color InternalBufferColor { get => bufferImage.BackgroundColor; set => bufferImage.BackgroundColor = value; diff --git a/src/Tizen.NUI.Components/Controls/ProgressBindableProperty.cs b/src/Tizen.NUI.Components/Controls/ProgressBindableProperty.cs new file mode 100755 index 000000000..afc3a00ba --- /dev/null +++ b/src/Tizen.NUI.Components/Controls/ProgressBindableProperty.cs @@ -0,0 +1,134 @@ +using System.ComponentModel; +using Tizen.NUI.Binding; + +namespace Tizen.NUI.Components +{ + public partial class Progress + { + /// + /// TrackImageURLProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty TrackImageURLProperty = BindableProperty.Create(nameof(TrackImageURL), typeof(string), typeof(Progress), default(string), propertyChanged: (bindable, oldValue, newValue) => + { + var instance = (Progress)bindable; + if (newValue != null) + { + instance.InternalTrackImageURL = newValue as string; + } + }, + defaultValueCreator: (bindable) => + { + var instance = (Progress)bindable; + return instance.InternalTrackImageURL; + }); + + /// + /// ProgressImageURLProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty ProgressImageURLProperty = BindableProperty.Create(nameof(ProgressImageURL), typeof(string), typeof(Progress), default(string), propertyChanged: (bindable, oldValue, newValue) => + { + var instance = (Progress)bindable; + if (newValue != null) + { + instance.InternalProgressImageURL = newValue as string; + } + }, + defaultValueCreator: (bindable) => + { + var instance = (Progress)bindable; + return instance.InternalProgressImageURL; + }); + + /// + /// BufferImageURLProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty BufferImageURLProperty = BindableProperty.Create(nameof(BufferImageURL), typeof(string), typeof(Progress), default(string), propertyChanged: (bindable, oldValue, newValue) => + { + var instance = (Progress)bindable; + if (newValue != null) + { + instance.InternalBufferImageURL = newValue as string; + } + }, + defaultValueCreator: (bindable) => + { + var instance = (Progress)bindable; + return instance.InternalBufferImageURL; + }); + + /// + /// IndeterminateImageUrlProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty IndeterminateImageUrlProperty = BindableProperty.Create(nameof(IndeterminateImageUrl), typeof(string), typeof(Progress), default(string), propertyChanged: (bindable, oldValue, newValue) => + { + var instance = (Progress)bindable; + if (newValue != null) + { + instance.InternalIndeterminateImageUrl = newValue as string; + } + }, + defaultValueCreator: (bindable) => + { + var instance = (Progress)bindable; + return instance.InternalIndeterminateImageUrl; + }); + + /// + /// TrackColorProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty TrackColorProperty = BindableProperty.Create(nameof(TrackColor), typeof(Color), typeof(Progress), null, propertyChanged: (bindable, oldValue, newValue) => + { + var instance = (Progress)bindable; + if (newValue != null) + { + instance.InternalTrackColor = newValue as Color; + } + }, + defaultValueCreator: (bindable) => + { + var instance = (Progress)bindable; + return instance.InternalTrackColor; + }); + + /// + /// ProgressColorProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty ProgressColorProperty = BindableProperty.Create(nameof(ProgressColor), typeof(Color), typeof(Progress), null, propertyChanged: (bindable, oldValue, newValue) => + { + var instance = (Progress)bindable; + if (newValue != null) + { + instance.InternalProgressColor = newValue as Color; + } + }, + defaultValueCreator: (bindable) => + { + var instance = (Progress)bindable; + return instance.InternalProgressColor; + }); + + /// + /// BufferColorProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty BufferColorProperty = BindableProperty.Create(nameof(BufferColor), typeof(Color), typeof(Progress), null, propertyChanged: (bindable, oldValue, newValue) => + { + var instance = (Progress)bindable; + if (newValue != null) + { + instance.InternalBufferColor = newValue as Color; + } + }, + defaultValueCreator: (bindable) => + { + var instance = (Progress)bindable; + return instance.InternalBufferColor; + }); + } +} diff --git a/src/Tizen.NUI.Components/Controls/RecyclerView/CollectionView.cs b/src/Tizen.NUI.Components/Controls/RecyclerView/CollectionView.cs index fc7e4378b..f2b05840c 100755 --- a/src/Tizen.NUI.Components/Controls/RecyclerView/CollectionView.cs +++ b/src/Tizen.NUI.Components/Controls/RecyclerView/CollectionView.cs @@ -29,7 +29,7 @@ namespace Tizen.NUI.Components /// Selectable RecyclerView that presenting a collection of items with variable layouters. /// /// 9 - public class CollectionView : RecyclerView + public partial class CollectionView : RecyclerView { /// /// Binding Property of selected item in single selection. @@ -267,6 +267,18 @@ namespace Tizen.NUI.Components /// /// 9 public override DataTemplate ItemTemplate + { + get + { + return GetValue(ItemTemplateProperty) as DataTemplate; + } + set + { + SetValue(ItemTemplateProperty, value); + NotifyPropertyChanged(); + } + } + private DataTemplate InternalItemTemplate { get { @@ -294,6 +306,18 @@ namespace Tizen.NUI.Components /// /// 9 public virtual ItemsLayouter ItemsLayouter + { + get + { + return GetValue(ItemsLayouterProperty) as ItemsLayouter; + } + set + { + SetValue(ItemsLayouterProperty, value); + NotifyPropertyChanged(); + } + } + private ItemsLayouter InternalItemsLayouter { get { @@ -329,6 +353,18 @@ namespace Tizen.NUI.Components /// /// 9 public new Direction ScrollingDirection + { + get + { + return (Direction)GetValue(ScrollingDirectionProperty); + } + set + { + SetValue(ScrollingDirectionProperty, value); + NotifyPropertyChanged(); + } + } + private Direction InternalScrollingDirection { get { @@ -379,13 +415,37 @@ namespace Tizen.NUI.Components /// Command of selection changed. /// [EditorBrowsable(EditorBrowsableState.Never)] - public ICommand SelectionChangedCommand { set; get; } + public ICommand SelectionChangedCommand + { + get + { + return GetValue(SelectionChangedCommandProperty) as ICommand; + } + set + { + SetValue(SelectionChangedCommandProperty, value); + NotifyPropertyChanged(); + } + } + private ICommand InternalSelectionChangedCommand { set; get; } /// /// Command parameter of selection changed. /// [EditorBrowsable(EditorBrowsableState.Never)] - public object SelectionChangedCommandParameter { set; get; } + public object SelectionChangedCommandParameter + { + get + { + return GetValue(SelectionChangedCommandParameterProperty); + } + set + { + SetValue(SelectionChangedCommandParameterProperty, value); + NotifyPropertyChanged(); + } + } + private object InternalSelectionChangedCommandParameter { set; get; } /// /// Header item placed in top-most position. @@ -393,6 +453,18 @@ namespace Tizen.NUI.Components /// Please note that, internal index will be increased by header. /// 9 public RecyclerViewItem Header + { + get + { + return GetValue(HeaderProperty) as RecyclerViewItem; + } + set + { + SetValue(HeaderProperty, value); + NotifyPropertyChanged(); + } + } + private RecyclerViewItem InternalHeader { get => header; set @@ -425,6 +497,18 @@ namespace Tizen.NUI.Components /// Please note that, internal index will be increased by footer. /// 9 public RecyclerViewItem Footer + { + get + { + return GetValue(FooterProperty) as RecyclerViewItem; + } + set + { + SetValue(FooterProperty, value); + NotifyPropertyChanged(); + } + } + private RecyclerViewItem InternalFooter { get => footer; set @@ -456,6 +540,18 @@ namespace Tizen.NUI.Components /// [EditorBrowsable(EditorBrowsableState.Never)] public bool IsGrouped + { + get + { + return (bool)GetValue(IsGroupedProperty); + } + set + { + SetValue(IsGroupedProperty, value); + NotifyPropertyChanged(); + } + } + private bool InternalIsGrouped { get => isGrouped; set @@ -481,6 +577,18 @@ namespace Tizen.NUI.Components /// GroupHeaderTemplate is essential for groupable view. [EditorBrowsable(EditorBrowsableState.Never)] public DataTemplate GroupHeaderTemplate + { + get + { + return GetValue(GroupHeaderTemplateProperty) as DataTemplate; + } + set + { + SetValue(GroupHeaderTemplateProperty, value); + NotifyPropertyChanged(); + } + } + private DataTemplate InternalGroupHeaderTemplate { get { @@ -508,6 +616,18 @@ namespace Tizen.NUI.Components /// Please note that, internal index will be increased by group footer. [EditorBrowsable(EditorBrowsableState.Never)] public DataTemplate GroupFooterTemplate + { + get + { + return GetValue(GroupFooterTemplateProperty) as DataTemplate; + } + set + { + SetValue(GroupFooterTemplateProperty, value); + NotifyPropertyChanged(); + } + } + private DataTemplate InternalGroupFooterTemplate { get { diff --git a/src/Tizen.NUI.Components/Controls/RecyclerView/CollectionViewBindableProperty.cs b/src/Tizen.NUI.Components/Controls/RecyclerView/CollectionViewBindableProperty.cs new file mode 100755 index 000000000..25d15f4dc --- /dev/null +++ b/src/Tizen.NUI.Components/Controls/RecyclerView/CollectionViewBindableProperty.cs @@ -0,0 +1,189 @@ +using System.ComponentModel; +using System.Windows.Input; +using Tizen.NUI.Binding; + +namespace Tizen.NUI.Components +{ + public partial class CollectionView + { + /// + /// ItemTemplateProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly new BindableProperty ItemTemplateProperty = BindableProperty.Create(nameof(ItemTemplate), typeof(DataTemplate), typeof(CollectionView), null, propertyChanged: (bindable, oldValue, newValue) => + { + var instance = (CollectionView)bindable; + if (newValue != null) + { + instance.InternalItemTemplate = newValue as DataTemplate; + } + }, + defaultValueCreator: (bindable) => + { + var instance = (CollectionView)bindable; + return instance.InternalItemTemplate; + }); + + /// + /// ItemsLayouterProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty ItemsLayouterProperty = BindableProperty.Create(nameof(ItemsLayouter), typeof(ItemsLayouter), typeof(CollectionView), null, propertyChanged: (bindable, oldValue, newValue) => + { + var instance = (CollectionView)bindable; + if (newValue != null) + { + instance.InternalItemsLayouter = newValue as ItemsLayouter; + } + }, + defaultValueCreator: (bindable) => + { + var instance = (CollectionView)bindable; + return instance.InternalItemsLayouter; + }); + + /// + /// ScrollingDirectionProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly new BindableProperty ScrollingDirectionProperty = BindableProperty.Create(nameof(ScrollingDirection), typeof(Tizen.NUI.Components.ScrollableBase.Direction), typeof(CollectionView), default(Direction), propertyChanged: (bindable, oldValue, newValue) => + { + var instance = (CollectionView)bindable; + if (newValue != null) + { + instance.InternalScrollingDirection = (Direction)newValue; + } + }, + defaultValueCreator: (bindable) => + { + var instance = (CollectionView)bindable; + return instance.InternalScrollingDirection; + }); + + /// + /// SelectionChangedCommandProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty SelectionChangedCommandProperty = BindableProperty.Create(nameof(SelectionChangedCommand), typeof(ICommand), typeof(CollectionView), null, propertyChanged: (bindable, oldValue, newValue) => + { + var instance = (CollectionView)bindable; + if (newValue != null) + { + instance.InternalSelectionChangedCommand = newValue as ICommand; + } + }, + defaultValueCreator: (bindable) => + { + var instance = (CollectionView)bindable; + return instance.InternalSelectionChangedCommand; + }); + + /// + /// SelectionChangedCommandParameterProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty SelectionChangedCommandParameterProperty = BindableProperty.Create(nameof(SelectionChangedCommandParameter), typeof(object), typeof(CollectionView), null, propertyChanged: (bindable, oldValue, newValue) => + { + var instance = (CollectionView)bindable; + if (newValue != null) + { + instance.InternalSelectionChangedCommandParameter = newValue; + } + }, + defaultValueCreator: (bindable) => + { + var instance = (CollectionView)bindable; + return instance.InternalSelectionChangedCommandParameter; + }); + + /// + /// HeaderProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty HeaderProperty = BindableProperty.Create(nameof(Header), typeof(RecyclerViewItem), typeof(CollectionView), null, propertyChanged: (bindable, oldValue, newValue) => + { + var instance = (CollectionView)bindable; + if (newValue != null) + { + instance.InternalHeader = newValue as RecyclerViewItem; + } + }, + defaultValueCreator: (bindable) => + { + var instance = (CollectionView)bindable; + return instance.InternalHeader; + }); + + /// + /// FooterProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty FooterProperty = BindableProperty.Create(nameof(Footer), typeof(RecyclerViewItem), typeof(CollectionView), null, propertyChanged: (bindable, oldValue, newValue) => + { + var instance = (CollectionView)bindable; + if (newValue != null) + { + instance.InternalFooter = newValue as RecyclerViewItem; + } + }, + defaultValueCreator: (bindable) => + { + var instance = (CollectionView)bindable; + return instance.InternalFooter; + }); + + /// + /// IsGroupedProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty IsGroupedProperty = BindableProperty.Create(nameof(IsGrouped), typeof(bool), typeof(CollectionView), default(bool), propertyChanged: (bindable, oldValue, newValue) => + { + var instance = (CollectionView)bindable; + if (newValue != null) + { + instance.InternalIsGrouped = (bool)newValue; + } + }, + defaultValueCreator: (bindable) => + { + var instance = (CollectionView)bindable; + return instance.InternalIsGrouped; + }); + + /// + /// GroupHeaderTemplateProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty GroupHeaderTemplateProperty = BindableProperty.Create(nameof(GroupHeaderTemplate), typeof(DataTemplate), typeof(CollectionView), null, propertyChanged: (bindable, oldValue, newValue) => + { + var instance = (CollectionView)bindable; + if (newValue != null) + { + instance.InternalGroupHeaderTemplate = newValue as DataTemplate; + } + }, + defaultValueCreator: (bindable) => + { + var instance = (CollectionView)bindable; + return instance.InternalGroupHeaderTemplate; + }); + + /// + /// GroupFooterTemplateProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty GroupFooterTemplateProperty = BindableProperty.Create(nameof(GroupFooterTemplate), typeof(DataTemplate), typeof(CollectionView), null, propertyChanged: (bindable, oldValue, newValue) => + { + var instance = (CollectionView)bindable; + if (newValue != null) + { + instance.InternalGroupFooterTemplate = newValue as DataTemplate; + } + }, + defaultValueCreator: (bindable) => + { + var instance = (CollectionView)bindable; + return instance.InternalGroupFooterTemplate; + }); + } +} diff --git a/src/Tizen.NUI.Components/Controls/RecyclerView/Item/DefaultGridItem.cs b/src/Tizen.NUI.Components/Controls/RecyclerView/Item/DefaultGridItem.cs index cd19b3d2d..6ac1af402 100755 --- a/src/Tizen.NUI.Components/Controls/RecyclerView/Item/DefaultGridItem.cs +++ b/src/Tizen.NUI.Components/Controls/RecyclerView/Item/DefaultGridItem.cs @@ -25,7 +25,7 @@ namespace Tizen.NUI.Components /// DefaultGridItem may contain text or an icon. /// [EditorBrowsable(EditorBrowsableState.Never)] - public class DefaultGridItem : RecyclerViewItem + public partial class DefaultGridItem : RecyclerViewItem { private TextLabel itemLabel; private ImageView itemImage; @@ -132,6 +132,18 @@ namespace Tizen.NUI.Components /// [EditorBrowsable(EditorBrowsableState.Never)] public View Badge + { + get + { + return GetValue(BadgeProperty) as View; + } + set + { + SetValue(BadgeProperty, value); + NotifyPropertyChanged(); + } + } + private View InternalBadge { get { @@ -202,6 +214,18 @@ namespace Tizen.NUI.Components /// [EditorBrowsable(EditorBrowsableState.Never)] public string Text + { + get + { + return GetValue(TextProperty) as string; + } + set + { + SetValue(TextProperty, value); + NotifyPropertyChanged(); + } + } + private string InternalText { get { @@ -218,6 +242,18 @@ namespace Tizen.NUI.Components /// [EditorBrowsable(EditorBrowsableState.Never)] public LabelOrientation LabelOrientationType + { + get + { + return (Tizen.NUI.Components.DefaultGridItem.LabelOrientation)GetValue(LabelOrientationTypeProperty); + } + set + { + SetValue(LabelOrientationTypeProperty, value); + NotifyPropertyChanged(); + } + } + private Tizen.NUI.Components.DefaultGridItem.LabelOrientation InternalLabelOrientationType { get { diff --git a/src/Tizen.NUI.Components/Controls/RecyclerView/Item/DefaultGridItemBindableProperty.cs b/src/Tizen.NUI.Components/Controls/RecyclerView/Item/DefaultGridItemBindableProperty.cs new file mode 100755 index 000000000..4a62d0fdf --- /dev/null +++ b/src/Tizen.NUI.Components/Controls/RecyclerView/Item/DefaultGridItemBindableProperty.cs @@ -0,0 +1,63 @@ +using System.ComponentModel; +using Tizen.NUI.BaseComponents; +using Tizen.NUI.Binding; + +namespace Tizen.NUI.Components +{ + public partial class DefaultGridItem + { + /// + /// BadgeProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty BadgeProperty = BindableProperty.Create(nameof(Badge), typeof(View), typeof(DefaultGridItem), null, propertyChanged: (bindable, oldValue, newValue) => + { + var instance = (DefaultGridItem)bindable; + if (newValue != null) + { + instance.InternalBadge = newValue as View; + } + }, + defaultValueCreator: (bindable) => + { + var instance = (DefaultGridItem)bindable; + return instance.InternalBadge; + }); + + /// + /// TextProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty TextProperty = BindableProperty.Create(nameof(Text), typeof(string), typeof(DefaultGridItem), default(string), propertyChanged: (bindable, oldValue, newValue) => + { + var instance = (DefaultGridItem)bindable; + if (newValue != null) + { + instance.InternalText = newValue as string; + } + }, + defaultValueCreator: (bindable) => + { + var instance = (DefaultGridItem)bindable; + return instance.InternalText; + }); + + /// + /// LabelOrientationTypeProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty LabelOrientationTypeProperty = BindableProperty.Create(nameof(LabelOrientationType), typeof(Tizen.NUI.Components.DefaultGridItem.LabelOrientation), typeof(DefaultGridItem), default(LabelOrientation), propertyChanged: (bindable, oldValue, newValue) => + { + var instance = (DefaultGridItem)bindable; + if (newValue != null) + { + instance.InternalLabelOrientationType = (Tizen.NUI.Components.DefaultGridItem.LabelOrientation)newValue; + } + }, + defaultValueCreator: (bindable) => + { + var instance = (DefaultGridItem)bindable; + return instance.InternalLabelOrientationType; + }); + } +} diff --git a/src/Tizen.NUI.Components/Controls/RecyclerView/Item/DefaultLinearItem.cs b/src/Tizen.NUI.Components/Controls/RecyclerView/Item/DefaultLinearItem.cs index 37918b9c8..5ee179753 100755 --- a/src/Tizen.NUI.Components/Controls/RecyclerView/Item/DefaultLinearItem.cs +++ b/src/Tizen.NUI.Components/Controls/RecyclerView/Item/DefaultLinearItem.cs @@ -25,7 +25,7 @@ namespace Tizen.NUI.Components /// DefaultLinearItem may contain text or an icon. /// [EditorBrowsable(EditorBrowsableState.Never)] - public class DefaultLinearItem : RecyclerViewItem + public partial class DefaultLinearItem : RecyclerViewItem { private View itemIcon; private TextLabel itemLabel; @@ -69,6 +69,18 @@ namespace Tizen.NUI.Components /// [EditorBrowsable(EditorBrowsableState.Never)] public View Icon + { + get + { + return GetValue(IconProperty) as View; + } + set + { + SetValue(IconProperty, value); + NotifyPropertyChanged(); + } + } + private View InternalIcon { get { @@ -153,6 +165,18 @@ namespace Tizen.NUI.Components /// [EditorBrowsable(EditorBrowsableState.Never)] public string Text + { + get + { + return GetValue(TextProperty) as string; + } + set + { + SetValue(TextProperty, value); + NotifyPropertyChanged(); + } + } + private string InternalText { get { @@ -195,6 +219,18 @@ namespace Tizen.NUI.Components /// [EditorBrowsable(EditorBrowsableState.Never)] public string SubText + { + get + { + return GetValue(SubTextProperty) as string; + } + set + { + SetValue(SubTextProperty, value); + NotifyPropertyChanged(); + } + } + private string InternalSubText { get { @@ -211,6 +247,18 @@ namespace Tizen.NUI.Components /// [EditorBrowsable(EditorBrowsableState.Never)] public View Extra + { + get + { + return GetValue(ExtraProperty) as View; + } + set + { + SetValue(ExtraProperty, value); + NotifyPropertyChanged(); + } + } + private View InternalExtra { get { diff --git a/src/Tizen.NUI.Components/Controls/RecyclerView/Item/DefaultLinearItemBindableProperty.cs b/src/Tizen.NUI.Components/Controls/RecyclerView/Item/DefaultLinearItemBindableProperty.cs new file mode 100755 index 000000000..bac1abd30 --- /dev/null +++ b/src/Tizen.NUI.Components/Controls/RecyclerView/Item/DefaultLinearItemBindableProperty.cs @@ -0,0 +1,81 @@ +using System.ComponentModel; +using Tizen.NUI.BaseComponents; +using Tizen.NUI.Binding; + +namespace Tizen.NUI.Components +{ + public partial class DefaultLinearItem + { + /// + /// IconProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty IconProperty = BindableProperty.Create(nameof(Icon), typeof(View), typeof(DefaultLinearItem), null, propertyChanged: (bindable, oldValue, newValue) => + { + var instance = (DefaultLinearItem)bindable; + if (newValue != null) + { + instance.InternalIcon = newValue as View; + } + }, + defaultValueCreator: (bindable) => + { + var instance = (DefaultLinearItem)bindable; + return instance.InternalIcon; + }); + + /// + /// TextProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty TextProperty = BindableProperty.Create(nameof(Text), typeof(string), typeof(DefaultLinearItem), default(string), propertyChanged: (bindable, oldValue, newValue) => + { + var instance = (DefaultLinearItem)bindable; + if (newValue != null) + { + instance.InternalText = newValue as string; + } + }, + defaultValueCreator: (bindable) => + { + var instance = (DefaultLinearItem)bindable; + return instance.InternalText; + }); + + /// + /// SubTextProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty SubTextProperty = BindableProperty.Create(nameof(SubText), typeof(string), typeof(DefaultLinearItem), default(string), propertyChanged: (bindable, oldValue, newValue) => + { + var instance = (DefaultLinearItem)bindable; + if (newValue != null) + { + instance.InternalSubText = newValue as string; + } + }, + defaultValueCreator: (bindable) => + { + var instance = (DefaultLinearItem)bindable; + return instance.InternalSubText; + }); + + /// + /// ExtraProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty ExtraProperty = BindableProperty.Create(nameof(Extra), typeof(View), typeof(DefaultLinearItem), null, propertyChanged: (bindable, oldValue, newValue) => + { + var instance = (DefaultLinearItem)bindable; + if (newValue != null) + { + instance.InternalExtra = newValue as View; + } + }, + defaultValueCreator: (bindable) => + { + var instance = (DefaultLinearItem)bindable; + return instance.InternalExtra; + }); + } +} diff --git a/src/Tizen.NUI.Components/Controls/RecyclerView/Item/DefaultTitleItem.cs b/src/Tizen.NUI.Components/Controls/RecyclerView/Item/DefaultTitleItem.cs index 2443b8ad9..834052a3c 100755 --- a/src/Tizen.NUI.Components/Controls/RecyclerView/Item/DefaultTitleItem.cs +++ b/src/Tizen.NUI.Components/Controls/RecyclerView/Item/DefaultTitleItem.cs @@ -25,7 +25,7 @@ namespace Tizen.NUI.Components /// DefaultTitleItem may contain text or an icon. /// [EditorBrowsable(EditorBrowsableState.Never)] - public class DefaultTitleItem : RecyclerViewItem + public partial class DefaultTitleItem : RecyclerViewItem { private TextLabel itemLabel; private View itemIcon; @@ -67,6 +67,18 @@ namespace Tizen.NUI.Components /// [EditorBrowsable(EditorBrowsableState.Never)] public View Icon + { + get + { + return GetValue(IconProperty) as View; + } + set + { + SetValue(IconProperty, value); + NotifyPropertyChanged(); + } + } + private View InternalIcon { get { @@ -151,6 +163,18 @@ namespace Tizen.NUI.Components /// [EditorBrowsable(EditorBrowsableState.Never)] public string Text + { + get + { + return GetValue(TextProperty) as string; + } + set + { + SetValue(TextProperty, value); + NotifyPropertyChanged(); + } + } + private string InternalText { get { diff --git a/src/Tizen.NUI.Components/Controls/RecyclerView/Item/DefaultTitleItemBindableProperty.cs b/src/Tizen.NUI.Components/Controls/RecyclerView/Item/DefaultTitleItemBindableProperty.cs new file mode 100755 index 000000000..104ca2cf0 --- /dev/null +++ b/src/Tizen.NUI.Components/Controls/RecyclerView/Item/DefaultTitleItemBindableProperty.cs @@ -0,0 +1,45 @@ +using System.ComponentModel; +using Tizen.NUI.BaseComponents; +using Tizen.NUI.Binding; + +namespace Tizen.NUI.Components +{ + public partial class DefaultTitleItem + { + /// + /// IconProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty IconProperty = BindableProperty.Create(nameof(Icon), typeof(View), typeof(DefaultTitleItem), null, propertyChanged: (bindable, oldValue, newValue) => + { + var instance = (DefaultTitleItem)bindable; + if (newValue != null) + { + instance.InternalIcon = newValue as View; + } + }, + defaultValueCreator: (bindable) => + { + var instance = (DefaultTitleItem)bindable; + return instance.InternalIcon; + }); + + /// + /// TextProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty TextProperty = BindableProperty.Create(nameof(Text), typeof(string), typeof(DefaultTitleItem), default(string), propertyChanged: (bindable, oldValue, newValue) => + { + var instance = (DefaultTitleItem)bindable; + if (newValue != null) + { + instance.InternalText = newValue as string; + } + }, + defaultValueCreator: (bindable) => + { + var instance = (DefaultTitleItem)bindable; + return instance.InternalText; + }); + } +} diff --git a/src/Tizen.NUI.Components/Controls/RecyclerView/RecyclerView.cs b/src/Tizen.NUI.Components/Controls/RecyclerView/RecyclerView.cs index e29920944..935e31428 100755 --- a/src/Tizen.NUI.Components/Controls/RecyclerView/RecyclerView.cs +++ b/src/Tizen.NUI.Components/Controls/RecyclerView/RecyclerView.cs @@ -27,6 +27,42 @@ namespace Tizen.NUI.Components /// 9 public abstract class RecyclerView : ScrollableBase, ICollectionChangedNotifier { + /// + /// ItemsSourceProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty ItemsSourceProperty = BindableProperty.Create(nameof(ItemsSource), typeof(IEnumerable), typeof(RecyclerView), null, propertyChanged: (bindable, oldValue, newValue) => + { + var instance = (RecyclerView)bindable; + if (newValue != null) + { + instance.InternalItemsSource = newValue as IEnumerable; + } + }, + defaultValueCreator: (bindable) => + { + var instance = (RecyclerView)bindable; + return instance.InternalItemsSource; + }); + + /// + /// ItemTemplateProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty ItemTemplateProperty = BindableProperty.Create(nameof(ItemTemplate), typeof(DataTemplate), typeof(RecyclerView), null, propertyChanged: (bindable, oldValue, newValue) => + { + var instance = (RecyclerView)bindable; + if (newValue != null) + { + instance.InternalItemTemplate = newValue as DataTemplate; + } + }, + defaultValueCreator: (bindable) => + { + var instance = (RecyclerView)bindable; + return instance.InternalItemTemplate; + }); + /// /// Base Constructor /// @@ -40,13 +76,37 @@ namespace Tizen.NUI.Components /// Item's source data. /// /// 9 - public virtual IEnumerable ItemsSource { get; set; } + public virtual IEnumerable ItemsSource + { + get + { + return GetValue(ItemsSourceProperty) as IEnumerable; + } + set + { + SetValue(ItemsSourceProperty, value); + NotifyPropertyChanged(); + } + } + private IEnumerable InternalItemsSource { get; set; } /// /// DataTemplate for items. /// /// 9 - public virtual DataTemplate ItemTemplate { get; set; } + public virtual DataTemplate ItemTemplate + { + get + { + return GetValue(ItemTemplateProperty) as DataTemplate; + } + set + { + SetValue(ItemTemplateProperty, value); + NotifyPropertyChanged(); + } + } + private DataTemplate InternalItemTemplate { get; set; } /// /// Internal encapsulated items data source. diff --git a/src/Tizen.NUI.Components/Controls/ScrollBarBindableProperty.cs b/src/Tizen.NUI.Components/Controls/ScrollBarBindableProperty.cs new file mode 100755 index 000000000..ab294c87e --- /dev/null +++ b/src/Tizen.NUI.Components/Controls/ScrollBarBindableProperty.cs @@ -0,0 +1,80 @@ +using System.ComponentModel; +using Tizen.NUI.Binding; + +namespace Tizen.NUI.Components +{ + public partial class ScrollBar + { + /// + /// ThumbSizeProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty ThumbSizeProperty = BindableProperty.Create(nameof(ThumbSize), typeof(Size), typeof(ScrollBar), null, propertyChanged: (bindable, oldValue, newValue) => + { + var instance = (ScrollBar)bindable; + if (newValue != null) + { + instance.InternalThumbSize = newValue as Size; + } + }, + defaultValueCreator: (bindable) => + { + var instance = (ScrollBar)bindable; + return instance.InternalThumbSize; + }); + + /// + /// TrackImageURLProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty TrackImageURLProperty = BindableProperty.Create(nameof(TrackImageURL), typeof(string), typeof(ScrollBar), default(string), propertyChanged: (bindable, oldValue, newValue) => + { + var instance = (ScrollBar)bindable; + if (newValue != null) + { + instance.InternalTrackImageURL = newValue as string; + } + }, + defaultValueCreator: (bindable) => + { + var instance = (ScrollBar)bindable; + return instance.InternalTrackImageURL; + }); + + /// + /// TrackColorProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty TrackColorProperty = BindableProperty.Create(nameof(TrackColor), typeof(Color), typeof(ScrollBar), null, propertyChanged: (bindable, oldValue, newValue) => + { + var instance = (ScrollBar)bindable; + if (newValue != null) + { + instance.InternalTrackColor = newValue as Color; + } + }, + defaultValueCreator: (bindable) => + { + var instance = (ScrollBar)bindable; + return instance.InternalTrackColor; + }); + + /// + /// ThumbColorProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty ThumbColorProperty = BindableProperty.Create(nameof(ThumbColor), typeof(Color), typeof(ScrollBar), null, propertyChanged: (bindable, oldValue, newValue) => + { + var instance = (ScrollBar)bindable; + if (newValue != null) + { + instance.InternalThumbColor = newValue as Color; + } + }, + defaultValueCreator: (bindable) => + { + var instance = (ScrollBar)bindable; + return instance.InternalThumbColor; + }); + } +} diff --git a/src/Tizen.NUI.Components/Controls/ScrollableBase.cs b/src/Tizen.NUI.Components/Controls/ScrollableBase.cs index 0ca84a7a2..4cf0d3642 100755 --- a/src/Tizen.NUI.Components/Controls/ScrollableBase.cs +++ b/src/Tizen.NUI.Components/Controls/ScrollableBase.cs @@ -142,7 +142,7 @@ namespace Tizen.NUI.Components /// This class provides a View that can scroll a single View with a layout. This View can be a nest of Views. /// /// 8 - public class ScrollableBase : Control + public partial class ScrollableBase : Control { static bool LayoutDebugScrollableBase = false; // Debug flag private Direction mScrollingDirection = Direction.Vertical; @@ -251,6 +251,18 @@ namespace Tizen.NUI.Components /// /// 8 public Direction ScrollingDirection + { + get + { + return (Direction)GetValue(ScrollingDirectionProperty); + } + set + { + SetValue(ScrollingDirectionProperty, value); + NotifyPropertyChanged(); + } + } + private Direction InternalScrollingDirection { get { @@ -280,6 +292,18 @@ namespace Tizen.NUI.Components /// /// 8 public bool ScrollEnabled + { + get + { + return (bool)GetValue(ScrollEnabledProperty); + } + set + { + SetValue(ScrollEnabledProperty, value); + NotifyPropertyChanged(); + } + } + private bool InternalScrollEnabled { get { @@ -316,7 +340,19 @@ namespace Tizen.NUI.Components /// Default is false. /// /// 8 - public bool SnapToPage { set; get; } = false; + public bool SnapToPage + { + get + { + return (bool)GetValue(SnapToPageProperty); + } + set + { + SetValue(SnapToPageProperty, value); + NotifyPropertyChanged(); + } + } + private bool InternalSnapToPage { set; get; } = false; /// /// Get current page. @@ -331,6 +367,18 @@ namespace Tizen.NUI.Components /// /// 8 public int ScrollDuration + { + get + { + return (int)GetValue(ScrollDurationProperty); + } + set + { + SetValue(ScrollDurationProperty, value); + NotifyPropertyChanged(); + } + } + private int InternalScrollDuration { set { @@ -346,7 +394,19 @@ namespace Tizen.NUI.Components /// Scroll Available area. /// /// 8 - public Vector2 ScrollAvailableArea { set; get; } + public Vector2 ScrollAvailableArea + { + get + { + return GetValue(ScrollAvailableAreaProperty) as Vector2; + } + set + { + SetValue(ScrollAvailableAreaProperty, value); + NotifyPropertyChanged(); + } + } + private Vector2 InternalScrollAvailableArea { set; get; } /// /// An event emitted when user starts dragging ScrollableBase, user can subscribe or unsubscribe to this event handler.
@@ -389,6 +449,18 @@ namespace Tizen.NUI.Components ///
/// 8 public ScrollbarBase Scrollbar + { + get + { + return GetValue(ScrollbarProperty) as ScrollbarBase; + } + set + { + SetValue(ScrollbarProperty, value); + NotifyPropertyChanged(); + } + } + private ScrollbarBase InternalScrollbar { get { @@ -426,6 +498,18 @@ namespace Tizen.NUI.Components /// /// 8 public bool HideScrollbar + { + get + { + return (bool)GetValue(HideScrollbarProperty); + } + set + { + SetValue(HideScrollbarProperty, value); + NotifyPropertyChanged(); + } + } + private bool InternalHideScrollbar { get { @@ -460,6 +544,18 @@ namespace Tizen.NUI.Components /// /// 8 public new LayoutItem Layout + { + get + { + return GetValue(LayoutProperty) as LayoutItem; + } + set + { + SetValue(LayoutProperty, value); + NotifyPropertyChanged(); + } + } + private LayoutItem InternalLayout { get { @@ -490,6 +586,18 @@ namespace Tizen.NUI.Components /// /// 8 public float DecelerationRate + { + get + { + return (float)GetValue(DecelerationRateProperty); + } + set + { + SetValue(DecelerationRateProperty, value); + NotifyPropertyChanged(); + } + } + private float InternalDecelerationRate { get { @@ -506,7 +614,19 @@ namespace Tizen.NUI.Components /// Threshold not to go infinite at the end of scrolling animation. /// [EditorBrowsable(EditorBrowsableState.Never)] - public float DecelerationThreshold { get; set; } = 0.1f; + public float DecelerationThreshold + { + get + { + return (float)GetValue(DecelerationThresholdProperty); + } + set + { + SetValue(DecelerationThresholdProperty, value); + NotifyPropertyChanged(); + } + } + private float InternalDecelerationThreshold { get; set; } = 0.1f; /// /// Scrolling event will be thrown when this amount of scroll position is changed. @@ -516,6 +636,18 @@ namespace Tizen.NUI.Components /// [EditorBrowsable(EditorBrowsableState.Never)] public float ScrollingEventThreshold + { + get + { + return (float)GetValue(ScrollingEventThresholdProperty); + } + set + { + SetValue(ScrollingEventThresholdProperty, value); + NotifyPropertyChanged(); + } + } + private float InternalScrollingEventThreshold { get { @@ -539,6 +671,18 @@ namespace Tizen.NUI.Components /// /// 8 public float PageFlickThreshold + { + get + { + return (float)GetValue(PageFlickThresholdProperty); + } + set + { + SetValue(PageFlickThresholdProperty, value); + NotifyPropertyChanged(); + } + } + private float InternalPageFlickThreshold { get { @@ -555,6 +699,18 @@ namespace Tizen.NUI.Components /// [EditorBrowsable(EditorBrowsableState.Never)] public new Extents Padding + { + get + { + return GetValue(PaddingProperty) as Extents; + } + set + { + SetValue(PaddingProperty, value); + NotifyPropertyChanged(); + } + } + private Extents InternalPadding { get { @@ -570,7 +726,19 @@ namespace Tizen.NUI.Components /// Alphafunction for scroll animation. /// [EditorBrowsable(EditorBrowsableState.Never)] - public AlphaFunction ScrollAlphaFunction { get; set; } = new AlphaFunction(AlphaFunction.BuiltinFunctions.Linear); + public AlphaFunction ScrollAlphaFunction + { + get + { + return GetValue(ScrollAlphaFunctionProperty) as AlphaFunction; + } + set + { + SetValue(ScrollAlphaFunctionProperty, value); + NotifyPropertyChanged(); + } + } + private AlphaFunction InternalScrollAlphaFunction { get; set; } = new AlphaFunction(AlphaFunction.BuiltinFunctions.Linear); private bool hideScrollbar = true; private float maxScrollDistance; @@ -592,6 +760,18 @@ namespace Tizen.NUI.Components [EditorBrowsable(EditorBrowsableState.Never)] // Let's consider more whether this needs to be set as protected. public float NoticeAnimationEndBeforePosition + { + get + { + return (float)GetValue(NoticeAnimationEndBeforePositionProperty); + } + set + { + SetValue(NoticeAnimationEndBeforePositionProperty, value); + NotifyPropertyChanged(); + } + } + private float InternalNoticeAnimationEndBeforePosition { get => noticeAnimationEndBeforePosition; set => noticeAnimationEndBeforePosition = value; @@ -1110,7 +1290,19 @@ namespace Tizen.NUI.Components /// Enable/Disable overshooting effect. default is disabled. /// [EditorBrowsable(EditorBrowsableState.Never)] - public bool EnableOverShootingEffect { get; set; } = false; + public bool EnableOverShootingEffect + { + get + { + return (bool)GetValue(EnableOverShootingEffectProperty); + } + set + { + SetValue(EnableOverShootingEffectProperty, value); + NotifyPropertyChanged(); + } + } + private bool InternalEnableOverShootingEffect { get; set; } = false; private void AttachOverShootingShadowView() { diff --git a/src/Tizen.NUI.Components/Controls/ScrollableBaseBindableProperty.cs b/src/Tizen.NUI.Components/Controls/ScrollableBaseBindableProperty.cs new file mode 100755 index 000000000..ff05089ae --- /dev/null +++ b/src/Tizen.NUI.Components/Controls/ScrollableBaseBindableProperty.cs @@ -0,0 +1,296 @@ +using System.ComponentModel; +using Tizen.NUI.Binding; + +namespace Tizen.NUI.Components +{ + public partial class ScrollableBase + { + /// + /// ScrollingDirectionProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty ScrollingDirectionProperty = BindableProperty.Create(nameof(ScrollingDirection), typeof(Direction), typeof(ScrollableBase), default(Direction), propertyChanged: (bindable, oldValue, newValue) => + { + var instance = (ScrollableBase)bindable; + if (newValue != null) + { + instance.InternalScrollingDirection = (Direction)newValue; + } + }, + defaultValueCreator: (bindable) => + { + var instance = (ScrollableBase)bindable; + return instance.InternalScrollingDirection; + }); + + /// + /// ScrollEnabledProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty ScrollEnabledProperty = BindableProperty.Create(nameof(ScrollEnabled), typeof(bool), typeof(ScrollableBase), default(bool), propertyChanged: (bindable, oldValue, newValue) => + { + var instance = (ScrollableBase)bindable; + if (newValue != null) + { + instance.InternalScrollEnabled = (bool)newValue; + } + }, + defaultValueCreator: (bindable) => + { + var instance = (ScrollableBase)bindable; + return instance.InternalScrollEnabled; + }); + + /// + /// SnapToPageProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty SnapToPageProperty = BindableProperty.Create(nameof(SnapToPage), typeof(bool), typeof(ScrollableBase), default(bool), propertyChanged: (bindable, oldValue, newValue) => + { + var instance = (ScrollableBase)bindable; + if (newValue != null) + { + instance.InternalSnapToPage = (bool)newValue; + } + }, + defaultValueCreator: (bindable) => + { + var instance = (ScrollableBase)bindable; + return instance.InternalSnapToPage; + }); + + /// + /// ScrollDurationProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty ScrollDurationProperty = BindableProperty.Create(nameof(ScrollDuration), typeof(int), typeof(ScrollableBase), default(int), propertyChanged: (bindable, oldValue, newValue) => + { + var instance = (ScrollableBase)bindable; + if (newValue != null) + { + instance.InternalScrollDuration = (int)newValue; + } + }, + defaultValueCreator: (bindable) => + { + var instance = (ScrollableBase)bindable; + return instance.InternalScrollDuration; + }); + + /// + /// ScrollAvailableAreaProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty ScrollAvailableAreaProperty = BindableProperty.Create(nameof(ScrollAvailableArea), typeof(Vector2), typeof(ScrollableBase), null, propertyChanged: (bindable, oldValue, newValue) => + { + var instance = (ScrollableBase)bindable; + if (newValue != null) + { + instance.InternalScrollAvailableArea = newValue as Vector2; + } + }, + defaultValueCreator: (bindable) => + { + var instance = (ScrollableBase)bindable; + return instance.InternalScrollAvailableArea; + }); + + /// + /// ScrollbarProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty ScrollbarProperty = BindableProperty.Create(nameof(Scrollbar), typeof(ScrollbarBase), typeof(ScrollableBase), null, propertyChanged: (bindable, oldValue, newValue) => + { + var instance = (ScrollableBase)bindable; + if (newValue != null) + { + instance.InternalScrollbar = newValue as ScrollbarBase; + } + }, + defaultValueCreator: (bindable) => + { + var instance = (ScrollableBase)bindable; + return instance.InternalScrollbar; + }); + + /// + /// HideScrollbarProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty HideScrollbarProperty = BindableProperty.Create(nameof(HideScrollbar), typeof(bool), typeof(ScrollableBase), default(bool), propertyChanged: (bindable, oldValue, newValue) => + { + var instance = (ScrollableBase)bindable; + if (newValue != null) + { + instance.InternalHideScrollbar = (bool)newValue; + } + }, + defaultValueCreator: (bindable) => + { + var instance = (ScrollableBase)bindable; + return instance.InternalHideScrollbar; + }); + + /// + /// LayoutProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly new BindableProperty LayoutProperty = BindableProperty.Create(nameof(Layout), typeof(LayoutItem), typeof(ScrollableBase), null, propertyChanged: (bindable, oldValue, newValue) => + { + var instance = (ScrollableBase)bindable; + if (newValue != null) + { + instance.InternalLayout = newValue as LayoutItem; + } + }, + defaultValueCreator: (bindable) => + { + var instance = (ScrollableBase)bindable; + return instance.InternalLayout; + }); + + /// + /// DecelerationRateProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty DecelerationRateProperty = BindableProperty.Create(nameof(DecelerationRate), typeof(float), typeof(ScrollableBase), default(float), propertyChanged: (bindable, oldValue, newValue) => + { + var instance = (ScrollableBase)bindable; + if (newValue != null) + { + instance.InternalDecelerationRate = (float)newValue; + } + }, + defaultValueCreator: (bindable) => + { + var instance = (ScrollableBase)bindable; + return instance.InternalDecelerationRate; + }); + + /// + /// DecelerationThresholdProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty DecelerationThresholdProperty = BindableProperty.Create(nameof(DecelerationThreshold), typeof(float), typeof(ScrollableBase), default(float), propertyChanged: (bindable, oldValue, newValue) => + { + var instance = (ScrollableBase)bindable; + if (newValue != null) + { + instance.InternalDecelerationThreshold = (float)newValue; + } + }, + defaultValueCreator: (bindable) => + { + var instance = (ScrollableBase)bindable; + return instance.InternalDecelerationThreshold; + }); + + /// + /// ScrollingEventThresholdProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty ScrollingEventThresholdProperty = BindableProperty.Create(nameof(ScrollingEventThreshold), typeof(float), typeof(ScrollableBase), default(float), propertyChanged: (bindable, oldValue, newValue) => + { + var instance = (ScrollableBase)bindable; + if (newValue != null) + { + instance.InternalScrollingEventThreshold = (float)newValue; + } + }, + defaultValueCreator: (bindable) => + { + var instance = (ScrollableBase)bindable; + return instance.InternalScrollingEventThreshold; + }); + + /// + /// PageFlickThresholdProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty PageFlickThresholdProperty = BindableProperty.Create(nameof(PageFlickThreshold), typeof(float), typeof(ScrollableBase), default(float), propertyChanged: (bindable, oldValue, newValue) => + { + var instance = (ScrollableBase)bindable; + if (newValue != null) + { + instance.InternalPageFlickThreshold = (float)newValue; + } + }, + defaultValueCreator: (bindable) => + { + var instance = (ScrollableBase)bindable; + return instance.InternalPageFlickThreshold; + }); + + /// + /// PaddingProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly new BindableProperty PaddingProperty = BindableProperty.Create(nameof(Padding), typeof(Extents), typeof(ScrollableBase), null, propertyChanged: (bindable, oldValue, newValue) => + { + var instance = (ScrollableBase)bindable; + if (newValue != null) + { + instance.InternalPadding = newValue as Extents; + } + }, + defaultValueCreator: (bindable) => + { + var instance = (ScrollableBase)bindable; + return instance.InternalPadding; + }); + + /// + /// ScrollAlphaFunctionProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty ScrollAlphaFunctionProperty = BindableProperty.Create(nameof(ScrollAlphaFunction), typeof(AlphaFunction), typeof(ScrollableBase), null, propertyChanged: (bindable, oldValue, newValue) => + { + var instance = (ScrollableBase)bindable; + if (newValue != null) + { + instance.InternalScrollAlphaFunction = newValue as AlphaFunction; + } + }, + defaultValueCreator: (bindable) => + { + var instance = (ScrollableBase)bindable; + return instance.InternalScrollAlphaFunction; + }); + + /// + /// NoticeAnimationEndBeforePositionProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty NoticeAnimationEndBeforePositionProperty = BindableProperty.Create(nameof(NoticeAnimationEndBeforePosition), typeof(float), typeof(ScrollableBase), default(float), propertyChanged: (bindable, oldValue, newValue) => + { + var instance = (ScrollableBase)bindable; + if (newValue != null) + { + instance.InternalNoticeAnimationEndBeforePosition = (float)newValue; + } + }, + defaultValueCreator: (bindable) => + { + var instance = (ScrollableBase)bindable; + return instance.InternalNoticeAnimationEndBeforePosition; + }); + + /// + /// EnableOverShootingEffectProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty EnableOverShootingEffectProperty = BindableProperty.Create(nameof(EnableOverShootingEffect), typeof(bool), typeof(ScrollableBase), default(bool), propertyChanged: (bindable, oldValue, newValue) => + { + var instance = (ScrollableBase)bindable; + if (newValue != null) + { + instance.InternalEnableOverShootingEffect = (bool)newValue; + } + }, + defaultValueCreator: (bindable) => + { + var instance = (ScrollableBase)bindable; + return instance.InternalEnableOverShootingEffect; + }); + } +} diff --git a/src/Tizen.NUI.Components/Controls/Slider.cs b/src/Tizen.NUI.Components/Controls/Slider.cs index 7ac6ed94e..905a78b97 100755 --- a/src/Tizen.NUI.Components/Controls/Slider.cs +++ b/src/Tizen.NUI.Components/Controls/Slider.cs @@ -67,10 +67,10 @@ namespace Tizen.NUI.Components public partial class Slider : Control { /// - /// IndicatorTypeProperty + /// SpaceBetweenTrackAndIndicatorProperty /// [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty IndicatorTypeProperty = BindableProperty.Create("IndicatorType", typeof(IndicatorType), typeof(Slider), IndicatorType.None, propertyChanged: (bindable, oldValue, newValue) => + public static readonly BindableProperty IndicatorProperty = BindableProperty.Create(nameof(Indicator), typeof(IndicatorType), typeof(Slider), IndicatorType.None, propertyChanged: (bindable, oldValue, newValue) => { var instance = (Slider)bindable; if (newValue != null) @@ -392,6 +392,18 @@ namespace Tizen.NUI.Components /// /// 6 public DirectionType Direction + { + get + { + return (DirectionType)GetValue(DirectionProperty); + } + set + { + SetValue(DirectionProperty, value); + NotifyPropertyChanged(); + } + } + private DirectionType InternalDirection { get { @@ -420,11 +432,11 @@ namespace Tizen.NUI.Components { get { - return (IndicatorType)GetValue(IndicatorTypeProperty); + return (IndicatorType)GetValue(IndicatorProperty); } set { - SetValue(IndicatorTypeProperty, value); + SetValue(IndicatorProperty, value); } } @@ -433,6 +445,18 @@ namespace Tizen.NUI.Components /// /// 6 public float MinValue + { + get + { + return (float)GetValue(MinValueProperty); + } + set + { + SetValue(MinValueProperty, value); + NotifyPropertyChanged(); + } + } + private float InternalMinValue { get { @@ -450,6 +474,18 @@ namespace Tizen.NUI.Components /// /// 6 public float MaxValue + { + get + { + return (float)GetValue(MaxValueProperty); + } + set + { + SetValue(MaxValueProperty, value); + NotifyPropertyChanged(); + } + } + private float InternalMaxValue { get { @@ -483,6 +519,18 @@ namespace Tizen.NUI.Components /// /// 6 public Size ThumbSize + { + get + { + return GetValue(ThumbSizeProperty) as Size; + } + set + { + SetValue(ThumbSizeProperty, value); + NotifyPropertyChanged(); + } + } + private Size InternalThumbSize { get { @@ -505,6 +553,18 @@ namespace Tizen.NUI.Components /// /// 6 public string ThumbImageURL + { + get + { + return GetValue(ThumbImageURLProperty) as string; + } + set + { + SetValue(ThumbImageURLProperty, value); + NotifyPropertyChanged(); + } + } + private string InternalThumbImageURL { get { @@ -529,6 +589,18 @@ namespace Tizen.NUI.Components /// Thrown when setting null value. /// 6 public StringSelector ThumbImageURLSelector + { + get + { + return GetValue(ThumbImageURLSelectorProperty) as StringSelector; + } + set + { + SetValue(ThumbImageURLSelectorProperty, value); + NotifyPropertyChanged(); + } + } + private StringSelector InternalThumbImageURLSelector { get => thumbImage == null ? null : new StringSelector(thumbImage.ResourceUrlSelector); set @@ -550,6 +622,18 @@ namespace Tizen.NUI.Components /// Thrown when setting null value. /// 9 public Selector ThumbImageUrl + { + get + { + return GetValue(ThumbImageUrlProperty) as Selector; + } + set + { + SetValue(ThumbImageUrlProperty, value); + NotifyPropertyChanged(); + } + } + private Selector InternalThumbImageUrl { get { @@ -580,6 +664,18 @@ namespace Tizen.NUI.Components /// /// 8 public Color ThumbColor + { + get + { + return GetValue(ThumbColorProperty) as Color; + } + set + { + SetValue(ThumbColorProperty, value); + NotifyPropertyChanged(); + } + } + private Color InternalThumbColor { get { @@ -600,6 +696,18 @@ namespace Tizen.NUI.Components /// /// 6 public Color BgTrackColor + { + get + { + return GetValue(BgTrackColorProperty) as Color; + } + set + { + SetValue(BgTrackColorProperty, value); + NotifyPropertyChanged(); + } + } + private Color InternalBgTrackColor { get { @@ -619,6 +727,18 @@ namespace Tizen.NUI.Components /// /// 6 public Color SlidedTrackColor + { + get + { + return GetValue(SlidedTrackColorProperty) as Color; + } + set + { + SetValue(SlidedTrackColorProperty, value); + NotifyPropertyChanged(); + } + } + private Color InternalSlidedTrackColor { get { @@ -655,6 +775,18 @@ namespace Tizen.NUI.Components /// This will be public opened later after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public float WarningStartValue + { + get + { + return (float)GetValue(WarningStartValueProperty); + } + set + { + SetValue(WarningStartValueProperty, value); + NotifyPropertyChanged(); + } + } + private float InternalWarningStartValue { get { @@ -673,6 +805,18 @@ namespace Tizen.NUI.Components /// This will be public opened later after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public Color WarningTrackColor + { + get + { + return GetValue(WarningTrackColorProperty) as Color; + } + set + { + SetValue(WarningTrackColorProperty, value); + NotifyPropertyChanged(); + } + } + private Color InternalWarningTrackColor { get { @@ -693,6 +837,18 @@ namespace Tizen.NUI.Components /// This will be public opened later after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public Color WarningSlidedTrackColor + { + get + { + return GetValue(WarningSlidedTrackColorProperty) as Color; + } + set + { + SetValue(WarningSlidedTrackColorProperty, value); + NotifyPropertyChanged(); + } + } + private Color InternalWarningSlidedTrackColor { get { @@ -714,6 +870,18 @@ namespace Tizen.NUI.Components /// This will be public opened later after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public Selector WarningThumbImageUrl + { + get + { + return GetValue(WarningThumbImageUrlProperty) as Selector; + } + set + { + SetValue(WarningThumbImageUrlProperty, value); + NotifyPropertyChanged(); + } + } + private Selector InternalWarningThumbImageUrl { get { @@ -738,6 +906,18 @@ namespace Tizen.NUI.Components /// This will be public opened later after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public Color WarningThumbColor + { + get + { + return GetValue(WarningThumbColorProperty) as Color; + } + set + { + SetValue(WarningThumbColorProperty, value); + NotifyPropertyChanged(); + } + } + private Color InternalWarningThumbColor { get { @@ -754,6 +934,18 @@ namespace Tizen.NUI.Components /// /// 6 public string LowIndicatorImageURL + { + get + { + return GetValue(LowIndicatorImageURLProperty) as string; + } + set + { + SetValue(LowIndicatorImageURLProperty, value); + NotifyPropertyChanged(); + } + } + private string InternalLowIndicatorImageURL { get { @@ -771,6 +963,18 @@ namespace Tizen.NUI.Components /// /// 6 public string HighIndicatorImageURL + { + get + { + return GetValue(HighIndicatorImageURLProperty) as string; + } + set + { + SetValue(HighIndicatorImageURLProperty, value); + NotifyPropertyChanged(); + } + } + private string InternalHighIndicatorImageURL { get { @@ -788,6 +992,18 @@ namespace Tizen.NUI.Components /// /// 6 public string LowIndicatorTextContent + { + get + { + return GetValue(LowIndicatorTextContentProperty) as string; + } + set + { + SetValue(LowIndicatorTextContentProperty, value); + NotifyPropertyChanged(); + } + } + private string InternalLowIndicatorTextContent { get { @@ -807,6 +1023,18 @@ namespace Tizen.NUI.Components /// /// 6 public string HighIndicatorTextContent + { + get + { + return GetValue(HighIndicatorTextContentProperty) as string; + } + set + { + SetValue(HighIndicatorTextContentProperty, value); + NotifyPropertyChanged(); + } + } + private string InternalHighIndicatorTextContent { get { @@ -826,6 +1054,18 @@ namespace Tizen.NUI.Components /// /// 6 public Size LowIndicatorSize + { + get + { + return GetValue(LowIndicatorSizeProperty) as Size; + } + set + { + SetValue(LowIndicatorSizeProperty, value); + NotifyPropertyChanged(); + } + } + private Size InternalLowIndicatorSize { get { @@ -846,6 +1086,18 @@ namespace Tizen.NUI.Components /// /// 6 public Size HighIndicatorSize + { + get + { + return GetValue(HighIndicatorSizeProperty) as Size; + } + set + { + SetValue(HighIndicatorSizeProperty, value); + NotifyPropertyChanged(); + } + } + private Size InternalHighIndicatorSize { get { @@ -913,6 +1165,18 @@ namespace Tizen.NUI.Components /// /// 9 public Size ValueIndicatorSize + { + get + { + return GetValue(ValueIndicatorSizeProperty) as Size; + } + set + { + SetValue(ValueIndicatorSizeProperty, value); + NotifyPropertyChanged(); + } + } + private Size InternalValueIndicatorSize { get { @@ -932,6 +1196,18 @@ namespace Tizen.NUI.Components /// /// 9 public string ValueIndicatorUrl + { + get + { + return GetValue(ValueIndicatorUrlProperty) as string; + } + set + { + SetValue(ValueIndicatorUrlProperty, value); + NotifyPropertyChanged(); + } + } + private string InternalValueIndicatorUrl { get { @@ -952,7 +1228,19 @@ namespace Tizen.NUI.Components /// The default value is false. /// /// 9 - public bool IsDiscrete { get; set; } = false; + public bool IsDiscrete + { + get + { + return (bool)GetValue(IsDiscreteProperty); + } + set + { + SetValue(IsDiscreteProperty, value); + NotifyPropertyChanged(); + } + } + private bool InternalIsDiscrete { get; set; } = false; /// /// Gets or sets the discrete value of slider. @@ -965,6 +1253,18 @@ namespace Tizen.NUI.Components /// /// 9 public float DiscreteValue + { + get + { + return (float)GetValue(DiscreteValueProperty); + } + set + { + SetValue(DiscreteValueProperty, value); + NotifyPropertyChanged(); + } + } + private float InternalDiscreteValue { get { diff --git a/src/Tizen.NUI.Components/Controls/SliderBindableProperty.cs b/src/Tizen.NUI.Components/Controls/SliderBindableProperty.cs new file mode 100755 index 000000000..e0459cb89 --- /dev/null +++ b/src/Tizen.NUI.Components/Controls/SliderBindableProperty.cs @@ -0,0 +1,460 @@ +using System.ComponentModel; +using Tizen.NUI.BaseComponents; +using Tizen.NUI.Binding; + +namespace Tizen.NUI.Components +{ + public partial class Slider + { + /// + /// DirectionProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty DirectionProperty = BindableProperty.Create(nameof(Direction), typeof(DirectionType), typeof(Slider), default(DirectionType), propertyChanged: (bindable, oldValue, newValue) => + { + var instance = (Slider)bindable; + if (newValue != null) + { + instance.InternalDirection = (DirectionType)newValue; + } + }, + defaultValueCreator: (bindable) => + { + var instance = (Slider)bindable; + return instance.InternalDirection; + }); + + /// + /// MinValueProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty MinValueProperty = BindableProperty.Create(nameof(MinValue), typeof(float), typeof(Slider), default(float), propertyChanged: (bindable, oldValue, newValue) => + { + var instance = (Slider)bindable; + if (newValue != null) + { + instance.InternalMinValue = (float)newValue; + } + }, + defaultValueCreator: (bindable) => + { + var instance = (Slider)bindable; + return instance.InternalMinValue; + }); + + /// + /// MaxValueProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty MaxValueProperty = BindableProperty.Create(nameof(MaxValue), typeof(float), typeof(Slider), default(float), propertyChanged: (bindable, oldValue, newValue) => + { + var instance = (Slider)bindable; + if (newValue != null) + { + instance.InternalMaxValue = (float)newValue; + } + }, + defaultValueCreator: (bindable) => + { + var instance = (Slider)bindable; + return instance.InternalMaxValue; + }); + + /// + /// ThumbSizeProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty ThumbSizeProperty = BindableProperty.Create(nameof(ThumbSize), typeof(Size), typeof(Slider), null, propertyChanged: (bindable, oldValue, newValue) => + { + var instance = (Slider)bindable; + if (newValue != null) + { + instance.InternalThumbSize = newValue as Size; + } + }, + defaultValueCreator: (bindable) => + { + var instance = (Slider)bindable; + return instance.InternalThumbSize; + }); + + /// + /// ThumbImageURLProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty ThumbImageURLProperty = BindableProperty.Create(nameof(ThumbImageURL), typeof(string), typeof(Slider), default(string), propertyChanged: (bindable, oldValue, newValue) => + { + var instance = (Slider)bindable; + if (newValue != null) + { + instance.InternalThumbImageURL = newValue as string; + } + }, + defaultValueCreator: (bindable) => + { + var instance = (Slider)bindable; + return instance.InternalThumbImageURL; + }); + + /// + /// ThumbImageURLSelectorProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty ThumbImageURLSelectorProperty = BindableProperty.Create(nameof(ThumbImageURLSelector), typeof(StringSelector), typeof(Slider), null, propertyChanged: (bindable, oldValue, newValue) => + { + var instance = (Slider)bindable; + if (newValue != null) + { + instance.InternalThumbImageURLSelector = newValue as StringSelector; + } + }, + defaultValueCreator: (bindable) => + { + var instance = (Slider)bindable; + return instance.InternalThumbImageURLSelector; + }); + + /// + /// ThumbImageUrlProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty ThumbImageUrlProperty = BindableProperty.Create(nameof(ThumbImageUrl), typeof(Selector), typeof(Slider), null, propertyChanged: (bindable, oldValue, newValue) => + { + var instance = (Slider)bindable; + if (newValue != null) + { + instance.InternalThumbImageUrl = newValue as Tizen.NUI.BaseComponents.Selector; + } + }, + defaultValueCreator: (bindable) => + { + var instance = (Slider)bindable; + return instance.InternalThumbImageUrl; + }); + + /// + /// ThumbColorProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty ThumbColorProperty = BindableProperty.Create(nameof(ThumbColor), typeof(Color), typeof(Slider), null, propertyChanged: (bindable, oldValue, newValue) => + { + var instance = (Slider)bindable; + if (newValue != null) + { + instance.InternalThumbColor = newValue as Color; + } + }, + defaultValueCreator: (bindable) => + { + var instance = (Slider)bindable; + return instance.InternalThumbColor; + }); + + /// + /// BgTrackColorProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty BgTrackColorProperty = BindableProperty.Create(nameof(BgTrackColor), typeof(Color), typeof(Slider), null, propertyChanged: (bindable, oldValue, newValue) => + { + var instance = (Slider)bindable; + if (newValue != null) + { + instance.InternalBgTrackColor = newValue as Color; + } + }, + defaultValueCreator: (bindable) => + { + var instance = (Slider)bindable; + return instance.InternalBgTrackColor; + }); + + /// + /// SlidedTrackColorProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty SlidedTrackColorProperty = BindableProperty.Create(nameof(SlidedTrackColor), typeof(Color), typeof(Slider), null, propertyChanged: (bindable, oldValue, newValue) => + { + var instance = (Slider)bindable; + if (newValue != null) + { + instance.InternalSlidedTrackColor = newValue as Color; + } + }, + defaultValueCreator: (bindable) => + { + var instance = (Slider)bindable; + return instance.InternalSlidedTrackColor; + }); + + /// + /// WarningStartValueProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty WarningStartValueProperty = BindableProperty.Create(nameof(WarningStartValue), typeof(float), typeof(Slider), default(float), propertyChanged: (bindable, oldValue, newValue) => + { + var instance = (Slider)bindable; + if (newValue != null) + { + instance.InternalWarningStartValue = (float)newValue; + } + }, + defaultValueCreator: (bindable) => + { + var instance = (Slider)bindable; + return instance.InternalWarningStartValue; + }); + + /// + /// WarningTrackColorProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty WarningTrackColorProperty = BindableProperty.Create(nameof(WarningTrackColor), typeof(Color), typeof(Slider), null, propertyChanged: (bindable, oldValue, newValue) => + { + var instance = (Slider)bindable; + if (newValue != null) + { + instance.InternalWarningTrackColor = newValue as Color; + } + }, + defaultValueCreator: (bindable) => + { + var instance = (Slider)bindable; + return instance.InternalWarningTrackColor; + }); + + /// + /// WarningSlidedTrackColorProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty WarningSlidedTrackColorProperty = BindableProperty.Create(nameof(WarningSlidedTrackColor), typeof(Color), typeof(Slider), null, propertyChanged: (bindable, oldValue, newValue) => + { + var instance = (Slider)bindable; + if (newValue != null) + { + instance.InternalWarningSlidedTrackColor = newValue as Color; + } + }, + defaultValueCreator: (bindable) => + { + var instance = (Slider)bindable; + return instance.InternalWarningSlidedTrackColor; + }); + + /// + /// WarningThumbImageUrlProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty WarningThumbImageUrlProperty = BindableProperty.Create(nameof(WarningThumbImageUrl), typeof(Tizen.NUI.BaseComponents.Selector), typeof(Slider), null, propertyChanged: (bindable, oldValue, newValue) => + { + var instance = (Slider)bindable; + if (newValue != null) + { + instance.InternalWarningThumbImageUrl = newValue as Tizen.NUI.BaseComponents.Selector; + } + }, + defaultValueCreator: (bindable) => + { + var instance = (Slider)bindable; + return instance.InternalWarningThumbImageUrl; + }); + + /// + /// WarningThumbColorProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty WarningThumbColorProperty = BindableProperty.Create(nameof(WarningThumbColor), typeof(Color), typeof(Slider), null, propertyChanged: (bindable, oldValue, newValue) => + { + var instance = (Slider)bindable; + if (newValue != null) + { + instance.InternalWarningThumbColor = newValue as Color; + } + }, + defaultValueCreator: (bindable) => + { + var instance = (Slider)bindable; + return instance.InternalWarningThumbColor; + }); + + /// + /// LowIndicatorImageURLProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty LowIndicatorImageURLProperty = BindableProperty.Create(nameof(LowIndicatorImageURL), typeof(string), typeof(Slider), default(string), propertyChanged: (bindable, oldValue, newValue) => + { + var instance = (Slider)bindable; + if (newValue != null) + { + instance.InternalLowIndicatorImageURL = newValue as string; + } + }, + defaultValueCreator: (bindable) => + { + var instance = (Slider)bindable; + return instance.InternalLowIndicatorImageURL; + }); + + /// + /// HighIndicatorImageURLProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty HighIndicatorImageURLProperty = BindableProperty.Create(nameof(HighIndicatorImageURL), typeof(string), typeof(Slider), default(string), propertyChanged: (bindable, oldValue, newValue) => + { + var instance = (Slider)bindable; + if (newValue != null) + { + instance.InternalHighIndicatorImageURL = newValue as string; + } + }, + defaultValueCreator: (bindable) => + { + var instance = (Slider)bindable; + return instance.InternalHighIndicatorImageURL; + }); + + /// + /// LowIndicatorTextContentProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty LowIndicatorTextContentProperty = BindableProperty.Create(nameof(LowIndicatorTextContent), typeof(string), typeof(Slider), default(string), propertyChanged: (bindable, oldValue, newValue) => + { + var instance = (Slider)bindable; + if (newValue != null) + { + instance.InternalLowIndicatorTextContent = newValue as string; + } + }, + defaultValueCreator: (bindable) => + { + var instance = (Slider)bindable; + return instance.InternalLowIndicatorTextContent; + }); + + /// + /// HighIndicatorTextContentProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty HighIndicatorTextContentProperty = BindableProperty.Create(nameof(HighIndicatorTextContent), typeof(string), typeof(Slider), default(string), propertyChanged: (bindable, oldValue, newValue) => + { + var instance = (Slider)bindable; + if (newValue != null) + { + instance.InternalHighIndicatorTextContent = newValue as string; + } + }, + defaultValueCreator: (bindable) => + { + var instance = (Slider)bindable; + return instance.InternalHighIndicatorTextContent; + }); + + /// + /// LowIndicatorSizeProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty LowIndicatorSizeProperty = BindableProperty.Create(nameof(LowIndicatorSize), typeof(Size), typeof(Slider), null, propertyChanged: (bindable, oldValue, newValue) => + { + var instance = (Slider)bindable; + if (newValue != null) + { + instance.InternalLowIndicatorSize = newValue as Size; + } + }, + defaultValueCreator: (bindable) => + { + var instance = (Slider)bindable; + return instance.InternalLowIndicatorSize; + }); + + /// + /// HighIndicatorSizeProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty HighIndicatorSizeProperty = BindableProperty.Create(nameof(HighIndicatorSize), typeof(Size), typeof(Slider), null, propertyChanged: (bindable, oldValue, newValue) => + { + var instance = (Slider)bindable; + if (newValue != null) + { + instance.InternalHighIndicatorSize = newValue as Size; + } + }, + defaultValueCreator: (bindable) => + { + var instance = (Slider)bindable; + return instance.InternalHighIndicatorSize; + }); + + /// + /// ValueIndicatorSizeProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty ValueIndicatorSizeProperty = BindableProperty.Create(nameof(ValueIndicatorSize), typeof(Size), typeof(Slider), null, propertyChanged: (bindable, oldValue, newValue) => + { + var instance = (Slider)bindable; + if (newValue != null) + { + instance.InternalValueIndicatorSize = newValue as Size; + } + }, + defaultValueCreator: (bindable) => + { + var instance = (Slider)bindable; + return instance.InternalValueIndicatorSize; + }); + + /// + /// ValueIndicatorUrlProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty ValueIndicatorUrlProperty = BindableProperty.Create(nameof(ValueIndicatorUrl), typeof(string), typeof(Slider), default(string), propertyChanged: (bindable, oldValue, newValue) => + { + var instance = (Slider)bindable; + if (newValue != null) + { + instance.InternalValueIndicatorUrl = newValue as string; + } + }, + defaultValueCreator: (bindable) => + { + var instance = (Slider)bindable; + return instance.InternalValueIndicatorUrl; + }); + + /// + /// IsDiscreteProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty IsDiscreteProperty = BindableProperty.Create(nameof(IsDiscrete), typeof(bool), typeof(Slider), default(bool), propertyChanged: (bindable, oldValue, newValue) => + { + var instance = (Slider)bindable; + if (newValue != null) + { + instance.InternalIsDiscrete = (bool)newValue; + } + }, + defaultValueCreator: (bindable) => + { + var instance = (Slider)bindable; + return instance.InternalIsDiscrete; + }); + + /// + /// DiscreteValueProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty DiscreteValueProperty = BindableProperty.Create(nameof(DiscreteValue), typeof(float), typeof(Slider), default(float), propertyChanged: (bindable, oldValue, newValue) => + { + var instance = (Slider)bindable; + if (newValue != null) + { + instance.InternalDiscreteValue = (float)newValue; + } + }, + defaultValueCreator: (bindable) => + { + var instance = (Slider)bindable; + return instance.InternalDiscreteValue; + }); + + } +} diff --git a/src/Tizen.NUI.Components/Controls/Switch.cs b/src/Tizen.NUI.Components/Controls/Switch.cs old mode 100644 new mode 100755 index 6e2bd8001..7430b1d06 --- a/src/Tizen.NUI.Components/Controls/Switch.cs +++ b/src/Tizen.NUI.Components/Controls/Switch.cs @@ -27,7 +27,7 @@ namespace Tizen.NUI.Components /// The icon part consists of track and thumb. /// /// 6 - public class Switch : Button + public partial class Switch : Button { private ImageView thumb = null; @@ -171,6 +171,18 @@ namespace Tizen.NUI.Components /// /// 6 public StringSelector SwitchBackgroundImageURLSelector + { + get + { + return GetValue(SwitchBackgroundImageURLSelectorProperty) as StringSelector; + } + set + { + SetValue(SwitchBackgroundImageURLSelectorProperty, value); + NotifyPropertyChanged(); + } + } + private StringSelector InternalSwitchBackgroundImageURLSelector { get => new StringSelector(Icon.ResourceUrlSelector); set @@ -185,6 +197,18 @@ namespace Tizen.NUI.Components /// /// 6 public string SwitchHandlerImageURL + { + get + { + return GetValue(SwitchHandlerImageURLProperty) as string; + } + set + { + SetValue(SwitchHandlerImageURLProperty, value); + NotifyPropertyChanged(); + } + } + private string InternalSwitchHandlerImageURL { get { @@ -202,6 +226,18 @@ namespace Tizen.NUI.Components /// /// 6 public StringSelector SwitchHandlerImageURLSelector + { + get + { + return GetValue(SwitchHandlerImageURLSelectorProperty) as StringSelector; + } + set + { + SetValue(SwitchHandlerImageURLSelectorProperty, value); + NotifyPropertyChanged(); + } + } + private StringSelector InternalSwitchHandlerImageURLSelector { get => new StringSelector(thumb.ResourceUrlSelector); set @@ -216,6 +252,18 @@ namespace Tizen.NUI.Components /// /// 6 public Size SwitchHandlerImageSize + { + get + { + return GetValue(SwitchHandlerImageSizeProperty) as Size; + } + set + { + SetValue(SwitchHandlerImageSizeProperty, value); + NotifyPropertyChanged(); + } + } + private Size InternalSwitchHandlerImageSize { get { diff --git a/src/Tizen.NUI.Components/Controls/SwitchBindableProperty.cs b/src/Tizen.NUI.Components/Controls/SwitchBindableProperty.cs new file mode 100755 index 000000000..094e807d0 --- /dev/null +++ b/src/Tizen.NUI.Components/Controls/SwitchBindableProperty.cs @@ -0,0 +1,81 @@ +using System.ComponentModel; +using Tizen.NUI.Binding; + +namespace Tizen.NUI.Components +{ + public partial class Switch + { + /// + /// SwitchBackgroundImageURLSelectorProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty SwitchBackgroundImageURLSelectorProperty = BindableProperty.Create(nameof(SwitchBackgroundImageURLSelector), typeof(StringSelector), typeof(Switch), null, propertyChanged: (bindable, oldValue, newValue) => + { + var instance = (Switch)bindable; + if (newValue != null) + { + instance.InternalSwitchBackgroundImageURLSelector = newValue as StringSelector; + } + }, + defaultValueCreator: (bindable) => + { + var instance = (Switch)bindable; + return instance.InternalSwitchBackgroundImageURLSelector; + }); + + /// + /// SwitchHandlerImageURLProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty SwitchHandlerImageURLProperty = BindableProperty.Create(nameof(SwitchHandlerImageURL), typeof(string), typeof(Switch), default(string), propertyChanged: (bindable, oldValue, newValue) => + { + var instance = (Switch)bindable; + if (newValue != null) + { + instance.InternalSwitchHandlerImageURL = newValue as string; + } + }, + defaultValueCreator: (bindable) => + { + var instance = (Switch)bindable; + return instance.InternalSwitchHandlerImageURL; + }); + + /// + /// SwitchHandlerImageURLSelectorProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty SwitchHandlerImageURLSelectorProperty = BindableProperty.Create(nameof(SwitchHandlerImageURLSelector), typeof(StringSelector), typeof(Switch), null, propertyChanged: (bindable, oldValue, newValue) => + { + var instance = (Switch)bindable; + if (newValue != null) + { + instance.InternalSwitchHandlerImageURLSelector = newValue as StringSelector; + } + }, + defaultValueCreator: (bindable) => + { + var instance = (Switch)bindable; + return instance.InternalSwitchHandlerImageURLSelector; + }); + + /// + /// SwitchHandlerImageSizeProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty SwitchHandlerImageSizeProperty = BindableProperty.Create(nameof(SwitchHandlerImageSize), typeof(Size), typeof(Switch), null, propertyChanged: (bindable, oldValue, newValue) => + { + var instance = (Switch)bindable; + if (newValue != null) + { + instance.InternalSwitchHandlerImageSize = newValue as Size; + } + }, + defaultValueCreator: (bindable) => + { + var instance = (Switch)bindable; + return instance.InternalSwitchHandlerImageSize; + }); + + } +} diff --git a/src/Tizen.NUI.Components/Controls/Tab.cs b/src/Tizen.NUI.Components/Controls/Tab.cs index aa596efc5..42ea67655 100755 --- a/src/Tizen.NUI.Components/Controls/Tab.cs +++ b/src/Tizen.NUI.Components/Controls/Tab.cs @@ -27,7 +27,7 @@ namespace Tizen.NUI.Components /// /// 6 [Obsolete("Deprecated in API8; Will be removed in API10")] - public class Tab : Control + public partial class Tab : Control { private const int aniTime = 100; // will be defined in const file later private List itemList = new List(); @@ -118,6 +118,18 @@ namespace Tizen.NUI.Components /// 6 [Obsolete("Deprecated in API8; Will be removed in API10")] public int SelectedItemIndex + { + get + { + return (int)GetValue(SelectedItemIndexProperty); + } + set + { + SetValue(SelectedItemIndexProperty, value); + NotifyPropertyChanged(); + } + } + private int InternalSelectedItemIndex { get { @@ -139,6 +151,18 @@ namespace Tizen.NUI.Components /// 6 [Obsolete("Deprecated in API8; Will be removed in API10")] public bool UseTextNaturalSize + { + get + { + return (bool)GetValue(UseTextNaturalSizeProperty); + } + set + { + SetValue(UseTextNaturalSizeProperty, value); + NotifyPropertyChanged(); + } + } + private bool InternalUseTextNaturalSize { get { @@ -160,6 +184,18 @@ namespace Tizen.NUI.Components /// 6 [Obsolete("Deprecated in API8; Will be removed in API10")] public int ItemSpace + { + get + { + return (int)GetValue(ItemSpaceProperty); + } + set + { + SetValue(ItemSpaceProperty, value); + NotifyPropertyChanged(); + } + } + private int InternalItemSpace { get { @@ -181,6 +217,18 @@ namespace Tizen.NUI.Components /// 6 [Obsolete("Deprecated in API8; Will be removed in API10")] public Extents Space + { + get + { + return GetValue(SpaceProperty) as Extents; + } + set + { + SetValue(SpaceProperty, value); + NotifyPropertyChanged(); + } + } + private Extents InternalSpace { get { @@ -199,6 +247,18 @@ namespace Tizen.NUI.Components /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public Extents ItemPadding + { + get + { + return GetValue(ItemPaddingProperty) as Extents; + } + set + { + SetValue(ItemPaddingProperty, value); + NotifyPropertyChanged(); + } + } + private Extents InternalItemPadding { get { @@ -237,6 +297,18 @@ namespace Tizen.NUI.Components /// 6 [Obsolete("Deprecated in API8; Will be removed in API10")] public Size UnderLineSize + { + get + { + return GetValue(UnderLineSizeProperty) as Size; + } + set + { + SetValue(UnderLineSizeProperty, value); + NotifyPropertyChanged(); + } + } + private Size InternalUnderLineSize { get { @@ -258,6 +330,18 @@ namespace Tizen.NUI.Components /// 6 [Obsolete("Deprecated in API8; Will be removed in API10")] public Color UnderLineBackgroundColor + { + get + { + return GetValue(UnderLineBackgroundColorProperty) as Color; + } + set + { + SetValue(UnderLineBackgroundColorProperty, value); + NotifyPropertyChanged(); + } + } + private Color InternalUnderLineBackgroundColor { get { @@ -279,6 +363,18 @@ namespace Tizen.NUI.Components /// 6 [Obsolete("Deprecated in API8; Will be removed in API10")] public float PointSize + { + get + { + return (float)GetValue(PointSizeProperty); + } + set + { + SetValue(PointSizeProperty, value); + NotifyPropertyChanged(); + } + } + private float InternalPointSize { get { @@ -300,6 +396,18 @@ namespace Tizen.NUI.Components /// 6 [Obsolete("Deprecated in API8; Will be removed in API10")] public string FontFamily + { + get + { + return GetValue(FontFamilyProperty) as string; + } + set + { + SetValue(FontFamilyProperty, value); + NotifyPropertyChanged(); + } + } + private string InternalFontFamily { get { @@ -321,6 +429,18 @@ namespace Tizen.NUI.Components /// 6 [Obsolete("Deprecated in API8; Will be removed in API10")] public Color TextColor + { + get + { + return GetValue(TextColorProperty) as Color; + } + set + { + SetValue(TextColorProperty, value); + NotifyPropertyChanged(); + } + } + private Color InternalTextColor { get { @@ -343,6 +463,18 @@ namespace Tizen.NUI.Components /// 6 [Obsolete("Deprecated in API8; Will be removed in API10")] public ColorSelector TextColorSelector + { + get + { + return GetValue(TextColorSelectorProperty) as ColorSelector; + } + set + { + SetValue(TextColorSelectorProperty, value); + NotifyPropertyChanged(); + } + } + private ColorSelector InternalTextColorSelector { get { diff --git a/src/Tizen.NUI.Components/Controls/TabBindableProperty.cs b/src/Tizen.NUI.Components/Controls/TabBindableProperty.cs new file mode 100755 index 000000000..89af4388e --- /dev/null +++ b/src/Tizen.NUI.Components/Controls/TabBindableProperty.cs @@ -0,0 +1,207 @@ +using System.ComponentModel; +using Tizen.NUI.Binding; + +namespace Tizen.NUI.Components +{ + public partial class Tab + { + /// + /// SelectedItemIndexProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty SelectedItemIndexProperty = BindableProperty.Create(nameof(SelectedItemIndex), typeof(int), typeof(Tab), default(int), propertyChanged: (bindable, oldValue, newValue) => + { + var instance = (Tab)bindable; + if (newValue != null) + { + instance.InternalSelectedItemIndex = (int)newValue; + } + }, + defaultValueCreator: (bindable) => + { + var instance = (Tab)bindable; + return instance.InternalSelectedItemIndex; + }); + + /// + /// UseTextNaturalSizeProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty UseTextNaturalSizeProperty = BindableProperty.Create(nameof(UseTextNaturalSize), typeof(bool), typeof(Tab), default(bool), propertyChanged: (bindable, oldValue, newValue) => + { + var instance = (Tab)bindable; + if (newValue != null) + { + instance.InternalUseTextNaturalSize = (bool)newValue; + } + }, + defaultValueCreator: (bindable) => + { + var instance = (Tab)bindable; + return instance.InternalUseTextNaturalSize; + }); + + /// + /// ItemSpaceProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty ItemSpaceProperty = BindableProperty.Create(nameof(ItemSpace), typeof(int), typeof(Tab), default(int), propertyChanged: (bindable, oldValue, newValue) => + { + var instance = (Tab)bindable; + if (newValue != null) + { + instance.InternalItemSpace = (int)newValue; + } + }, + defaultValueCreator: (bindable) => + { + var instance = (Tab)bindable; + return instance.InternalItemSpace; + }); + + /// + /// SpaceProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty SpaceProperty = BindableProperty.Create(nameof(Space), typeof(Extents), typeof(Tab), null, propertyChanged: (bindable, oldValue, newValue) => + { + var instance = (Tab)bindable; + if (newValue != null) + { + instance.InternalSpace = newValue as Extents; + } + }, + defaultValueCreator: (bindable) => + { + var instance = (Tab)bindable; + return instance.InternalSpace; + }); + + /// + /// ItemPaddingProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty ItemPaddingProperty = BindableProperty.Create(nameof(ItemPadding), typeof(Extents), typeof(Tab), null, propertyChanged: (bindable, oldValue, newValue) => + { + var instance = (Tab)bindable; + if (newValue != null) + { + instance.InternalItemPadding = newValue as Extents; + } + }, + defaultValueCreator: (bindable) => + { + var instance = (Tab)bindable; + return instance.InternalItemPadding; + }); + + /// + /// UnderLineSizeProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty UnderLineSizeProperty = BindableProperty.Create(nameof(UnderLineSize), typeof(Size), typeof(Tab), null, propertyChanged: (bindable, oldValue, newValue) => + { + var instance = (Tab)bindable; + if (newValue != null) + { + instance.InternalUnderLineSize = newValue as Size; + } + }, + defaultValueCreator: (bindable) => + { + var instance = (Tab)bindable; + return instance.InternalUnderLineSize; + }); + + /// + /// UnderLineBackgroundColorProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty UnderLineBackgroundColorProperty = BindableProperty.Create(nameof(UnderLineBackgroundColor), typeof(Color), typeof(Tab), null, propertyChanged: (bindable, oldValue, newValue) => + { + var instance = (Tab)bindable; + if (newValue != null) + { + instance.InternalUnderLineBackgroundColor = newValue as Color; + } + }, + defaultValueCreator: (bindable) => + { + var instance = (Tab)bindable; + return instance.InternalUnderLineBackgroundColor; + }); + + /// + /// PointSizeProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty PointSizeProperty = BindableProperty.Create(nameof(PointSize), typeof(float), typeof(Tab), default(float), propertyChanged: (bindable, oldValue, newValue) => + { + var instance = (Tab)bindable; + if (newValue != null) + { + instance.InternalPointSize = (float)newValue; + } + }, + defaultValueCreator: (bindable) => + { + var instance = (Tab)bindable; + return instance.InternalPointSize; + }); + + /// + /// FontFamilyProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty FontFamilyProperty = BindableProperty.Create(nameof(FontFamily), typeof(string), typeof(Tab), default(string), propertyChanged: (bindable, oldValue, newValue) => + { + var instance = (Tab)bindable; + if (newValue != null) + { + instance.InternalFontFamily = newValue as string; + } + }, + defaultValueCreator: (bindable) => + { + var instance = (Tab)bindable; + return instance.InternalFontFamily; + }); + + /// + /// TextColorProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty TextColorProperty = BindableProperty.Create(nameof(TextColor), typeof(Color), typeof(Tab), null, propertyChanged: (bindable, oldValue, newValue) => + { + var instance = (Tab)bindable; + if (newValue != null) + { + instance.InternalTextColor = newValue as Color; + } + }, + defaultValueCreator: (bindable) => + { + var instance = (Tab)bindable; + return instance.InternalTextColor; + }); + + /// + /// TextColorSelectorProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty TextColorSelectorProperty = BindableProperty.Create(nameof(TextColorSelector), typeof(ColorSelector), typeof(Tab), null, propertyChanged: (bindable, oldValue, newValue) => + { + var instance = (Tab)bindable; + if (newValue != null) + { + instance.InternalTextColorSelector = newValue as ColorSelector; + } + }, + defaultValueCreator: (bindable) => + { + var instance = (Tab)bindable; + return instance.InternalTextColorSelector; + }); + + } +} diff --git a/src/Tizen.NUI.Components/Controls/TimePicker.cs b/src/Tizen.NUI.Components/Controls/TimePicker.cs index 6d4736337..b6b65bdb6 100755 --- a/src/Tizen.NUI.Components/Controls/TimePicker.cs +++ b/src/Tizen.NUI.Components/Controls/TimePicker.cs @@ -20,6 +20,7 @@ using System.Collections.ObjectModel; using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Globalization; +using Tizen.NUI.Binding; namespace Tizen.NUI.Components { @@ -55,6 +56,42 @@ namespace Tizen.NUI.Components /// 9 public class TimePicker : Control { + /// + /// TimeProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty TimeProperty = BindableProperty.Create(nameof(Time), typeof(DateTime), typeof(TimePicker), default(DateTime), propertyChanged: (bindable, oldValue, newValue) => + { + var instance = (TimePicker)bindable; + if (newValue != null) + { + instance.InternalTime = (DateTime)newValue; + } + }, + defaultValueCreator: (bindable) => + { + var instance = (TimePicker)bindable; + return instance.InternalTime; + }); + + /// + /// Is24HourViewProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty Is24HourViewProperty = BindableProperty.Create(nameof(Is24HourView), typeof(bool), typeof(TimePicker), default(bool), propertyChanged: (bindable, oldValue, newValue) => + { + var instance = (TimePicker)bindable; + if (newValue != null) + { + instance.InternalIs24HourView = (bool)newValue; + } + }, + defaultValueCreator: (bindable) => + { + var instance = (TimePicker)bindable; + return instance.InternalIs24HourView; + }); + private bool isAm; private bool is24HourView; private DateTime currentTime; @@ -128,6 +165,18 @@ namespace Tizen.NUI.Components /// /// 9 public DateTime Time + { + get + { + return (DateTime)GetValue(TimeProperty); + } + set + { + SetValue(TimeProperty, value); + NotifyPropertyChanged(); + } + } + private DateTime InternalTime { get { @@ -163,6 +212,18 @@ namespace Tizen.NUI.Components /// /// 9 public bool Is24HourView + { + get + { + return (bool)GetValue(Is24HourViewProperty); + } + set + { + SetValue(Is24HourViewProperty, value); + NotifyPropertyChanged(); + } + } + private bool InternalIs24HourView { get { diff --git a/src/Tizen.NUI.Components/Controls/Toast.cs b/src/Tizen.NUI.Components/Controls/Toast.cs index 061f135b0..d9fb74c8d 100755 --- a/src/Tizen.NUI.Components/Controls/Toast.cs +++ b/src/Tizen.NUI.Components/Controls/Toast.cs @@ -29,7 +29,7 @@ namespace Tizen.NUI.Components /// /// 6 [Obsolete("Deprecated in API8; Will be removed in API10")] - public class Toast : Control + public partial class Toast : Control { /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] @@ -126,6 +126,18 @@ namespace Tizen.NUI.Components [SuppressMessage("Microsoft.Performance", "CA1819: Properties should not return arrays")] [Obsolete("Deprecated in API8; Will be removed in API10")] public string[] TextArray + { + get + { + return GetValue(TextArrayProperty) as string[]; + } + set + { + SetValue(TextArrayProperty, value); + NotifyPropertyChanged(); + } + } + private string[] InternalTextArray { get; set; @@ -137,6 +149,18 @@ namespace Tizen.NUI.Components /// 6 [Obsolete("Deprecated in API8; Will be removed in API10")] public float PointSize + { + get + { + return (float)GetValue(PointSizeProperty); + } + set + { + SetValue(PointSizeProperty, value); + NotifyPropertyChanged(); + } + } + private float InternalPointSize { get { @@ -157,6 +181,18 @@ namespace Tizen.NUI.Components /// 6 [Obsolete("Deprecated in API8; Will be removed in API10")] public string FontFamily + { + get + { + return GetValue(FontFamilyProperty) as string; + } + set + { + SetValue(FontFamilyProperty, value); + NotifyPropertyChanged(); + } + } + private string InternalFontFamily { get { @@ -177,6 +213,18 @@ namespace Tizen.NUI.Components /// 6 [Obsolete("Deprecated in API8; Will be removed in API10")] public Color TextColor + { + get + { + return GetValue(TextColorProperty) as Color; + } + set + { + SetValue(TextColorProperty, value); + NotifyPropertyChanged(); + } + } + private Color InternalTextColor { get { @@ -197,6 +245,18 @@ namespace Tizen.NUI.Components /// 6 [Obsolete("Deprecated in API8; Will be removed in API10")] public HorizontalAlignment TextAlignment + { + get + { + return (HorizontalAlignment)GetValue(TextAlignmentProperty); + } + set + { + SetValue(TextAlignmentProperty, value); + NotifyPropertyChanged(); + } + } + private HorizontalAlignment InternalTextAlignment { get { @@ -246,6 +306,18 @@ namespace Tizen.NUI.Components /// 6 [Obsolete("Deprecated in API8; Will be removed in API10")] public Extents TextPadding + { + get + { + return GetValue(TextPaddingProperty) as Extents; + } + set + { + SetValue(TextPaddingProperty, value); + NotifyPropertyChanged(); + } + } + private Extents InternalTextPadding { get { @@ -265,14 +337,38 @@ namespace Tizen.NUI.Components /// /// 6 [Obsolete("Deprecated in API8; Will be removed in API10")] - public uint TextLineHeight { get; set; } + public uint TextLineHeight + { + get + { + return (UInt32)GetValue(TextLineHeightProperty); + } + set + { + SetValue(TextLineHeightProperty, value); + NotifyPropertyChanged(); + } + } + private uint InternalTextLineHeight { get; set; } /// /// Gets or sets text line space in toast. /// /// 6 [Obsolete("Deprecated in API8; Will be removed in API10")] - public uint TextLineSpace { get; set; } + public uint TextLineSpace + { + get + { + return (uint)GetValue(TextLineSpaceProperty); + } + set + { + SetValue(TextLineSpaceProperty, value); + NotifyPropertyChanged(); + } + } + private uint InternalTextLineSpace { get; set; } /// /// Gets or sets duration of toast. diff --git a/src/Tizen.NUI.Components/Controls/ToastBindableProperty.cs b/src/Tizen.NUI.Components/Controls/ToastBindableProperty.cs new file mode 100755 index 000000000..7eb0e80ad --- /dev/null +++ b/src/Tizen.NUI.Components/Controls/ToastBindableProperty.cs @@ -0,0 +1,153 @@ +using System.ComponentModel; +using Tizen.NUI.Binding; + +namespace Tizen.NUI.Components +{ + public partial class Toast + { + /// + /// TextArrayProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty TextArrayProperty = BindableProperty.Create(nameof(TextArray), typeof(string[]), typeof(Toast), null, propertyChanged: (bindable, oldValue, newValue) => + { + var instance = (Toast)bindable; + if (newValue != null) + { + instance.InternalTextArray = newValue as string[]; + } + }, + defaultValueCreator: (bindable) => + { + var instance = (Toast)bindable; + return instance.InternalTextArray; + }); + + /// + /// PointSizeProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty PointSizeProperty = BindableProperty.Create(nameof(PointSize), typeof(float), typeof(Toast), default(float), propertyChanged: (bindable, oldValue, newValue) => + { + var instance = (Toast)bindable; + if (newValue != null) + { + instance.InternalPointSize = (float)newValue; + } + }, + defaultValueCreator: (bindable) => + { + var instance = (Toast)bindable; + return instance.InternalPointSize; + }); + + /// + /// FontFamilyProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty FontFamilyProperty = BindableProperty.Create(nameof(FontFamily), typeof(string), typeof(Toast), default(string), propertyChanged: (bindable, oldValue, newValue) => + { + var instance = (Toast)bindable; + if (newValue != null) + { + instance.InternalFontFamily = newValue as string; + } + }, + defaultValueCreator: (bindable) => + { + var instance = (Toast)bindable; + return instance.InternalFontFamily; + }); + + /// + /// TextColorProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty TextColorProperty = BindableProperty.Create(nameof(TextColor), typeof(Color), typeof(Toast), null, propertyChanged: (bindable, oldValue, newValue) => + { + var instance = (Toast)bindable; + if (newValue != null) + { + instance.InternalTextColor = newValue as Color; + } + }, + defaultValueCreator: (bindable) => + { + var instance = (Toast)bindable; + return instance.InternalTextColor; + }); + + /// + /// TextAlignmentProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty TextAlignmentProperty = BindableProperty.Create(nameof(TextAlignment), typeof(HorizontalAlignment), typeof(Toast), default(HorizontalAlignment), propertyChanged: (bindable, oldValue, newValue) => + { + var instance = (Toast)bindable; + if (newValue != null) + { + instance.InternalTextAlignment = (HorizontalAlignment)newValue; + } + }, + defaultValueCreator: (bindable) => + { + var instance = (Toast)bindable; + return instance.InternalTextAlignment; + }); + + /// + /// TextPaddingProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty TextPaddingProperty = BindableProperty.Create(nameof(TextPadding), typeof(Extents), typeof(Toast), null, propertyChanged: (bindable, oldValue, newValue) => + { + var instance = (Toast)bindable; + if (newValue != null) + { + instance.InternalTextPadding = newValue as Extents; + } + }, + defaultValueCreator: (bindable) => + { + var instance = (Toast)bindable; + return instance.InternalTextPadding; + }); + + /// + /// TextLineHeightProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty TextLineHeightProperty = BindableProperty.Create(nameof(TextLineHeight), typeof(uint), typeof(Toast), default(uint), propertyChanged: (bindable, oldValue, newValue) => + { + var instance = (Toast)bindable; + if (newValue != null) + { + instance.InternalTextLineHeight = (uint)newValue; + } + }, + defaultValueCreator: (bindable) => + { + var instance = (Toast)bindable; + return instance.InternalTextLineHeight; + }); + + /// + /// TextLineSpaceProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty TextLineSpaceProperty = BindableProperty.Create(nameof(TextLineSpace), typeof(uint), typeof(Toast), default(uint), propertyChanged: (bindable, oldValue, newValue) => + { + var instance = (Toast)bindable; + if (newValue != null) + { + instance.InternalTextLineSpace = (uint)newValue; + } + }, + defaultValueCreator: (bindable) => + { + var instance = (Toast)bindable; + return instance.InternalTextLineSpace; + }); + + } +} -- 2.34.1