diff --git a/src/Tizen.NUI.Components/Style/ButtonStyle.cs b/src/Tizen.NUI.Components/Style/ButtonStyle.cs index ec59328c669..891c1683932 100755 --- a/src/Tizen.NUI.Components/Style/ButtonStyle.cs +++ b/src/Tizen.NUI.Components/Style/ButtonStyle.cs @@ -27,184 +27,17 @@ namespace Tizen.NUI.Components /// 8 public class ButtonStyle : ControlStyle { - /// 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 static readonly BindableProperty IsSelectableProperty = null; - internal static void SetInternalIsSelectableProperty(BindableObject bindable, object oldValue, object newValue) - { - var buttonStyle = (ButtonStyle)bindable; - buttonStyle.isSelectable = (bool?)newValue; - } - internal static object GetInternalIsSelectableProperty(BindableObject bindable) - { - var buttonStyle = (ButtonStyle)bindable; - return buttonStyle.isSelectable; - } - - /// 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 static readonly BindableProperty IsSelectedProperty = null; - internal static void SetInternalIsSelectedProperty(BindableObject bindable, object oldValue, object newValue) - { - var buttonStyle = (ButtonStyle)bindable; - buttonStyle.isSelected = (bool?)newValue; - } - internal static object GetInternalIsSelectedProperty(BindableObject bindable) - { - var buttonStyle = (ButtonStyle)bindable; - return buttonStyle.isSelected; - } - - /// 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 static readonly BindableProperty IconRelativeOrientationProperty = null; - internal static void SetInternalIconRelativeOrientationProperty(BindableObject bindable, object oldValue, object newValue) - { - var buttonStyle = (ButtonStyle)bindable; - buttonStyle.iconRelativeOrientation = (Button.IconOrientation?)newValue; - } - internal static object GetInternalIconRelativeOrientationProperty(BindableObject bindable) - { - var buttonStyle = (ButtonStyle)bindable; - return buttonStyle.iconRelativeOrientation; - } - - /// 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 static readonly BindableProperty IconPaddingProperty = null; - internal static void SetInternalIconPaddingProperty(BindableObject bindable, object oldValue, object newValue) - { - ((ButtonStyle)bindable).iconPadding = null == newValue ? null : new Extents((Extents)newValue); - } - internal static object GetInternalIconPaddingProperty(BindableObject bindable) - { - var buttonStyle = (ButtonStyle)bindable; - return buttonStyle.iconPadding; - } - - /// 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 static readonly BindableProperty TextPaddingProperty = null; - internal static void SetInternalTextPaddingProperty(BindableObject bindable, object oldValue, object newValue) - { - ((ButtonStyle)bindable).textPadding = null == newValue ? null : new Extents((Extents)newValue); - } - internal static object GetInternalTextPaddingProperty(BindableObject bindable) - { - var buttonStyle = (ButtonStyle)bindable; - return buttonStyle.textPadding; - } + static readonly IStyleProperty IsSelectableProperty = new StyleProperty((v, o) => v.IsSelectable = o); + static readonly IStyleProperty IsSelectedProperty = new StyleProperty((v, o) => v.IsSelected = o); + static readonly IStyleProperty IconRelativeOrientationProperty = new StyleProperty((v, o) => v.IconRelativeOrientation = o); + static readonly IStyleProperty IconPaddingProperty = new StyleProperty((v, o) => v.IconPadding = o); + static readonly IStyleProperty TextPaddingProperty = new StyleProperty((v, o) => v.TextPadding = o); + static readonly IStyleProperty ItemAlignmentProperty = new StyleProperty((v, o) => v.ItemAlignment = o); + static readonly IStyleProperty ItemHorizontalAlignmentProperty = new StyleProperty((v, o) => v.ItemHorizontalAlignment = o); + static readonly IStyleProperty ItemVerticalAlignmentProperty = new StyleProperty((v, o) => v.ItemVerticalAlignment = o); + static readonly IStyleProperty ItemSpacingProperty = new StyleProperty((v, o) => v.ItemSpacing = o); - /// The bindable property of ItemAlignment. - [EditorBrowsable(EditorBrowsableState.Never)] - internal static readonly BindableProperty ItemAlignmentProperty = null; - internal static void SetInternalItemAlignmentProperty(BindableObject bindable, object oldValue, object newValue) - { - ((ButtonStyle)bindable).itemAlignment = (LinearLayout.Alignment?)newValue; - - switch (newValue) - { - case LinearLayout.Alignment.Begin: - ((ButtonStyle)bindable).itemHorizontalAlignment = HorizontalAlignment.Begin; - break; - case LinearLayout.Alignment.End: - ((ButtonStyle)bindable).itemHorizontalAlignment = HorizontalAlignment.End; - break; - case LinearLayout.Alignment.CenterHorizontal: - ((ButtonStyle)bindable).itemHorizontalAlignment = HorizontalAlignment.Center; - break; - case LinearLayout.Alignment.Top: - ((ButtonStyle)bindable).itemVerticalAlignment = VerticalAlignment.Top; - break; - case LinearLayout.Alignment.Bottom: - ((ButtonStyle)bindable).itemVerticalAlignment = VerticalAlignment.Bottom; - break; - case LinearLayout.Alignment.CenterVertical: - ((ButtonStyle)bindable).itemVerticalAlignment = VerticalAlignment.Center; - break; - case LinearLayout.Alignment.Center: - ((ButtonStyle)bindable).itemHorizontalAlignment = HorizontalAlignment.Center; - ((ButtonStyle)bindable).itemVerticalAlignment = VerticalAlignment.Center; - break; - default: - break; - } - } - internal static object GetInternalItemAlignmentProperty(BindableObject bindable) - { - return ((ButtonStyle)bindable).itemAlignment; - } - - /// The bindable property of ItemHorizontalAlignment. - [EditorBrowsable(EditorBrowsableState.Never)] - internal static readonly BindableProperty ItemHorizontalAlignmentProperty = null; - internal static void SetInternalItemHorizontalAlignmentProperty(BindableObject bindable, object oldValue, object newValue) - { - ((ButtonStyle)bindable).itemHorizontalAlignment = (HorizontalAlignment?)newValue; - } - internal static object GetInternalItemHorizontalAlignmentProperty(BindableObject bindable) - { - return ((ButtonStyle)bindable).itemHorizontalAlignment; - } - - /// The bindable property of ItemVerticalAlignment. - [EditorBrowsable(EditorBrowsableState.Never)] - internal static readonly BindableProperty ItemVerticalAlignmentProperty = null; - internal static void SetInternalItemVerticalAlignmentProperty(BindableObject bindable, object oldValue, object newValue) - { - ((ButtonStyle)bindable).itemVerticalAlignment = (VerticalAlignment?)newValue; - } - internal static object GetInternalItemVerticalAlignmentProperty(BindableObject bindable) - { - return ((ButtonStyle)bindable).itemVerticalAlignment; - } - - /// The bindable property of ItemSpacing. - [EditorBrowsable(EditorBrowsableState.Never)] - internal static readonly BindableProperty ItemSpacingProperty = null; - internal static void SetInternalItemSpacingProperty(BindableObject bindable, object oldValue, object newValue) - { - ((ButtonStyle)bindable).itemSpacing = (Size2D)newValue; - } - internal static object GetInternalItemSpacingProperty(BindableObject bindable) - { - return ((ButtonStyle)bindable).itemSpacing; - } - - private bool? isSelectable; - private bool? isSelected; - private Button.IconOrientation? iconRelativeOrientation; - private Extents iconPadding; - private Extents textPadding; - private Size2D itemSpacing; - private LinearLayout.Alignment? itemAlignment; - private HorizontalAlignment? itemHorizontalAlignment; - private VerticalAlignment? itemVerticalAlignment; - - static ButtonStyle() - { - if (NUIApplication.IsUsingXaml) - { - IsSelectableProperty = BindableProperty.Create(nameof(IsSelectable), typeof(bool?), typeof(ButtonStyle), null, - propertyChanged: SetInternalIsSelectableProperty, defaultValueCreator: GetInternalIsSelectableProperty); - IsSelectedProperty = BindableProperty.Create(nameof(IsSelected), typeof(bool?), typeof(ButtonStyle), null, - propertyChanged: SetInternalIsSelectedProperty, defaultValueCreator: GetInternalIsSelectedProperty); - IconRelativeOrientationProperty = BindableProperty.Create(nameof(IconRelativeOrientation), typeof(Button.IconOrientation?), typeof(ButtonStyle), null, - propertyChanged: SetInternalIconRelativeOrientationProperty, defaultValueCreator: GetInternalIconRelativeOrientationProperty); - IconPaddingProperty = BindableProperty.Create(nameof(IconPadding), typeof(Extents), typeof(ButtonStyle), null, - propertyChanged: SetInternalIconPaddingProperty, defaultValueCreator: GetInternalIconPaddingProperty); - TextPaddingProperty = BindableProperty.Create(nameof(TextPadding), typeof(Extents), typeof(ButtonStyle), null, - propertyChanged: SetInternalTextPaddingProperty, defaultValueCreator: GetInternalTextPaddingProperty); - ItemAlignmentProperty = BindableProperty.Create(nameof(ItemAlignment), typeof(LinearLayout.Alignment?), typeof(ButtonStyle), null, - propertyChanged: SetInternalItemAlignmentProperty, defaultValueCreator: GetInternalItemAlignmentProperty); - ItemHorizontalAlignmentProperty = BindableProperty.Create(nameof(ItemHorizontalAlignment), typeof(HorizontalAlignment?), typeof(ButtonStyle), null, - propertyChanged: SetInternalItemHorizontalAlignmentProperty, defaultValueCreator: GetInternalItemHorizontalAlignmentProperty); - ItemVerticalAlignmentProperty = BindableProperty.Create(nameof(ItemVerticalAlignment), typeof(VerticalAlignment?), typeof(ButtonStyle), null, - propertyChanged: SetInternalItemVerticalAlignmentProperty, defaultValueCreator: GetInternalItemVerticalAlignmentProperty); - ItemSpacingProperty = BindableProperty.Create(nameof(ItemSpacing), typeof(Size2D), typeof(ButtonStyle), null, - propertyChanged: SetInternalItemSpacingProperty, defaultValueCreator: GetInternalItemSpacingProperty); - } - } + static ButtonStyle() { } /// /// Creates a new instance of a ButtonStyle. @@ -247,28 +80,8 @@ public ButtonStyle(ButtonStyle style) : base(style) /// 8 public bool? IsSelectable { - get - { - if (NUIApplication.IsUsingXaml) - { - return (bool?)GetValue(IsSelectableProperty); - } - else - { - return (bool)GetInternalIsSelectableProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(IsSelectableProperty, value); - } - else - { - SetInternalIsSelectableProperty(this, null, value); - } - } + get => (bool?)GetValue(IsSelectableProperty); + set => SetValue(IsSelectableProperty, value); } /// @@ -277,28 +90,8 @@ public bool? IsSelectable /// 8 public bool? IsSelected { - get - { - if (NUIApplication.IsUsingXaml) - { - return (bool?)GetValue(IsSelectedProperty); - } - else - { - return (bool?)GetInternalIsSelectedProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(IsSelectedProperty, value); - } - else - { - SetInternalIsSelectedProperty(this, null, value); - } - } + get => (bool?)GetValue(IsSelectedProperty); + set => SetValue(IsSelectedProperty, value); } /// @@ -320,28 +113,8 @@ public bool? IsSelected /// 8 public Button.IconOrientation? IconRelativeOrientation { - get - { - if (NUIApplication.IsUsingXaml) - { - return (Button.IconOrientation?)GetValue(IconRelativeOrientationProperty); - } - else - { - return (Button.IconOrientation?)GetInternalIconRelativeOrientationProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(IconRelativeOrientationProperty, value); - } - else - { - SetInternalIconRelativeOrientationProperty(this, null, value); - } - } + get => (Button.IconOrientation?)GetValue(IconRelativeOrientationProperty); + set => SetValue(IconRelativeOrientationProperty, value); } /// @@ -352,28 +125,8 @@ public Extents IconPadding { // TODO Fixme // When there are icon and text, the linear layout does not count padding. - get - { - if (NUIApplication.IsUsingXaml) - { - return ((Extents)GetValue(IconPaddingProperty)) ?? (iconPadding = new Extents()); - } - else - { - return (Extents)GetInternalIconPaddingProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(IconPaddingProperty, value); - } - else - { - SetInternalIconPaddingProperty(this, null, value); - } - } + get => GetOrCreateValue(IconPaddingProperty); + set => SetValue(IconPaddingProperty, value); } /// @@ -382,28 +135,8 @@ public Extents IconPadding /// 8 public Extents TextPadding { - get - { - if (NUIApplication.IsUsingXaml) - { - return ((Extents)GetValue(TextPaddingProperty)) ?? (textPadding = new Extents()); - } - else - { - return ((Extents)GetInternalTextPaddingProperty(this)) ?? (textPadding = new Extents()); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(TextPaddingProperty, value); - } - else - { - SetInternalTextPaddingProperty(this, null, value); - } - } + get => GetOrCreateValue(TextPaddingProperty); + set => SetValue(TextPaddingProperty, value); } /// @@ -412,28 +145,8 @@ public Extents TextPadding [EditorBrowsable(EditorBrowsableState.Never)] public LinearLayout.Alignment? ItemAlignment { - get - { - if (NUIApplication.IsUsingXaml) - { - return (LinearLayout.Alignment?)GetValue(ItemAlignmentProperty); - } - else - { - return (LinearLayout.Alignment)GetInternalItemAlignmentProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(ItemAlignmentProperty, value); - } - else - { - SetInternalItemAlignmentProperty(this, null, value); - } - } + get => (LinearLayout.Alignment?)GetValue(ItemAlignmentProperty); + set => SetValue(ItemAlignmentProperty, value); } /// @@ -442,28 +155,8 @@ public LinearLayout.Alignment? ItemAlignment [EditorBrowsable(EditorBrowsableState.Never)] public HorizontalAlignment? ItemHorizontalAlignment { - get - { - if (NUIApplication.IsUsingXaml) - { - return (HorizontalAlignment?)GetValue(ItemHorizontalAlignmentProperty); - } - else - { - return (HorizontalAlignment?)GetInternalItemHorizontalAlignmentProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(ItemHorizontalAlignmentProperty, value); - } - else - { - SetInternalItemHorizontalAlignmentProperty(this, null, value); - } - } + get => (HorizontalAlignment?)GetValue(ItemHorizontalAlignmentProperty); + set => SetValue(ItemHorizontalAlignmentProperty, value); } /// @@ -472,28 +165,8 @@ public HorizontalAlignment? ItemHorizontalAlignment [EditorBrowsable(EditorBrowsableState.Never)] public VerticalAlignment? ItemVerticalAlignment { - get - { - if (NUIApplication.IsUsingXaml) - { - return (VerticalAlignment?)GetValue(ItemVerticalAlignmentProperty); - } - else - { - return (VerticalAlignment?)GetInternalItemVerticalAlignmentProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(ItemVerticalAlignmentProperty, value); - } - else - { - SetInternalItemVerticalAlignmentProperty(this, null, value); - } - } + get => (VerticalAlignment?)GetValue(ItemVerticalAlignmentProperty); + set => SetValue(ItemVerticalAlignmentProperty, value); } /// @@ -504,28 +177,8 @@ public VerticalAlignment? ItemVerticalAlignment [EditorBrowsable(EditorBrowsableState.Never)] public Size2D ItemSpacing { - get - { - if (NUIApplication.IsUsingXaml) - { - return (Size2D)GetValue(ItemSpacingProperty); - } - else - { - return (Size2D)GetInternalItemSpacingProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(ItemSpacingProperty, value); - } - else - { - SetInternalItemSpacingProperty(this, null, value); - } - } + get => (Size2D)GetValue(ItemSpacingProperty); + set => SetValue(ItemSpacingProperty, value); } /// @@ -553,21 +206,5 @@ public virtual ButtonExtension CreateExtension() { return null; } - - /// - /// Dispose ButtonStyle and all children on it. - /// - /// true in order to free managed objects - [EditorBrowsable(EditorBrowsableState.Never)] - protected override void Dispose(bool disposing) - { - if (disposing) - { - iconPadding?.Dispose(); - textPadding?.Dispose(); - } - - base.Dispose(disposing); - } } } diff --git a/src/Tizen.NUI.Components/Style/LoadingStyle.cs b/src/Tizen.NUI.Components/Style/LoadingStyle.cs index 2281e265f33..0efceb5d9d6 100755 --- a/src/Tizen.NUI.Components/Style/LoadingStyle.cs +++ b/src/Tizen.NUI.Components/Style/LoadingStyle.cs @@ -27,86 +27,14 @@ namespace Tizen.NUI.Components /// 8 public class LoadingStyle : ControlStyle { - /// The FrameRateSelector bindable property. - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty FrameRateSelectorProperty = null; - internal static void SetInternalFrameRateSelectorProperty(BindableObject bindable, object oldValue, object newValue) - { - ((LoadingStyle)bindable).frameRate = ((Selector)newValue)?.Clone(); - } - internal static object GetInternalFrameRateSelectorProperty(BindableObject bindable) - { - return ((LoadingStyle)bindable).frameRate; - } - - /// The LoadingSize bindable property. - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty LoadingSizeProperty = null; - internal static void SetInternalLoadingSizeProperty(BindableObject bindable, object oldValue, object newValue) - { - ((LoadingStyle)bindable).Size = (Size)newValue; - } - internal static object GetInternalLoadingSizeProperty(BindableObject bindable) - { - return ((LoadingStyle)bindable).Size; - } - - /// The Images bindable property. - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty ImagesProperty = null; - internal static void SetInternalImagesProperty(BindableObject bindable, object oldValue, object newValue) - { - ((LoadingStyle)bindable).images = newValue == null ? null : new List((string[])newValue); - } - internal static object GetInternalImagesProperty(BindableObject bindable) - { - return ((LoadingStyle)bindable).images?.ToArray(); - } - - /// The Images bindable property. - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty ImageListProperty = null; - internal static void SetInternalImageListProperty(BindableObject bindable, object oldValue, object newValue) - { - ((LoadingStyle)bindable).images = newValue == null ? null : newValue as List; - } - internal static object GetInternalImageListProperty(BindableObject bindable) - { - return ((LoadingStyle)bindable).images; - } - - /// The lottie resource url bindable property. - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty LottieResourceUrlProperty = null; - internal static void SetInternalLottieResourceUrlProperty(BindableObject bindable, object oldValue, object newValue) - { - ((LoadingStyle)bindable).lottieResourceUrl = newValue as string; - } - internal static object GetInternalLottieResourceUrlProperty(BindableObject bindable) - { - return ((LoadingStyle)bindable).lottieResourceUrl; - } + // NOTE framerate selector does not work. + static readonly IStyleProperty FrameRateProperty = new StyleProperty>((v, o) => v.FrameRate = (int)o.Normal); + static readonly IStyleProperty ImageListProperty = new StyleProperty>((v, o) => Loading.SetInternalImageListProperty(v, null, o)); + static readonly IStyleProperty LottieResourceUrlProperty = new StyleProperty((v, o) => v.LottieResourceUrl = o); - private Selector frameRate; - private List images; - private string lottieResourceUrl; + private Size loadingSize; - static LoadingStyle() - { - if (NUIApplication.IsUsingXaml) - { - FrameRateSelectorProperty = BindableProperty.Create("FrameRateSelector", typeof(Selector), typeof(LoadingStyle), null, - propertyChanged: SetInternalFrameRateSelectorProperty, defaultValueCreator: GetInternalFrameRateSelectorProperty); - LoadingSizeProperty = BindableProperty.Create(nameof(LoadingSize), typeof(Size), typeof(LoadingStyle), null, - propertyChanged: SetInternalLoadingSizeProperty, defaultValueCreator: GetInternalLoadingSizeProperty); - ImagesProperty = BindableProperty.Create(nameof(Images), typeof(string[]), typeof(LoadingStyle), null, - propertyChanged: SetInternalImagesProperty, defaultValueCreator: GetInternalImagesProperty); - ImageListProperty = BindableProperty.Create(nameof(ImageList), typeof(IList), typeof(LoadingStyle), null, - propertyChanged: SetInternalImageListProperty, defaultValueCreator: GetInternalImageListProperty); - LottieResourceUrlProperty = BindableProperty.Create(nameof(LottieResourceUrl), typeof(string), typeof(LoadingStyle), null, - propertyChanged: SetInternalLottieResourceUrlProperty, defaultValueCreator: GetInternalLottieResourceUrlProperty); - } - } + static LoadingStyle() { } /// /// Creates a new instance of a LoadingStyle. @@ -127,24 +55,7 @@ public LoadingStyle(LoadingStyle style) : base(style) /// Gets or sets loading image resources. /// /// 8 - public string[] Images - { - get - { - return (ImageList as List)?.ToArray(); - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(ImagesProperty, value); - } - else - { - SetInternalImagesProperty(this, null, value); - } - } - } + public string[] Images { get; set; } /// /// Gets loading image resources. @@ -154,26 +65,9 @@ public IList ImageList { get { - if (NUIApplication.IsUsingXaml) - { - return GetValue(ImageListProperty) as List; - } - else - { - return GetInternalImageListProperty(this) as IList; - } - } - internal set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(ImageListProperty, value); - } - else - { - SetInternalImageListProperty(this, null, value); - } + return GetValue(ImageListProperty) as List; } + internal set => SetValue(ImageListProperty, value); } /// @@ -183,28 +77,8 @@ internal set [EditorBrowsable(EditorBrowsableState.Never)] public string LottieResourceUrl { - get - { - if (NUIApplication.IsUsingXaml) - { - return GetValue(LottieResourceUrlProperty) as string; - } - else - { - return GetInternalLottieResourceUrlProperty(this) as string; - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(LottieResourceUrlProperty, value); - } - else - { - SetInternalLottieResourceUrlProperty(this, null, value); - } - } + get => GetValue(LottieResourceUrlProperty) as string; + set => SetValue(LottieResourceUrlProperty, value); } /// @@ -213,27 +87,10 @@ public string LottieResourceUrl /// 8 public Size LoadingSize { - get - { - if (NUIApplication.IsUsingXaml) - { - return (Size)GetValue(LoadingSizeProperty); - } - else - { - return (Size)GetInternalLoadingSizeProperty(this); - } - } + get => loadingSize; set { - if (NUIApplication.IsUsingXaml) - { - SetValue(LoadingSizeProperty, value); - } - else - { - SetInternalLoadingSizeProperty(this, null, value); - } + loadingSize = value; } } @@ -243,28 +100,8 @@ public Size LoadingSize /// 8 public Selector FrameRate { - get - { - if (NUIApplication.IsUsingXaml) - { - return (Selector)GetValue(FrameRateSelectorProperty); - } - else - { - return (Selector)GetInternalFrameRateSelectorProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(FrameRateSelectorProperty, value); - } - else - { - SetInternalFrameRateSelectorProperty(this, null, value); - } - } + get => (Selector)GetValue(FrameRateProperty); + set => SetValue(FrameRateProperty, value); } /// diff --git a/src/Tizen.NUI.Components/Style/PaginationStyle.cs b/src/Tizen.NUI.Components/Style/PaginationStyle.cs index d172a3c3765..8b71d1aad74 100755 --- a/src/Tizen.NUI.Components/Style/PaginationStyle.cs +++ b/src/Tizen.NUI.Components/Style/PaginationStyle.cs @@ -26,58 +26,11 @@ namespace Tizen.NUI.Components /// 8 public class PaginationStyle : ControlStyle { - /// The IndicatorSize bindable property. - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty IndicatorSizeProperty = null; - internal static void SetInternalIndicatorSizeProperty(BindableObject bindable, object oldValue, object newValue) - { - ((PaginationStyle)bindable).indicatorSize = newValue == null ? null : new Size((Size)newValue); - } - internal static object GetInternalIndicatorSizeProperty(BindableObject bindable) - { - return ((PaginationStyle)bindable).indicatorSize; - } - - /// The IndicatorImageUrlSelector bindable property. - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty IndicatorImageUrlSelectorProperty = null; - internal static void SetInternalIndicatorImageUrlSelectorProperty(BindableObject bindable, object oldValue, object newValue) - { - ((PaginationStyle)bindable).indicatorImageUrl = (Selector)newValue; - } - internal static object GetInternalIndicatorImageUrlSelectorProperty(BindableObject bindable) - { - return ((PaginationStyle)bindable).indicatorImageUrl; - } + static readonly IStyleProperty IndicatorSizeProperty = new StyleProperty((v, o) => v.IndicatorSize = o); + static readonly IStyleProperty IndicatorImageUrlProperty = new StyleProperty>((v, o) => v.IndicatorImageUrl = o); + static readonly IStyleProperty IndicatorSpacingProperty = new StyleProperty((v, o) => v.IndicatorSpacing = o); - /// The IndicatorSpacing bindable property. - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty IndicatorSpacingProperty = null; - internal static void SetInternalIndicatorSpacingProperty(BindableObject bindable, object oldValue, object newValue) - { - ((PaginationStyle)bindable).indicatorSpacing = (int?)newValue; - } - internal static object GetInternalIndicatorSpacingProperty(BindableObject bindable) - { - return ((PaginationStyle)bindable).indicatorSpacing; - } - - private Size indicatorSize; - private Selector indicatorImageUrl; - private int? indicatorSpacing; - - static PaginationStyle() - { - if (NUIApplication.IsUsingXaml) - { - IndicatorSizeProperty = BindableProperty.Create(nameof(IndicatorSize), typeof(Size), typeof(PaginationStyle), null, - propertyChanged: SetInternalIndicatorSizeProperty, defaultValueCreator: GetInternalIndicatorSizeProperty); - IndicatorImageUrlSelectorProperty = BindableProperty.Create("IndicatorImageUrl", typeof(Selector), typeof(PaginationStyle), null, - propertyChanged: SetInternalIndicatorImageUrlSelectorProperty, defaultValueCreator: GetInternalIndicatorImageUrlSelectorProperty); - IndicatorSpacingProperty = BindableProperty.Create(nameof(IndicatorSpacing), typeof(int?), typeof(PaginationStyle), null, - propertyChanged: SetInternalIndicatorSpacingProperty, defaultValueCreator: GetInternalIndicatorSpacingProperty); - } - } + static PaginationStyle() { } /// /// Creates a new instance of a PaginationStyle. @@ -100,28 +53,8 @@ public PaginationStyle(PaginationStyle style) : base(style) /// 8 public Size IndicatorSize { - get - { - if (NUIApplication.IsUsingXaml) - { - return (Size)GetValue(IndicatorSizeProperty); - } - else - { - return (Size)GetInternalIndicatorSizeProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(IndicatorSizeProperty, value); - } - else - { - SetInternalIndicatorSizeProperty(this, null, value); - } - } + get => (Size)GetValue(IndicatorSizeProperty); + set => SetValue(IndicatorSizeProperty, value); } /// @@ -130,28 +63,8 @@ public Size IndicatorSize /// 8 public Selector IndicatorImageUrl { - get - { - if (NUIApplication.IsUsingXaml) - { - return (Selector)GetValue(IndicatorImageUrlSelectorProperty); - } - else - { - return (Selector)GetInternalIndicatorImageUrlSelectorProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(IndicatorImageUrlSelectorProperty, value); - } - else - { - SetInternalIndicatorImageUrlSelectorProperty(this, null, value); - } - } + get => (Selector)GetValue(IndicatorImageUrlProperty); + set => SetValue(IndicatorImageUrlProperty, value); } /// @@ -160,28 +73,8 @@ public Selector IndicatorImageUrl /// 8 public int IndicatorSpacing { - get - { - if (NUIApplication.IsUsingXaml) - { - return ((int?)GetValue(IndicatorSpacingProperty)) ?? 0; - } - else - { - return ((int?)GetInternalIndicatorSpacingProperty(this)) ?? 0; - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(IndicatorSpacingProperty, value); - } - else - { - SetInternalIndicatorSpacingProperty(this, null, value); - } - } + get => ((int?)GetValue(IndicatorSpacingProperty)) ?? 0; + set => SetValue(IndicatorSpacingProperty, value); } /// diff --git a/src/Tizen.NUI.Components/Style/RecyclerViewItemStyle.cs b/src/Tizen.NUI.Components/Style/RecyclerViewItemStyle.cs index c598ed1b487..0749ab8f293 100755 --- a/src/Tizen.NUI.Components/Style/RecyclerViewItemStyle.cs +++ b/src/Tizen.NUI.Components/Style/RecyclerViewItemStyle.cs @@ -28,47 +28,10 @@ namespace Tizen.NUI.Components /// 9 public class RecyclerViewItemStyle : ControlStyle { - /// 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 static readonly BindableProperty IsSelectableProperty = null; - internal static void SetInternalIsSelectableProperty(BindableObject bindable, object oldValue, object newValue) - { - var RecyclerViewItemStyle = (RecyclerViewItemStyle)bindable; - RecyclerViewItemStyle.isSelectable = (bool?)newValue; - } - internal static object GetInternalIsSelectableProperty(BindableObject bindable) - { - var RecyclerViewItemStyle = (RecyclerViewItemStyle)bindable; - return RecyclerViewItemStyle.isSelectable; - } - - /// 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 static readonly BindableProperty IsSelectedProperty = null; - internal static void SetInternalIsSelectedProperty(BindableObject bindable, object oldValue, object newValue) - { - var RecyclerViewItemStyle = (RecyclerViewItemStyle)bindable; - RecyclerViewItemStyle.isSelected = (bool?)newValue; - } - internal static object GetInternalIsSelectedProperty(BindableObject bindable) - { - var RecyclerViewItemStyle = (RecyclerViewItemStyle)bindable; - return RecyclerViewItemStyle.isSelected; - } - - private bool? isSelectable; - private bool? isSelected; + static readonly IStyleProperty IsSelectableProperty = new StyleProperty((v, o) => v.IsSelectable = o); + static readonly IStyleProperty IsSelectedProperty = new StyleProperty((v, o) => v.IsSelected = o); - static RecyclerViewItemStyle() - { - if (NUIApplication.IsUsingXaml) - { - IsSelectableProperty = BindableProperty.Create(nameof(IsSelectable), typeof(bool?), typeof(RecyclerViewItemStyle), null, - propertyChanged: SetInternalIsSelectableProperty, defaultValueCreator: GetInternalIsSelectableProperty); - IsSelectedProperty = BindableProperty.Create(nameof(IsSelected), typeof(bool?), typeof(RecyclerViewItemStyle), null, - propertyChanged: SetInternalIsSelectedProperty, defaultValueCreator: GetInternalIsSelectedProperty); - } - } + static RecyclerViewItemStyle() { } /// /// Creates a new instance of a RecyclerViewItemStyle. @@ -93,28 +56,8 @@ public RecyclerViewItemStyle(RecyclerViewItemStyle style) : base(style) [EditorBrowsable(EditorBrowsableState.Never)] public bool? IsSelectable { - get - { - if (NUIApplication.IsUsingXaml) - { - return (bool?)GetValue(IsSelectableProperty); - } - else - { - return (bool?)GetInternalIsSelectableProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(IsSelectableProperty, value); - } - else - { - SetInternalIsSelectableProperty(this, null, value); - } - } + get => (bool?)GetValue(IsSelectableProperty); + set => SetValue(IsSelectableProperty, value); } /// @@ -123,28 +66,8 @@ public bool? IsSelectable [EditorBrowsable(EditorBrowsableState.Never)] public bool? IsSelected { - get - { - if (NUIApplication.IsUsingXaml) - { - return (bool?)GetValue(IsSelectedProperty); - } - else - { - return (bool?)GetInternalIsSelectedProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(IsSelectedProperty, value); - } - else - { - SetInternalIsSelectedProperty(this, null, value); - } - } + get => (bool?)GetValue(IsSelectedProperty); + set => SetValue(IsSelectedProperty, value); } /// diff --git a/src/Tizen.NUI.Components/Style/ScrollbarStyle.cs b/src/Tizen.NUI.Components/Style/ScrollbarStyle.cs index 97129cd3b47..ccc95356724 100644 --- a/src/Tizen.NUI.Components/Style/ScrollbarStyle.cs +++ b/src/Tizen.NUI.Components/Style/ScrollbarStyle.cs @@ -27,103 +27,19 @@ namespace Tizen.NUI.Components public class ScrollbarStyle : ControlStyle { #region Fields - - /// Bindable property of TrackThickness - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty TrackThicknessProperty = null; - internal static void SetInternalTrackThicknessProperty(BindableObject bindable, object oldValue, object newValue) - { - ((ScrollbarStyle)bindable).trackThickness = (float?)newValue; - } - internal static object GetInternalTrackThicknessProperty(BindableObject bindable) - { - return ((ScrollbarStyle)bindable).trackThickness; - } - - /// Bindable property of ThumbThickness - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty ThumbThicknessProperty = null; - internal static void SetInternalThumbThicknessProperty(BindableObject bindable, object oldValue, object newValue) - { - ((ScrollbarStyle)bindable).thumbThickness = (float?)newValue; - } - internal static object GetInternalThumbThicknessProperty(BindableObject bindable) - { - return ((ScrollbarStyle)bindable).thumbThickness; - } - - /// Bindable property of TrackColor - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty TrackColorProperty = null; - internal static void SetInternalTrackColorProperty(BindableObject bindable, object oldValue, object newValue) - { - ((ScrollbarStyle)bindable).trackColor = new Color((Color)newValue); - } - internal static object GetInternalTrackColorProperty(BindableObject bindable) - { - return ((ScrollbarStyle)bindable).trackColor; - } - - /// Bindable property of ThumbColor - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty ThumbColorProperty = null; - internal static void SetInternalThumbColorProperty(BindableObject bindable, object oldValue, object newValue) - { - ((ScrollbarStyle)bindable).thumbColor = new Color((Color)newValue); - } - internal static object GetInternalThumbColorProperty(BindableObject bindable) - { - return ((ScrollbarStyle)bindable).thumbColor; - } - - /// Bindable property of TrackPadding - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty TrackPaddingProperty = null; - internal static void SetInternalTrackPaddingProperty(BindableObject bindable, object oldValue, object newValue) - { - ((ScrollbarStyle)bindable).trackPadding = new Extents((Extents)newValue); - } - internal static object GetInternalTrackPaddingProperty(BindableObject bindable) - { - return ((ScrollbarStyle)bindable).trackPadding; - } - - /// Bindable property of ThumbBackgroundImageVertical - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty ThumbVerticalImageUrlProperty = null; - internal static void SetInternalThumbVerticalImageUrlProperty(BindableObject bindable, object oldValue, object newValue) - { - ((ScrollbarStyle)bindable).thumbVerticalImageUrl = ((string)newValue); - } - internal static object GetInternalThumbVerticalImageUrlProperty(BindableObject bindable) - { - return ((ScrollbarStyle)bindable).thumbVerticalImageUrl; - } - - /// Bindable property of ThumbBackgroundImageUrl - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty ThumbHorizontalImageUrlProperty = null; - internal static void SetInternalThumbHorizontalImageUrlProperty(BindableObject bindable, object oldValue, object newValue) - { - ((ScrollbarStyle)bindable).thumbHorizontalImageUrl = ((string)newValue); - } - internal static object GetInternalThumbHorizontalImageUrlProperty(BindableObject bindable) - { - return ((ScrollbarStyle)bindable).thumbHorizontalImageUrl; - } - - private float? trackThickness; - private float? thumbThickness; - private Color trackColor; - private Color thumbColor; - private Extents trackPadding; - private string thumbVerticalImageUrl; - private string thumbHorizontalImageUrl; + static readonly IStyleProperty TrackThicknessProperty = new StyleProperty((v, o) => v.TrackThickness = o); + static readonly IStyleProperty ThumbThicknessProperty = new StyleProperty((v, o) => v.ThumbThickness = o); + static readonly IStyleProperty TrackColorProperty = new StyleProperty((v, o) => v.TrackColor = o); + static readonly IStyleProperty ThumbColorProperty = new StyleProperty((v, o) => v.ThumbColor = o); + static readonly IStyleProperty TrackPaddingProperty = new StyleProperty((v, o) => v.TrackPadding = o); + static readonly IStyleProperty ThumbVerticalImageUrlProperty = new StyleProperty((v, o) => v.ThumbVerticalImageUrl = o); + static readonly IStyleProperty ThumbHorizontalImageUrlProperty = new StyleProperty((v, o) => v.ThumbHorizontalImageUrl = o); #endregion Fields #region Constructors + /// /// Creates a new instance of a ScrollbarStyle. /// @@ -146,23 +62,6 @@ public ScrollbarStyle(ScrollbarStyle style) : base(style) /// static ScrollbarStyle() { - if (NUIApplication.IsUsingXaml) - { - TrackThicknessProperty = BindableProperty.Create(nameof(TrackThickness), typeof(float?), typeof(ScrollbarStyle), null, - propertyChanged: SetInternalTrackThicknessProperty, defaultValueCreator: GetInternalTrackThicknessProperty); - ThumbThicknessProperty = BindableProperty.Create(nameof(ThumbThickness), typeof(float?), typeof(ScrollbarStyle), null, - propertyChanged: SetInternalThumbThicknessProperty, defaultValueCreator: GetInternalThumbThicknessProperty); - TrackColorProperty = BindableProperty.Create(nameof(TrackColor), typeof(Color), typeof(ScrollbarStyle), null, - propertyChanged: SetInternalTrackColorProperty, defaultValueCreator: GetInternalTrackColorProperty); - ThumbColorProperty = BindableProperty.Create(nameof(ThumbColor), typeof(Color), typeof(ScrollbarStyle), null, - propertyChanged: SetInternalThumbColorProperty, defaultValueCreator: GetInternalThumbColorProperty); - TrackPaddingProperty = BindableProperty.Create(nameof(TrackPadding), typeof(Extents), typeof(ScrollbarStyle), null, - propertyChanged: SetInternalTrackPaddingProperty, defaultValueCreator: GetInternalTrackPaddingProperty); - ThumbVerticalImageUrlProperty = BindableProperty.Create(nameof(ThumbVerticalImageUrl), typeof(string), typeof(ScrollbarStyle), null, - propertyChanged: SetInternalThumbVerticalImageUrlProperty, defaultValueCreator: GetInternalThumbVerticalImageUrlProperty); - ThumbHorizontalImageUrlProperty = BindableProperty.Create(nameof(ThumbHorizontalImageUrl), typeof(string), typeof(ScrollbarStyle), null, - propertyChanged: SetInternalThumbHorizontalImageUrlProperty, defaultValueCreator: GetInternalThumbHorizontalImageUrlProperty); - } } #endregion Constructors @@ -176,28 +75,8 @@ static ScrollbarStyle() [EditorBrowsable(EditorBrowsableState.Never)] public float? TrackThickness { - get - { - if (NUIApplication.IsUsingXaml) - { - return (float?)GetValue(TrackThicknessProperty); - } - else - { - return (float?)GetInternalTrackThicknessProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(TrackThicknessProperty, value); - } - else - { - SetInternalTrackThicknessProperty(this, null, value); - } - } + get => (float?)GetValue(TrackThicknessProperty); + set => SetValue(TrackThicknessProperty, value); } /// @@ -206,28 +85,8 @@ public float? TrackThickness [EditorBrowsable(EditorBrowsableState.Never)] public float? ThumbThickness { - get - { - if (NUIApplication.IsUsingXaml) - { - return (float?)GetValue(ThumbThicknessProperty); - } - else - { - return (float?)GetInternalThumbThicknessProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(ThumbThicknessProperty, value); - } - else - { - SetInternalThumbThicknessProperty(this, null, value); - } - } + get => (float?)GetValue(ThumbThicknessProperty); + set => SetValue(ThumbThicknessProperty, value); } /// @@ -236,28 +95,8 @@ public float? ThumbThickness [EditorBrowsable(EditorBrowsableState.Never)] public Color TrackColor { - get - { - if (NUIApplication.IsUsingXaml) - { - return (Color)GetValue(TrackColorProperty); - } - else - { - return (Color)GetInternalTrackColorProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(TrackColorProperty, value); - } - else - { - SetInternalTrackColorProperty(this, null, value); - } - } + get => (Color)GetValue(TrackColorProperty); + set => SetValue(TrackColorProperty, value); } /// @@ -266,28 +105,8 @@ public Color TrackColor [EditorBrowsable(EditorBrowsableState.Never)] public Color ThumbColor { - get - { - if (NUIApplication.IsUsingXaml) - { - return (Color)GetValue(ThumbColorProperty); - } - else - { - return (Color)GetInternalThumbColorProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(ThumbColorProperty, value); - } - else - { - SetInternalThumbColorProperty(this, null, value); - } - } + get => (Color)GetValue(ThumbColorProperty); + set => SetValue(ThumbColorProperty, value); } /// @@ -296,28 +115,8 @@ public Color ThumbColor [EditorBrowsable(EditorBrowsableState.Never)] public Extents TrackPadding { - get - { - if (NUIApplication.IsUsingXaml) - { - return (Extents)GetValue(TrackPaddingProperty); - } - else - { - return (Extents)GetInternalTrackPaddingProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(TrackPaddingProperty, value); - } - else - { - SetInternalTrackPaddingProperty(this, null, value); - } - } + get => (Extents)GetValue(TrackPaddingProperty); + set => SetValue(TrackPaddingProperty, value); } /// @@ -326,28 +125,8 @@ public Extents TrackPadding [EditorBrowsable(EditorBrowsableState.Never)] public string ThumbVerticalImageUrl { - get - { - if (NUIApplication.IsUsingXaml) - { - return (string)GetValue(ThumbVerticalImageUrlProperty); - } - else - { - return (string)GetInternalThumbVerticalImageUrlProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(ThumbVerticalImageUrlProperty, value); - } - else - { - SetInternalThumbVerticalImageUrlProperty(this, null, value); - } - } + get => (string)GetValue(ThumbVerticalImageUrlProperty); + set => SetValue(ThumbVerticalImageUrlProperty, value); } /// @@ -356,28 +135,8 @@ public string ThumbVerticalImageUrl [EditorBrowsable(EditorBrowsableState.Never)] public string ThumbHorizontalImageUrl { - get - { - if (NUIApplication.IsUsingXaml) - { - return (string)GetValue(ThumbHorizontalImageUrlProperty); - } - else - { - return (string)GetInternalThumbHorizontalImageUrlProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(ThumbHorizontalImageUrlProperty, value); - } - else - { - SetInternalThumbHorizontalImageUrlProperty(this, null, value); - } - } + get => (string)GetValue(ThumbHorizontalImageUrlProperty); + set => SetValue(ThumbHorizontalImageUrlProperty, value); } /// diff --git a/src/Tizen.NUI.Components/Style/SliderStyle.cs b/src/Tizen.NUI.Components/Style/SliderStyle.cs index bbeb235fea5..ffcf5b65d32 100755 --- a/src/Tizen.NUI.Components/Style/SliderStyle.cs +++ b/src/Tizen.NUI.Components/Style/SliderStyle.cs @@ -27,97 +27,12 @@ namespace Tizen.NUI.Components /// 8 public class SliderStyle : ControlStyle { - /// - /// IndicatorTypeProperty - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty IndicatorTypeProperty = null; - internal static void SetInternalIndicatorTypeProperty(BindableObject bindable, object oldValue, object newValue) - { - var instance = (SliderStyle)bindable; - if (newValue != null) - { - instance.privateIndicatorType = (IndicatorType)newValue; - } - } - internal static object GetInternalIndicatorTypeProperty(BindableObject bindable) - { - var instance = (SliderStyle)bindable; - return instance.privateIndicatorType; - } - - /// - /// SpaceBetweenTrackAndIndicatorProperty - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty SpaceBetweenTrackAndIndicatorProperty = null; - internal static void SetInternalSpaceBetweenTrackAndIndicatorProperty(BindableObject bindable, object oldValue, object newValue) - { - var instance = (SliderStyle)bindable; - if (newValue != null) - { - instance.privateSpaceBetweenTrackAndIndicator = (uint?)newValue; - } - } - internal static object GetInternalSpaceBetweenTrackAndIndicatorProperty(BindableObject bindable) - { - var instance = (SliderStyle)bindable; - return instance.privateSpaceBetweenTrackAndIndicator; - } - - /// - /// TrackThicknessProperty - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty TrackThicknessProperty = null; - internal static void SetInternalTrackThicknessProperty(BindableObject bindable, object oldValue, object newValue) - { - var instance = (SliderStyle)bindable; - if (newValue != null) - { - instance.privateTrackThickness = (uint?)newValue; - } - } - internal static object GetInternalTrackThicknessProperty(BindableObject bindable) - { - var instance = (SliderStyle)bindable; - return instance.privateTrackThickness; - } + static readonly IStyleProperty IndicatorTypeProperty = new StyleProperty((v, o) => v.Indicator = o); + static readonly IStyleProperty TrackThicknessProperty = new StyleProperty((v, o) => v.TrackThickness = o); + static readonly IStyleProperty SpaceBetweenTrackAndIndicatorProperty = new StyleProperty((v, o) => v.SpaceBetweenTrackAndIndicator = o); + static readonly IStyleProperty TrackPaddingProperty = new StyleProperty((v, o) => v.SpaceBetweenTrackAndIndicator = o.Start); - /// - /// TrackPaddingProperty - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty TrackPaddingProperty = null; - internal static void SetInternalTrackPaddingProperty(BindableObject bindable, object oldValue, object newValue) - { - ((SliderStyle)bindable).trackPadding = newValue == null ? null : new Extents((Extents)newValue); - } - internal static object GetInternalTrackPaddingProperty(BindableObject bindable) - { - var instance = (SliderStyle)bindable; - return instance.trackPadding; - } - - private IndicatorType? privateIndicatorType = Slider.IndicatorType.None; - private uint? privateTrackThickness; - private uint? privateSpaceBetweenTrackAndIndicator; - private Extents trackPadding; - - static SliderStyle() - { - if (NUIApplication.IsUsingXaml) - { - IndicatorTypeProperty = BindableProperty.Create(nameof(IndicatorType), typeof(IndicatorType?), typeof(SliderStyle), null, - propertyChanged: SetInternalIndicatorTypeProperty, defaultValueCreator: GetInternalIndicatorTypeProperty); - SpaceBetweenTrackAndIndicatorProperty = BindableProperty.Create(nameof(SpaceBetweenTrackAndIndicator), typeof(uint?), typeof(SliderStyle), null, - propertyChanged: SetInternalSpaceBetweenTrackAndIndicatorProperty, defaultValueCreator: GetInternalSpaceBetweenTrackAndIndicatorProperty); - TrackThicknessProperty = BindableProperty.Create(nameof(TrackThickness), typeof(uint?), typeof(SliderStyle), null, - propertyChanged: SetInternalTrackThicknessProperty, defaultValueCreator: GetInternalTrackThicknessProperty); - TrackPaddingProperty = BindableProperty.Create(nameof(TrackPadding), typeof(Extents), typeof(SliderStyle), null, - propertyChanged: SetInternalTrackPaddingProperty, defaultValueCreator: GetInternalTrackPaddingProperty); - } - } + static SliderStyle() { } /// /// Creates a new instance of a SliderStyle. @@ -210,28 +125,8 @@ public SliderStyle(SliderStyle style) : base(style) /// 8 public IndicatorType? IndicatorType { - get - { - if (NUIApplication.IsUsingXaml) - { - return (IndicatorType?)GetValue(IndicatorTypeProperty); - } - else - { - return (IndicatorType)GetInternalIndicatorTypeProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(IndicatorTypeProperty, value); - } - else - { - SetInternalIndicatorTypeProperty(this, null, value); - } - } + get => (IndicatorType?)GetValue(IndicatorTypeProperty); + set => SetValue(IndicatorTypeProperty, value); } /// @@ -240,28 +135,8 @@ public IndicatorType? IndicatorType /// 8 public uint? TrackThickness { - get - { - if (NUIApplication.IsUsingXaml) - { - return (uint?)GetValue(TrackThicknessProperty); - } - else - { - return (uint?)GetInternalTrackThicknessProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(TrackThicknessProperty, value); - } - else - { - SetInternalTrackThicknessProperty(this, null, value); - } - } + get => (uint?)GetValue(TrackThicknessProperty); + set => SetValue(TrackThicknessProperty, value); } /// @@ -270,28 +145,8 @@ public uint? TrackThickness /// 8 public uint? SpaceBetweenTrackAndIndicator { - get - { - if (NUIApplication.IsUsingXaml) - { - return (uint?)GetValue(SpaceBetweenTrackAndIndicatorProperty); - } - else - { - return (uint?)GetInternalSpaceBetweenTrackAndIndicatorProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(SpaceBetweenTrackAndIndicatorProperty, value); - } - else - { - SetInternalSpaceBetweenTrackAndIndicatorProperty(this, null, value); - } - } + get => (uint?)GetValue(SpaceBetweenTrackAndIndicatorProperty); + set => SetValue(SpaceBetweenTrackAndIndicatorProperty, value); } /// @@ -300,28 +155,8 @@ public uint? SpaceBetweenTrackAndIndicator /// 8 public Extents TrackPadding { - get - { - if (NUIApplication.IsUsingXaml) - { - return ((Extents)GetValue(TrackPaddingProperty)) ?? (trackPadding = new Extents(0, 0, 0, 0)); - } - else - { - return (Extents)GetInternalTrackPaddingProperty(this) ?? (trackPadding = new Extents(0, 0, 0, 0)); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(TrackPaddingProperty, value); - } - else - { - SetInternalTrackPaddingProperty(this, null, value); - } - } + get => GetOrCreateValue(TrackPaddingProperty); + set => SetValue(TrackPaddingProperty, value); } /// @@ -355,7 +190,6 @@ protected override void Dispose(bool disposing) { if (disposing) { - trackPadding?.Dispose(); } base.Dispose(disposing); diff --git a/src/Tizen.NUI.Components/Style/ToastStyle.cs b/src/Tizen.NUI.Components/Style/ToastStyle.cs index 44107e0c3f4..89766dbc1d7 100755 --- a/src/Tizen.NUI.Components/Style/ToastStyle.cs +++ b/src/Tizen.NUI.Components/Style/ToastStyle.cs @@ -26,28 +26,9 @@ namespace Tizen.NUI.Components [EditorBrowsable(EditorBrowsableState.Never)] public class ToastStyle : ControlStyle { - /// The Duration bindable property. - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty DurationProperty = null; - internal static void SetInternalDurationProperty(BindableObject bindable, object oldValue, object newValue) - { - ((ToastStyle)bindable).duration = (uint?)newValue; - } - internal static object GetInternalDurationProperty(BindableObject bindable) - { - return ((ToastStyle)bindable).duration; - } - - private uint? duration; + static readonly IStyleProperty DurationProperty = new StyleProperty((v, o) => v.Duration = o); - static ToastStyle() - { - if (NUIApplication.IsUsingXaml) - { - DurationProperty = BindableProperty.Create(nameof(Duration), typeof(uint?), typeof(ToastStyle), null, - propertyChanged: SetInternalDurationProperty, defaultValueCreator: GetInternalDurationProperty); - } - } + static ToastStyle() { } /// /// Creates a new instance of a ToastStyle. @@ -72,28 +53,8 @@ public ToastStyle(ToastStyle style) : base(style) [EditorBrowsable(EditorBrowsableState.Never)] public uint? Duration { - get - { - if (NUIApplication.IsUsingXaml) - { - return (uint?)GetValue(DurationProperty); - } - else - { - return (uint?)GetInternalDurationProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(DurationProperty, value); - } - else - { - SetInternalDurationProperty(this, null, value); - } - } + get => (uint?)GetValue(DurationProperty); + set => SetValue(DurationProperty, value); } /// diff --git a/src/Tizen.NUI/src/public/BaseComponents/Style/ImageViewStyle.cs b/src/Tizen.NUI/src/public/BaseComponents/Style/ImageViewStyle.cs index a1b8a6ea6bf..6d60cb4dfcf 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/Style/ImageViewStyle.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/Style/ImageViewStyle.cs @@ -26,114 +26,13 @@ namespace Tizen.NUI.BaseComponents [EditorBrowsable(EditorBrowsableState.Never)] public class ImageViewStyle : ViewStyle { - /// 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 static readonly BindableProperty ResourceUrlProperty = null; - internal static void SetInternalResourceUrlProperty(BindableObject bindable, object oldValue, object newValue) - { - var imageViewStyle = (ImageViewStyle)bindable; - imageViewStyle.resourceUrl = ((Selector)newValue)?.Clone(); - } - internal static object GetInternalResourceUrlProperty(BindableObject bindable) - { - var imageViewStyle = (ImageViewStyle)bindable; - return imageViewStyle.resourceUrl; - } - - /// 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 static readonly BindableProperty BorderProperty = null; - internal static void SetInternalBorderProperty(BindableObject bindable, object oldValue, object newValue) - { - var imageViewStyle = (ImageViewStyle)bindable; - imageViewStyle.border = ((Selector)newValue)?.Clone(); - } - internal static object GetInternalBorderProperty(BindableObject bindable) - { - var imageViewStyle = (ImageViewStyle)bindable; - return imageViewStyle.border; - } + static readonly IStyleProperty BorderOnlyProperty = new StyleProperty((v, o) => v.BorderOnly = o); + static readonly IStyleProperty SynchronousLoadingProperty = new StyleProperty((v, o) => v.SynchronousLoading = o); + static readonly IStyleProperty OrientationCorrectionProperty = new StyleProperty((v, o) => v.OrientationCorrection = o); + static readonly IStyleProperty ResourceUrlProperty = new StyleProperty>((v, o) => ImageView.SetInternalResourceUrlProperty(v, null, o)); + static readonly IStyleProperty BorderProperty = new StyleProperty>((v, o) => ImageView.SetInternalBorderProperty(v, null, o)); - /// 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 static readonly BindableProperty BorderOnlyProperty = null; - internal static void SetInternalBorderOnlyProperty(BindableObject bindable, object oldValue, object newValue) - { - var imageViewStyle = (ImageViewStyle)bindable; - imageViewStyle.borderOnly = (bool?)newValue; - } - internal static object GetInternalBorderOnlyProperty(BindableObject bindable) - { - var imageViewStyle = (ImageViewStyle)bindable; - return imageViewStyle.borderOnly; - } - - /// 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 static readonly BindableProperty SynchronosLoadingProperty = null; - internal static void SetInternalSynchronosLoadingProperty(BindableObject bindable, object oldValue, object newValue) - { - var imageViewStyle = (ImageViewStyle)bindable; - imageViewStyle.synchronousLoading = (bool?)newValue; - } - internal static object GetInternalSynchronosLoadingProperty(BindableObject bindable) - { - var imageViewStyle = (ImageViewStyle)bindable; - return imageViewStyle.synchronousLoading; - } - - /// This will be public opened in tizen_7.0 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty SynchronousLoadingProperty = null; - internal static void SetInternalSynchronousLoadingProperty(BindableObject bindable, object oldValue, object newValue) - { - var imageViewStyle = (ImageViewStyle)bindable; - imageViewStyle.synchronousLoading = (bool?)newValue; - } - internal static object GetInternalSynchronousLoadingProperty(BindableObject bindable) - { - var imageViewStyle = (ImageViewStyle)bindable; - return imageViewStyle.synchronousLoading; - } - - /// 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 static readonly BindableProperty OrientationCorrectionProperty = null; - internal static void SetInternalOrientationCorrectionProperty(BindableObject bindable, object oldValue, object newValue) - { - var imageViewStyle = (ImageViewStyle)bindable; - imageViewStyle.orientationCorrection = (bool?)newValue; - } - internal static object GetInternalOrientationCorrectionProperty(BindableObject bindable) - { - var imageViewStyle = (ImageViewStyle)bindable; - return imageViewStyle.orientationCorrection; - } - - private bool? borderOnly; - private bool? synchronousLoading; - private bool? orientationCorrection; - private Selector resourceUrl; - private Selector border; - - static ImageViewStyle() - { - if (NUIApplication.IsUsingXaml) - { - ResourceUrlProperty = BindableProperty.Create(nameof(ResourceUrl), typeof(Selector), typeof(ImageViewStyle), null, - propertyChanged: SetInternalResourceUrlProperty, defaultValueCreator: GetInternalResourceUrlProperty); - BorderProperty = BindableProperty.Create(nameof(Border), typeof(Selector), typeof(ImageViewStyle), null, - propertyChanged: SetInternalBorderProperty, defaultValueCreator: GetInternalBorderProperty); - BorderOnlyProperty = BindableProperty.Create(nameof(BorderOnly), typeof(bool?), typeof(ImageViewStyle), null, - propertyChanged: SetInternalBorderOnlyProperty, defaultValueCreator: GetInternalBorderOnlyProperty); - SynchronosLoadingProperty = BindableProperty.Create(nameof(SynchronousLoading), typeof(bool?), typeof(ImageViewStyle), null, - propertyChanged: SetInternalSynchronosLoadingProperty, defaultValueCreator: GetInternalSynchronosLoadingProperty); - SynchronousLoadingProperty = BindableProperty.Create(nameof(SynchronousLoading), typeof(bool?), typeof(ImageViewStyle), null, - propertyChanged: SetInternalSynchronousLoadingProperty, defaultValueCreator: GetInternalSynchronousLoadingProperty); - OrientationCorrectionProperty = BindableProperty.Create(nameof(OrientationCorrection), typeof(bool?), typeof(ImageViewStyle), null, - propertyChanged: SetInternalOrientationCorrectionProperty, defaultValueCreator: GetInternalOrientationCorrectionProperty); - } - } + static ImageViewStyle() { } /// /// Create an empty instance. @@ -147,112 +46,32 @@ public ImageViewStyle() : base() [EditorBrowsable(EditorBrowsableState.Never)] public bool? BorderOnly { - get - { - if (NUIApplication.IsUsingXaml) - { - return (bool?)GetValue(BorderOnlyProperty); - } - else - { - return (bool?)GetInternalBorderOnlyProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(BorderOnlyProperty, value); - } - else - { - SetInternalBorderOnlyProperty(this, null, value); - } - } + get => (bool?)GetValue(BorderOnlyProperty); + set => SetValue(BorderOnlyProperty, value); } /// 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 bool? SynchronosLoading { - get - { - if (NUIApplication.IsUsingXaml) - { - return (bool?)GetValue(SynchronosLoadingProperty); - } - else - { - return (bool?)GetInternalSynchronosLoadingProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(SynchronosLoadingProperty, value); - } - else - { - SetInternalSynchronosLoadingProperty(this, null, value); - } - } + get => (bool?)GetValue(SynchronousLoadingProperty); + set => SetValue(SynchronousLoadingProperty, value); } /// 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 bool? SynchronousLoading { - get - { - if (NUIApplication.IsUsingXaml) - { - return (bool?)GetValue(SynchronousLoadingProperty); - } - else - { - return (bool?)GetInternalSynchronousLoadingProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(SynchronousLoadingProperty, value); - } - else - { - SetInternalSynchronousLoadingProperty(this, null, value); - } - } + get => (bool?)GetValue(SynchronousLoadingProperty); + set => SetValue(SynchronousLoadingProperty, value); } /// 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 bool? OrientationCorrection { - get - { - if (NUIApplication.IsUsingXaml) - { - return (bool?)GetValue(OrientationCorrectionProperty); - } - else - { - return (bool?)GetInternalOrientationCorrectionProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(OrientationCorrectionProperty, value); - } - else - { - SetInternalOrientationCorrectionProperty(this, null, value); - } - } + get => (bool?)GetValue(OrientationCorrectionProperty); + set => SetValue(OrientationCorrectionProperty, value); } /// @@ -262,30 +81,8 @@ public bool? OrientationCorrection [EditorBrowsable(EditorBrowsableState.Never)] public Selector ResourceUrl { - get - { - Selector tmp = null; - if (NUIApplication.IsUsingXaml) - { - tmp = (Selector)GetValue(ResourceUrlProperty); - } - else - { - tmp = (Selector)GetInternalResourceUrlProperty(this); - } - return (null != tmp) ? tmp : resourceUrl = new Selector(); - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(ResourceUrlProperty, value); - } - else - { - SetInternalResourceUrlProperty(this, null, value); - } - } + get => GetOrCreateValue>(ResourceUrlProperty); + set => SetValue(ResourceUrlProperty, value); } /// @@ -295,30 +92,8 @@ public Selector ResourceUrl [EditorBrowsable(EditorBrowsableState.Never)] public Selector Border { - get - { - Selector tmp = null; - if (NUIApplication.IsUsingXaml) - { - tmp = (Selector)GetValue(BorderProperty); - } - else - { - tmp = (Selector)GetInternalBorderProperty(this); - } - return (null != tmp) ? tmp : border = new Selector(); - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(BorderProperty, value); - } - else - { - SetInternalBorderProperty(this, null, value); - } - } + get => GetOrCreateValue>(BorderProperty); + set => SetValue(BorderProperty, value); } } } diff --git a/src/Tizen.NUI/src/public/BaseComponents/Style/StyleProperty.cs b/src/Tizen.NUI/src/public/BaseComponents/Style/StyleProperty.cs new file mode 100755 index 00000000000..6d0839e9588 --- /dev/null +++ b/src/Tizen.NUI/src/public/BaseComponents/Style/StyleProperty.cs @@ -0,0 +1,49 @@ +/* + * Copyright(c) 2024 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +using System; +using System.ComponentModel; +using Tizen.NUI.BaseComponents; + +namespace Tizen.NUI +{ + [EditorBrowsable(EditorBrowsableState.Never)] + public interface IStyleProperty + { + void ApplyTo(View view, object value); + } + + [EditorBrowsable(EditorBrowsableState.Never)] + public class StyleProperty : IStyleProperty where TView : View + { + private Action viewPropertySetter; + + public StyleProperty(Action viewPropertySetter) + { + this.viewPropertySetter = viewPropertySetter; + } + + public void ApplyTo(View view, object obj) + { + if (view is TView tView) + { + viewPropertySetter(tView, (TValue)obj); + } + } + } +} + diff --git a/src/Tizen.NUI/src/public/BaseComponents/Style/TextEditorStyle.cs b/src/Tizen.NUI/src/public/BaseComponents/Style/TextEditorStyle.cs index fb3a6a64497..266bb27ff95 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/Style/TextEditorStyle.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/Style/TextEditorStyle.cs @@ -27,683 +27,52 @@ namespace Tizen.NUI.BaseComponents [EditorBrowsable(EditorBrowsableState.Never)] public class TextEditorStyle : ViewStyle { - /// The bindable property of FontFamily. - [EditorBrowsable(EditorBrowsableState.Never)] - internal static readonly BindableProperty FontFamilyProperty = null; - internal static void SetInternalFontFamilyProperty(BindableObject bindable, object oldValue, object newValue) - { - ((TextEditorStyle)bindable).fontFamily = (string)newValue; - } - internal static object GetInternalFontFamilyProperty(BindableObject bindable) - { - return ((TextEditorStyle)bindable).fontFamily; - } - - /// The bindable property of PointSize. - [EditorBrowsable(EditorBrowsableState.Never)] - internal static readonly BindableProperty PointSizeProperty = null; - internal static void SetInternalPointSizeProperty(BindableObject bindable, object oldValue, object newValue) - { - ((TextEditorStyle)bindable).pointSize = (float?)newValue; - } - internal static object GetInternalPointSizeProperty(BindableObject bindable) - { - return ((TextEditorStyle)bindable).pointSize; - } - - /// The bindable property of PixelSize. - [EditorBrowsable(EditorBrowsableState.Never)] - internal static readonly BindableProperty PixelSizeProperty = null; - internal static void SetInternalPixelSizeProperty(BindableObject bindable, object oldValue, object newValue) - { - ((TextEditorStyle)bindable).pixelSize = (float?)newValue; - } - internal static object GetInternalPixelSizeProperty(BindableObject bindable) - { - return ((TextEditorStyle)bindable).pixelSize; - } - - /// The bindable property of TextColor. - [EditorBrowsable(EditorBrowsableState.Never)] - internal static readonly BindableProperty TextColorProperty = null; - internal static void SetInternalTextColorProperty(BindableObject bindable, object oldValue, object newValue) - { - ((TextEditorStyle)bindable).textColor = (Vector4)newValue; - } - internal static object GetInternalTextColorProperty(BindableObject bindable) - { - return ((TextEditorStyle)bindable).textColor; - } - - /// The bindable property of PlaceholderTextColor. - [EditorBrowsable(EditorBrowsableState.Never)] - internal static readonly BindableProperty PlaceholderTextColorProperty = null; - internal static void SetInternalPlaceholderTextColorProperty(BindableObject bindable, object oldValue, object newValue) - { - ((TextEditorStyle)bindable).placeholderTextColor = (Color)newValue; - } - internal static object GetInternalPlaceholderTextColorProperty(BindableObject bindable) - { - return ((TextEditorStyle)bindable).placeholderTextColor; - } - - /// The bindable property of PrimaryCursorColor. - [EditorBrowsable(EditorBrowsableState.Never)] - internal static readonly BindableProperty PrimaryCursorColorProperty = null; - internal static void SetInternalPrimaryCursorColorProperty(BindableObject bindable, object oldValue, object newValue) - { - ((TextEditorStyle)bindable).primaryCursorColor = (Vector4)newValue; - } - internal static object GetInternalPrimaryCursorColorProperty(BindableObject bindable) - { - return ((TextEditorStyle)bindable).primaryCursorColor; - } - - /// The bindable property of HorizontalAlignment. - [EditorBrowsable(EditorBrowsableState.Never)] - internal static readonly BindableProperty HorizontalAlignmentProperty = null; - internal static void SetInternalHorizontalAlignmentProperty(BindableObject bindable, object oldValue, object newValue) - { - ((TextEditorStyle)bindable).horizontalAlignment = (HorizontalAlignment?)newValue; - } - internal static object GetInternalHorizontalAlignmentProperty(BindableObject bindable) - { - return ((TextEditorStyle)bindable).horizontalAlignment; - } - - /// The bindable property of VerticalAlignment. - [EditorBrowsable(EditorBrowsableState.Never)] - internal static readonly BindableProperty VerticalAlignmentProperty = null; - internal static void SetInternalVerticalAlignmentProperty(BindableObject bindable, object oldValue, object newValue) - { - ((TextEditorStyle)bindable).verticalAlignment = (VerticalAlignment?)newValue; - } - internal static object GetInternalVerticalAlignmentProperty(BindableObject bindable) - { - return ((TextEditorStyle)bindable).verticalAlignment; - } - - /// The bindable property of SecondaryCursorColor. - [EditorBrowsable(EditorBrowsableState.Never)] - internal static readonly BindableProperty SecondaryCursorColorProperty = null; - internal static void SetInternalSecondaryCursorColorProperty(BindableObject bindable, object oldValue, object newValue) - { - ((TextEditorStyle)bindable).secondaryCursorColor = (Vector4)newValue; - } - internal static object GetInternalSecondaryCursorColorProperty(BindableObject bindable) - { - return ((TextEditorStyle)bindable).secondaryCursorColor; - } - - /// The bindable property of EnableCursorBlink. - [EditorBrowsable(EditorBrowsableState.Never)] - internal static readonly BindableProperty EnableCursorBlinkProperty = null; - internal static void SetInternalEnableCursorBlinkProperty(BindableObject bindable, object oldValue, object newValue) - { - ((TextEditorStyle)bindable).enableCursorBlink = (bool?)newValue; - } - internal static object GetInternalEnableCursorBlinkProperty(BindableObject bindable) - { - return ((TextEditorStyle)bindable).enableCursorBlink; - } - - /// The bindable property of CursorBlinkInterval. - [EditorBrowsable(EditorBrowsableState.Never)] - internal static readonly BindableProperty CursorBlinkIntervalProperty = null; - internal static void SetInternalCursorBlinkIntervalProperty(BindableObject bindable, object oldValue, object newValue) - { - ((TextEditorStyle)bindable).cursorBlinkInterval = (float?)newValue; - } - internal static object GetInternalCursorBlinkIntervalProperty(BindableObject bindable) - { - return ((TextEditorStyle)bindable).cursorBlinkInterval; - } - - /// The bindable property of CursorBlinkDuration. - [EditorBrowsable(EditorBrowsableState.Never)] - internal static readonly BindableProperty CursorBlinkDurationProperty = null; - internal static void SetInternalCursorBlinkDurationProperty(BindableObject bindable, object oldValue, object newValue) - { - ((TextEditorStyle)bindable).cursorBlinkDuration = (float?)newValue; - } - internal static object GetInternalCursorBlinkDurationProperty(BindableObject bindable) - { - return ((TextEditorStyle)bindable).cursorBlinkDuration; - } - - /// The bindable property of CursorWidth. - [EditorBrowsable(EditorBrowsableState.Never)] - internal static readonly BindableProperty CursorWidthProperty = null; - internal static void SetInternalCursorWidthProperty(BindableObject bindable, object oldValue, object newValue) - { - ((TextEditorStyle)bindable).cursorWidth = (int?)newValue; - } - internal static object GetInternalCursorWidthProperty(BindableObject bindable) - { - return ((TextEditorStyle)bindable).cursorWidth; - } - - /// The bindable property of GrabHandleColor. - [EditorBrowsable(EditorBrowsableState.Never)] - internal static readonly BindableProperty GrabHandleColorProperty = null; - internal static void SetInternalGrabHandleColorProperty(BindableObject bindable, object oldValue, object newValue) - { - ((TextEditorStyle)bindable).grabHandleColor = (Color)newValue; - } - internal static object GetInternalGrabHandleColorProperty(BindableObject bindable) - { - return ((TextEditorStyle)bindable).grabHandleColor; - } - - /// The bindable property of GrabHandleImage. - [EditorBrowsable(EditorBrowsableState.Never)] - internal static readonly BindableProperty GrabHandleImageProperty = null; - internal static void SetInternalGrabHandleImageProperty(BindableObject bindable, object oldValue, object newValue) - { - ((TextEditorStyle)bindable).grabHandleImage = (string)newValue; - } - internal static object GetInternalGrabHandleImageProperty(BindableObject bindable) - { - return ((TextEditorStyle)bindable).grabHandleImage; - } - - /// The bindable property of GrabHandlePressedImage. - [EditorBrowsable(EditorBrowsableState.Never)] - internal static readonly BindableProperty GrabHandlePressedImageProperty = null; - internal static void SetInternalGrabHandlePressedImageProperty(BindableObject bindable, object oldValue, object newValue) - { - ((TextEditorStyle)bindable).grabHandlePressedImage = (string)newValue; - } - internal static object GetInternalGrabHandlePressedImageProperty(BindableObject bindable) - { - return ((TextEditorStyle)bindable).grabHandlePressedImage; - } - - /// The bindable property of SelectionHandleImageLeft. - [EditorBrowsable(EditorBrowsableState.Never)] - internal static readonly BindableProperty SelectionHandleImageLeftProperty = null; - internal static void SetInternalSelectionHandleImageLeftProperty(BindableObject bindable, object oldValue, object newValue) - { - ((TextEditorStyle)bindable).selectionHandleImageLeft = (PropertyMap)newValue; - } - internal static object GetInternalSelectionHandleImageLeftProperty(BindableObject bindable) - { - return ((TextEditorStyle)bindable).selectionHandleImageLeft; - } - - /// The bindable property of SelectionHandleImageRight. - [EditorBrowsable(EditorBrowsableState.Never)] - internal static readonly BindableProperty SelectionHandleImageRightProperty = null; - internal static void SetInternalSelectionHandleImageRightProperty(BindableObject bindable, object oldValue, object newValue) - { - ((TextEditorStyle)bindable).selectionHandleImageRight = (PropertyMap)newValue; - } - internal static object GetInternalSelectionHandleImageRightProperty(BindableObject bindable) - { - return ((TextEditorStyle)bindable).selectionHandleImageRight; - } - - /// The bindable property of ScrollThreshold. - [EditorBrowsable(EditorBrowsableState.Never)] - internal static readonly BindableProperty ScrollThresholdProperty = null; - internal static void SetInternalScrollThresholdProperty(BindableObject bindable, object oldValue, object newValue) - { - ((TextEditorStyle)bindable).scrollThreshold = (float?)newValue; - } - internal static object GetInternalScrollThresholdProperty(BindableObject bindable) - { - return ((TextEditorStyle)bindable).scrollThreshold; - } - - /// The bindable property of ScrollSpeed. - [EditorBrowsable(EditorBrowsableState.Never)] - internal static readonly BindableProperty ScrollSpeedProperty = null; - internal static void SetInternalScrollSpeedProperty(BindableObject bindable, object oldValue, object newValue) - { - ((TextEditorStyle)bindable).scrollSpeed = (float?)newValue; - } - internal static object GetInternalScrollSpeedProperty(BindableObject bindable) - { - return ((TextEditorStyle)bindable).scrollSpeed; - } - - /// The bindable property of SelectionHighlightColor. - [EditorBrowsable(EditorBrowsableState.Never)] - internal static readonly BindableProperty SelectionHighlightColorProperty = null; - internal static void SetInternalSelectionHighlightColorProperty(BindableObject bindable, object oldValue, object newValue) - { - ((TextEditorStyle)bindable).selectionHighlightColor = (Vector4)newValue; - } - internal static object GetInternalSelectionHighlightColorProperty(BindableObject bindable) - { - return ((TextEditorStyle)bindable).selectionHighlightColor; - } - - /// The bindable property of DecorationBoundingBox. - [EditorBrowsable(EditorBrowsableState.Never)] - internal static readonly BindableProperty DecorationBoundingBoxProperty = null; - internal static void SetInternalDecorationBoundingBoxProperty(BindableObject bindable, object oldValue, object newValue) - { - ((TextEditorStyle)bindable).decorationBoundingBox = (Rectangle)newValue; - } - internal static object GetInternalDecorationBoundingBoxProperty(BindableObject bindable) - { - return ((TextEditorStyle)bindable).decorationBoundingBox; - } - - /// The bindable property of InputColor. - [EditorBrowsable(EditorBrowsableState.Never)] - internal static readonly BindableProperty InputColorProperty = null; - internal static void SetInternalInputColorProperty(BindableObject bindable, object oldValue, object newValue) - { - ((TextEditorStyle)bindable).inputColor = (Vector4)newValue; - } - internal static object GetInternalInputColorProperty(BindableObject bindable) - { - return ((TextEditorStyle)bindable).inputColor; - } - - /// The bindable property of InputFontFamily. - [EditorBrowsable(EditorBrowsableState.Never)] - internal static readonly BindableProperty InputFontFamilyProperty = null; - internal static void SetInternalInputFontFamilyProperty(BindableObject bindable, object oldValue, object newValue) - { - ((TextEditorStyle)bindable).inputFontFamily = (string)newValue; - } - internal static object GetInternalInputFontFamilyProperty(BindableObject bindable) - { - return ((TextEditorStyle)bindable).inputFontFamily; - } - - /// The bindable property of InputPointSize. - [EditorBrowsable(EditorBrowsableState.Never)] - internal static readonly BindableProperty InputPointSizeProperty = null; - internal static void SetInternalInputPointSizeProperty(BindableObject bindable, object oldValue, object newValue) - { - ((TextEditorStyle)bindable).inputPointSize = (float?)newValue; - } - internal static object GetInternalInputPointSizeProperty(BindableObject bindable) - { - return ((TextEditorStyle)bindable).inputPointSize; - } - - /// The bindable property of InputUnderline. - [EditorBrowsable(EditorBrowsableState.Never)] - internal static readonly BindableProperty InputUnderlineProperty = null; - internal static void SetInternalInputUnderlineProperty(BindableObject bindable, object oldValue, object newValue) - { - ((TextEditorStyle)bindable).inputUnderline = (string)newValue; - } - internal static object GetInternalInputUnderlineProperty(BindableObject bindable) - { - return ((TextEditorStyle)bindable).inputUnderline; - } - - /// The bindable property of InputShadow. - [EditorBrowsable(EditorBrowsableState.Never)] - internal static readonly BindableProperty InputShadowProperty = null; - internal static void SetInternalInputShadowProperty(BindableObject bindable, object oldValue, object newValue) - { - ((TextEditorStyle)bindable).inputShadow = (string)newValue; - } - internal static object GetInternalInputShadowProperty(BindableObject bindable) - { - return ((TextEditorStyle)bindable).inputShadow; - } - - /// The bindable property of Emboss. - [EditorBrowsable(EditorBrowsableState.Never)] - internal static readonly BindableProperty EmbossProperty = null; - internal static void SetInternalEmbossProperty(BindableObject bindable, object oldValue, object newValue) - { - ((TextEditorStyle)bindable).emboss = (string)newValue; - } - internal static object GetInternalEmbossProperty(BindableObject bindable) - { - return ((TextEditorStyle)bindable).emboss; - } - - /// The bindable property of InputEmboss. - [EditorBrowsable(EditorBrowsableState.Never)] - internal static readonly BindableProperty InputEmbossProperty = null; - internal static void SetInternalInputEmbossProperty(BindableObject bindable, object oldValue, object newValue) - { - ((TextEditorStyle)bindable).inputEmboss = (string)newValue; - } - internal static object GetInternalInputEmbossProperty(BindableObject bindable) - { - return ((TextEditorStyle)bindable).inputEmboss; - } - - /// The bindable property of InputOutline. - [EditorBrowsable(EditorBrowsableState.Never)] - internal static readonly BindableProperty InputOutlineProperty = null; - internal static void SetInternalInputOutlineProperty(BindableObject bindable, object oldValue, object newValue) - { - ((TextEditorStyle)bindable).inputOutline = (string)newValue; - } - internal static object GetInternalInputOutlineProperty(BindableObject bindable) - { - return ((TextEditorStyle)bindable).inputOutline; - } - - /// The bindable property of SmoothScroll. - [EditorBrowsable(EditorBrowsableState.Never)] - internal static readonly BindableProperty SmoothScrollProperty = null; - internal static void SetInternalSmoothScrollProperty(BindableObject bindable, object oldValue, object newValue) - { - ((TextEditorStyle)bindable).smoothScroll = (bool?)newValue; - } - internal static object GetInternalSmoothScrollProperty(BindableObject bindable) - { - return ((TextEditorStyle)bindable).smoothScroll; - } - - /// The bindable property of SmoothScrollDuration. - [EditorBrowsable(EditorBrowsableState.Never)] - internal static readonly BindableProperty SmoothScrollDurationProperty = null; - internal static void SetInternalSmoothScrollDurationProperty(BindableObject bindable, object oldValue, object newValue) - { - ((TextEditorStyle)bindable).smoothScrollDuration = (float?)newValue; - } - internal static object GetInternalSmoothScrollDurationProperty(BindableObject bindable) - { - return ((TextEditorStyle)bindable).smoothScrollDuration; - } - - /// The bindable property of EnableScrollBar. - [EditorBrowsable(EditorBrowsableState.Never)] - internal static readonly BindableProperty EnableScrollBarProperty = null; - internal static void SetInternalEnableScrollBarProperty(BindableObject bindable, object oldValue, object newValue) - { - ((TextEditorStyle)bindable).enableScrollBar = (bool?)newValue; - } - internal static object GetInternalEnableScrollBarProperty(BindableObject bindable) - { - return ((TextEditorStyle)bindable).enableScrollBar; - } - - /// The bindable property of ScrollBarShowDuration. - [EditorBrowsable(EditorBrowsableState.Never)] - internal static readonly BindableProperty ScrollBarShowDurationProperty = null; - internal static void SetInternalScrollBarShowDurationProperty(BindableObject bindable, object oldValue, object newValue) - { - ((TextEditorStyle)bindable).scrollBarShowDuration = (float?)newValue; - } - internal static object GetInternalScrollBarShowDurationProperty(BindableObject bindable) - { - return ((TextEditorStyle)bindable).scrollBarShowDuration; - } - - /// The bindable property of ScrollBarFadeDuration. - [EditorBrowsable(EditorBrowsableState.Never)] - internal static readonly BindableProperty ScrollBarFadeDurationProperty = null; - internal static void SetInternalScrollBarFadeDurationProperty(BindableObject bindable, object oldValue, object newValue) - { - ((TextEditorStyle)bindable).scrollBarFadeDuration = (float?)newValue; - } - internal static object GetInternalScrollBarFadeDurationProperty(BindableObject bindable) - { - return ((TextEditorStyle)bindable).scrollBarFadeDuration; - } - - /// The bindable property of EnableSelection. - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty EnableSelectionProperty = null; - internal static void SetInternalEnableSelectionProperty(BindableObject bindable, object oldValue, object newValue) - { - ((TextEditorStyle)bindable).enableSelection = (bool?)newValue; - } - internal static object GetInternalEnableSelectionProperty(BindableObject bindable) - { - return ((TextEditorStyle)bindable).enableSelection; - } - - /// The bindable property of MatchSystemLanguageDirection. - [EditorBrowsable(EditorBrowsableState.Never)] - internal static readonly BindableProperty MatchSystemLanguageDirectionProperty = null; - internal static void SetInternalMatchSystemLanguageDirectionProperty(BindableObject bindable, object oldValue, object newValue) - { - ((TextEditorStyle)bindable).matchSystemLanguageDirection = (bool?)newValue; - } - internal static object GetInternalMatchSystemLanguageDirectionProperty(BindableObject bindable) - { - return ((TextEditorStyle)bindable).matchSystemLanguageDirection; - } - - /// The bindable property of FontStyleProperty. - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty FontStyleProperty = null; - internal static void SetInternalFontStyleProperty(BindableObject bindable, object oldValue, object newValue) - { - ((TextEditorStyle)bindable).fontStyle = (PropertyMap)newValue; - } - internal static object GetInternalFontStyleProperty(BindableObject bindable) - { - return ((TextEditorStyle)bindable).fontStyle; - } - - /// 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 static readonly BindableProperty EllipsisProperty = null; - internal static void SetInternalEllipsisProperty(BindableObject bindable, object oldValue, object newValue) - { - var textEditorStyle = (TextEditorStyle)bindable; - textEditorStyle.ellipsis = (bool?)newValue; - } - internal static object GetInternalEllipsisProperty(BindableObject bindable) - { - var textEditorStyle = (TextEditorStyle)bindable; - return textEditorStyle.ellipsis; - } - - /// The bindable property of LineSpacingProperty. - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty LineSpacingProperty = null; - internal static void SetInternalLineSpacingProperty(BindableObject bindable, object oldValue, object newValue) - { - var textEditorStyle = (TextEditorStyle)bindable; - textEditorStyle.lineSpacing = (float?)newValue; - } - internal static object GetInternalLineSpacingProperty(BindableObject bindable) - { - var textEditorStyle = (TextEditorStyle)bindable; - return textEditorStyle.lineSpacing; - } - - /// The bindable property of MinLineSizeProperty. - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty MinLineSizeProperty = null; - internal static void SetInternalMinLineSizeProperty(BindableObject bindable, object oldValue, object newValue) - { - var textEditorStyle = (TextEditorStyle)bindable; - textEditorStyle.minLineSize = (float?)newValue; - } - internal static object GetInternalMinLineSizeProperty(BindableObject bindable) - { - var textEditorStyle = (TextEditorStyle)bindable; - return textEditorStyle.minLineSize; - } - - /// The bindable property of RelativeLineHeightProperty. - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty RelativeLineHeightProperty = null; - internal static void SetInternalRelativeLineHeightProperty(BindableObject bindable, object oldValue, object newValue) - { - var textEditorStyle = (TextEditorStyle)bindable; - textEditorStyle.relativeLineHeight = (float?)newValue; - } - internal static object GetInternalRelativeLineHeightProperty(BindableObject bindable) - { - var textEditorStyle = (TextEditorStyle)bindable; - return textEditorStyle.relativeLineHeight; - } - - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty FontSizeScaleProperty = null; - internal static void SetInternalFontSizeScaleProperty(BindableObject bindable, object oldValue, object newValue) - { - var textEditorStyle = (TextEditorStyle)bindable; - textEditorStyle.fontSizeScale = (float?)newValue; - } - internal static object GetInternalFontSizeScaleProperty(BindableObject bindable) - { - var textEditorStyle = (TextEditorStyle)bindable; - return textEditorStyle.fontSizeScale; - } - - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty SelectionPopupStyleProperty = null; - internal static void SetInternalSelectionPopupStyleProperty(BindableObject bindable, object oldValue, object newValue) - { - var textEditorStyle = (TextEditorStyle)bindable; - textEditorStyle.selectionPopupStyle = (PropertyMap)newValue; - } - internal static object GetInternalSelectionPopupStyleProperty(BindableObject bindable) - { - var textEditorStyle = (TextEditorStyle)bindable; - return textEditorStyle.selectionPopupStyle; - } - - private HorizontalAlignment? horizontalAlignment; - private VerticalAlignment? verticalAlignment; - private Vector4 secondaryCursorColor; - private bool? enableCursorBlink; - private float? cursorBlinkInterval; - private float? cursorBlinkDuration; - private int? cursorWidth; - private Color grabHandleColor; - private string grabHandleImage; - private string grabHandlePressedImage; - private PropertyMap selectionHandleImageLeft; - private PropertyMap selectionHandleImageRight; - private float? scrollThreshold; - private float? scrollSpeed; - private Vector4 selectionHighlightColor; - private Rectangle decorationBoundingBox; - private Vector4 inputColor; - private string inputFontFamily; - private float? inputPointSize; - private string inputUnderline; - private string inputShadow; - private string emboss; - private string inputEmboss; - private string inputOutline; - private bool? smoothScroll; - private float? smoothScrollDuration; - private bool? enableScrollBar; - private float? scrollBarShowDuration; - private float? scrollBarFadeDuration; - private float? pixelSize; - private bool? enableSelection; - private bool? matchSystemLanguageDirection; - private string fontFamily; - private Vector4 textColor; - private float? pointSize; - private Color placeholderTextColor; - private Vector4 primaryCursorColor; - private PropertyMap fontStyle; - private PropertyMap selectionPopupStyle; - private bool? ellipsis; - private float? lineSpacing; - private float? minLineSize; - private float? relativeLineHeight; - private float? fontSizeScale; - - static TextEditorStyle() - { - if (NUIApplication.IsUsingXaml) - { - FontFamilyProperty = BindableProperty.Create(nameof(FontFamily), typeof(string), typeof(TextEditorStyle), null, - propertyChanged: SetInternalFontFamilyProperty, defaultValueCreator: GetInternalFontFamilyProperty); - PointSizeProperty = BindableProperty.Create(nameof(PointSize), typeof(float?), typeof(TextEditorStyle), null, - propertyChanged: SetInternalPointSizeProperty, defaultValueCreator: GetInternalPointSizeProperty); - PixelSizeProperty = BindableProperty.Create(nameof(PixelSize), typeof(float?), typeof(TextEditorStyle), null, - propertyChanged: SetInternalPixelSizeProperty, defaultValueCreator: GetInternalPixelSizeProperty); - TextColorProperty = BindableProperty.Create(nameof(TextColor), typeof(Vector4), typeof(TextEditorStyle), null, - propertyChanged: SetInternalTextColorProperty, defaultValueCreator: GetInternalTextColorProperty); - PlaceholderTextColorProperty = BindableProperty.Create(nameof(PlaceholderTextColor), typeof(Color), typeof(TextEditorStyle), null, - propertyChanged: SetInternalPlaceholderTextColorProperty, defaultValueCreator: GetInternalPlaceholderTextColorProperty); - PrimaryCursorColorProperty = BindableProperty.Create(nameof(PrimaryCursorColor), typeof(Vector4), typeof(TextEditorStyle), null, - propertyChanged: SetInternalPrimaryCursorColorProperty, defaultValueCreator: GetInternalPrimaryCursorColorProperty); - HorizontalAlignmentProperty = BindableProperty.Create(nameof(HorizontalAlignment), typeof(HorizontalAlignment?), typeof(TextEditorStyle), null, - propertyChanged: SetInternalHorizontalAlignmentProperty, defaultValueCreator: GetInternalHorizontalAlignmentProperty); - VerticalAlignmentProperty = BindableProperty.Create(nameof(VerticalAlignment), typeof(VerticalAlignment?), typeof(TextEditorStyle), null, - propertyChanged: SetInternalVerticalAlignmentProperty, defaultValueCreator: GetInternalVerticalAlignmentProperty); - SecondaryCursorColorProperty = BindableProperty.Create(nameof(SecondaryCursorColor), typeof(Vector4), typeof(TextEditorStyle), null, - propertyChanged: SetInternalSecondaryCursorColorProperty,defaultValueCreator: GetInternalSecondaryCursorColorProperty); - EnableCursorBlinkProperty = BindableProperty.Create(nameof(EnableCursorBlink), typeof(bool?), typeof(TextEditorStyle), null, - propertyChanged: SetInternalEnableCursorBlinkProperty, defaultValueCreator: GetInternalEnableCursorBlinkProperty); - CursorBlinkIntervalProperty = BindableProperty.Create(nameof(CursorBlinkInterval), typeof(float?), typeof(TextEditorStyle), null, - propertyChanged: SetInternalCursorBlinkIntervalProperty, defaultValueCreator: GetInternalCursorBlinkIntervalProperty); - CursorBlinkDurationProperty = BindableProperty.Create(nameof(CursorBlinkDuration), typeof(float?), typeof(TextEditorStyle), null, - propertyChanged: SetInternalCursorBlinkDurationProperty, defaultValueCreator: GetInternalCursorBlinkDurationProperty); - CursorWidthProperty = BindableProperty.Create(nameof(CursorWidth), typeof(int?), typeof(TextEditorStyle), null, - propertyChanged: SetInternalCursorWidthProperty, defaultValueCreator: GetInternalCursorWidthProperty); - GrabHandleColorProperty = BindableProperty.Create(nameof(GrabHandleColor), typeof(Color), typeof(TextEditorStyle), null, - propertyChanged: SetInternalGrabHandleColorProperty, defaultValueCreator: GetInternalGrabHandleColorProperty); - GrabHandleImageProperty = BindableProperty.Create(nameof(GrabHandleImage), typeof(string), typeof(TextEditorStyle), String.Empty, - propertyChanged: SetInternalGrabHandleImageProperty, defaultValueCreator: GetInternalGrabHandleImageProperty); - GrabHandlePressedImageProperty = BindableProperty.Create(nameof(GrabHandlePressedImage), typeof(string), typeof(TextEditorStyle), String.Empty, - propertyChanged: SetInternalGrabHandlePressedImageProperty, defaultValueCreator: GetInternalGrabHandlePressedImageProperty); - SelectionHandleImageLeftProperty = BindableProperty.Create(nameof(SelectionHandleImageLeft), typeof(PropertyMap), typeof(TextEditorStyle), null, - propertyChanged: SetInternalSelectionHandleImageLeftProperty, defaultValueCreator: GetInternalSelectionHandleImageLeftProperty); - SelectionHandleImageRightProperty = BindableProperty.Create(nameof(SelectionHandleImageRight), typeof(PropertyMap), typeof(TextEditorStyle), null, - propertyChanged: SetInternalSelectionHandleImageRightProperty, defaultValueCreator: GetInternalSelectionHandleImageRightProperty); - ScrollThresholdProperty = BindableProperty.Create(nameof(ScrollThreshold), typeof(float?), typeof(TextEditorStyle), null, - propertyChanged: SetInternalScrollThresholdProperty, defaultValueCreator: GetInternalScrollThresholdProperty); - ScrollSpeedProperty = BindableProperty.Create(nameof(ScrollSpeed), typeof(float?), typeof(TextEditorStyle), null, - propertyChanged: SetInternalScrollSpeedProperty, defaultValueCreator: GetInternalScrollSpeedProperty); - SelectionHighlightColorProperty = BindableProperty.Create(nameof(SelectionHighlightColor), typeof(Vector4), typeof(TextEditorStyle), null, - propertyChanged: SetInternalSelectionHighlightColorProperty, defaultValueCreator: GetInternalSelectionHighlightColorProperty); - DecorationBoundingBoxProperty = BindableProperty.Create(nameof(DecorationBoundingBox), typeof(Rectangle), typeof(TextEditorStyle), null, - propertyChanged: SetInternalDecorationBoundingBoxProperty, defaultValueCreator: GetInternalDecorationBoundingBoxProperty); - InputColorProperty = BindableProperty.Create(nameof(InputColor), typeof(Vector4), typeof(TextEditorStyle), null, - propertyChanged: SetInternalInputColorProperty, defaultValueCreator: GetInternalInputColorProperty); - InputFontFamilyProperty = BindableProperty.Create(nameof(InputFontFamily), typeof(string), typeof(TextEditorStyle), String.Empty, - propertyChanged: SetInternalInputFontFamilyProperty, defaultValueCreator: GetInternalInputFontFamilyProperty); - InputPointSizeProperty = BindableProperty.Create(nameof(InputPointSize), typeof(float?), typeof(TextEditorStyle), null, - propertyChanged: SetInternalInputPointSizeProperty, defaultValueCreator: GetInternalInputPointSizeProperty); - InputUnderlineProperty = BindableProperty.Create(nameof(InputUnderline), typeof(string), typeof(TextEditorStyle), String.Empty, - propertyChanged: SetInternalInputUnderlineProperty, defaultValueCreator: GetInternalInputUnderlineProperty); - InputShadowProperty = BindableProperty.Create(nameof(InputShadow), typeof(string), typeof(TextEditorStyle), String.Empty, - propertyChanged: SetInternalInputShadowProperty, defaultValueCreator: GetInternalInputShadowProperty); - EmbossProperty = BindableProperty.Create(nameof(Emboss), typeof(string), typeof(TextEditorStyle), String.Empty, - propertyChanged: SetInternalEmbossProperty, defaultValueCreator: GetInternalEmbossProperty); - InputEmbossProperty = BindableProperty.Create(nameof(InputEmboss), typeof(string), typeof(TextEditorStyle), String.Empty, - propertyChanged: SetInternalInputEmbossProperty, defaultValueCreator: GetInternalInputEmbossProperty); - InputOutlineProperty = BindableProperty.Create(nameof(InputOutline), typeof(string), typeof(TextEditorStyle), String.Empty, - propertyChanged: SetInternalInputOutlineProperty, defaultValueCreator: GetInternalInputOutlineProperty); - SmoothScrollProperty = BindableProperty.Create(nameof(SmoothScroll), typeof(bool?), typeof(TextEditorStyle), null, - propertyChanged: SetInternalSmoothScrollProperty, defaultValueCreator: GetInternalSmoothScrollProperty); - SmoothScrollDurationProperty = BindableProperty.Create(nameof(SmoothScrollDuration), typeof(float?), typeof(TextEditorStyle), null, - propertyChanged: SetInternalSmoothScrollDurationProperty, defaultValueCreator: GetInternalSmoothScrollDurationProperty); - EnableScrollBarProperty = BindableProperty.Create(nameof(EnableScrollBar), typeof(bool?), typeof(TextEditorStyle), null, - propertyChanged: SetInternalEnableScrollBarProperty, defaultValueCreator: GetInternalEnableScrollBarProperty); - ScrollBarShowDurationProperty = BindableProperty.Create(nameof(ScrollBarShowDuration), typeof(float?), typeof(TextEditorStyle), null, - propertyChanged: SetInternalScrollBarShowDurationProperty, defaultValueCreator: GetInternalScrollBarShowDurationProperty); - ScrollBarFadeDurationProperty = BindableProperty.Create(nameof(ScrollBarFadeDuration), typeof(float?), typeof(TextEditorStyle), null, - propertyChanged: SetInternalScrollBarFadeDurationProperty, defaultValueCreator: GetInternalScrollBarFadeDurationProperty); - EnableSelectionProperty = BindableProperty.Create(nameof(EnableSelection), typeof(bool?), typeof(TextEditorStyle), null, - propertyChanged: SetInternalEnableSelectionProperty, defaultValueCreator: GetInternalEnableSelectionProperty); - MatchSystemLanguageDirectionProperty = BindableProperty.Create(nameof(MatchSystemLanguageDirection), typeof(bool?), typeof(TextEditorStyle), null, - propertyChanged: SetInternalMatchSystemLanguageDirectionProperty, defaultValueCreator: GetInternalMatchSystemLanguageDirectionProperty); - FontStyleProperty = BindableProperty.Create(nameof(FontStyle), typeof(PropertyMap), typeof(TextEditorStyle), null, - propertyChanged: SetInternalFontStyleProperty, defaultValueCreator: GetInternalFontStyleProperty); - EllipsisProperty = BindableProperty.Create(nameof(Ellipsis), typeof(bool?), typeof(TextEditorStyle), null, - propertyChanged: SetInternalEllipsisProperty, defaultValueCreator: GetInternalEllipsisProperty); - LineSpacingProperty = BindableProperty.Create(nameof(LineSpacing), typeof(float?), typeof(TextEditorStyle), null, - propertyChanged: SetInternalLineSpacingProperty, defaultValueCreator: GetInternalLineSpacingProperty); - MinLineSizeProperty = BindableProperty.Create(nameof(MinLineSize), typeof(float?), typeof(TextEditorStyle), null, - propertyChanged: SetInternalMinLineSizeProperty, defaultValueCreator: GetInternalMinLineSizeProperty); - RelativeLineHeightProperty = BindableProperty.Create(nameof(RelativeLineHeight), typeof(float?), typeof(TextEditorStyle), null, - propertyChanged: SetInternalRelativeLineHeightProperty, defaultValueCreator: GetInternalRelativeLineHeightProperty); - FontSizeScaleProperty = BindableProperty.Create(nameof(FontSizeScale), typeof(float?), typeof(TextEditorStyle), null, - propertyChanged: SetInternalFontSizeScaleProperty, defaultValueCreator: GetInternalFontSizeScaleProperty); - SelectionPopupStyleProperty = BindableProperty.Create(nameof(SelectionPopupStyle), typeof(PropertyMap), typeof(TextEditorStyle), null, - propertyChanged: SetInternalSelectionPopupStyleProperty, defaultValueCreator: GetInternalSelectionPopupStyleProperty); - } - } + static readonly IStyleProperty FontFamilyProperty = new StyleProperty((v, o) => v.FontFamily = o); + static readonly IStyleProperty HorizontalAlignmentProperty = new StyleProperty((v, o) => v.HorizontalAlignment = o); + static readonly IStyleProperty VerticalAlignmentProperty = new StyleProperty((v, o) => v.VerticalAlignment = o); + static readonly IStyleProperty SecondaryCursorColorProperty = new StyleProperty((v, o) => v.SecondaryCursorColor = o); + static readonly IStyleProperty EnableCursorBlinkProperty = new StyleProperty((v, o) => v.EnableCursorBlink = o); + static readonly IStyleProperty CursorBlinkIntervalProperty = new StyleProperty((v, o) => v.CursorBlinkInterval = o); + static readonly IStyleProperty CursorBlinkDurationProperty = new StyleProperty((v, o) => v.CursorBlinkDuration = o); + static readonly IStyleProperty CursorWidthProperty = new StyleProperty((v, o) => v.CursorWidth = o); + static readonly IStyleProperty GrabHandleColorProperty = new StyleProperty((v, o) => v.GrabHandleColor = o); + static readonly IStyleProperty GrabHandleImageProperty = new StyleProperty((v, o) => v.GrabHandleImage = o); + static readonly IStyleProperty GrabHandlePressedImageProperty = new StyleProperty((v, o) => v.GrabHandlePressedImage = o); + static readonly IStyleProperty SelectionHandleImageLeftProperty = new StyleProperty((v, o) => v.SelectionHandleImageLeft = o); + static readonly IStyleProperty SelectionHandleImageRightProperty = new StyleProperty((v, o) => v.SelectionHandleImageRight = o); + static readonly IStyleProperty ScrollThresholdProperty = new StyleProperty((v, o) => v.ScrollThreshold = o); + static readonly IStyleProperty ScrollSpeedProperty = new StyleProperty((v, o) => v.ScrollSpeed = o); + static readonly IStyleProperty SelectionHighlightColorProperty = new StyleProperty((v, o) => v.SelectionHighlightColor = o); + static readonly IStyleProperty DecorationBoundingBoxProperty = new StyleProperty((v, o) => v.DecorationBoundingBox = o); + static readonly IStyleProperty InputColorProperty = new StyleProperty((v, o) => v.InputColor = o); + static readonly IStyleProperty InputFontFamilyProperty = new StyleProperty((v, o) => v.InputFontFamily = o); + static readonly IStyleProperty InputPointSizeProperty = new StyleProperty((v, o) => v.InputPointSize = o); + static readonly IStyleProperty InputUnderlineProperty = new StyleProperty((v, o) => v.InputUnderline = o); + static readonly IStyleProperty InputShadowProperty = new StyleProperty((v, o) => v.InputShadow = o); + static readonly IStyleProperty EmbossProperty = new StyleProperty((v, o) => v.Emboss = o); + static readonly IStyleProperty InputEmbossProperty = new StyleProperty((v, o) => v.InputEmboss = o); + static readonly IStyleProperty InputOutlineProperty = new StyleProperty((v, o) => v.InputOutline = o); + static readonly IStyleProperty SmoothScrollProperty = new StyleProperty((v, o) => v.SmoothScroll = o); + static readonly IStyleProperty SmoothScrollDurationProperty = new StyleProperty((v, o) => v.SmoothScrollDuration = o); + static readonly IStyleProperty EnableScrollBarProperty = new StyleProperty((v, o) => v.EnableScrollBar = o); + static readonly IStyleProperty ScrollBarShowDurationProperty = new StyleProperty((v, o) => v.ScrollBarShowDuration = o); + static readonly IStyleProperty ScrollBarFadeDurationProperty = new StyleProperty((v, o) => v.ScrollBarFadeDuration = o); + static readonly IStyleProperty PixelSizeProperty = new StyleProperty((v, o) => v.PixelSize = o); + static readonly IStyleProperty EnableSelectionProperty = new StyleProperty((v, o) => v.EnableSelection = o); + static readonly IStyleProperty MatchSystemLanguageDirectionProperty = new StyleProperty((v, o) => v.MatchSystemLanguageDirection = o); + static readonly IStyleProperty TextColorProperty = new StyleProperty((v, o) => v.TextColor = o); + static readonly IStyleProperty PointSizeProperty = new StyleProperty((v, o) => v.PointSize = o); + static readonly IStyleProperty PlaceholderTextColorProperty = new StyleProperty((v, o) => v.PlaceholderTextColor = o); + static readonly IStyleProperty PrimaryCursorColorProperty = new StyleProperty((v, o) => v.PrimaryCursorColor = o); + static readonly IStyleProperty FontStyleProperty = new StyleProperty((v, o) => v.FontStyle = o); + static readonly IStyleProperty EllipsisProperty = new StyleProperty((v, o) => v.Ellipsis = o); + static readonly IStyleProperty LineSpacingProperty = new StyleProperty((v, o) => v.LineSpacing = o); + static readonly IStyleProperty MinLineSizeProperty = new StyleProperty((v, o) => v.MinLineSize = o); + static readonly IStyleProperty RelativeLineHeightProperty = new StyleProperty((v, o) => v.RelativeLineHeight = o); + static readonly IStyleProperty FontSizeScaleProperty = new StyleProperty((v, o) => v.FontSizeScale = o); + static readonly IStyleProperty SelectionPopupStyleProperty = new StyleProperty((v, o) => v.SelectionPopupStyle = o); + + static TextEditorStyle() { } /// /// Create an empty instance. @@ -719,28 +88,8 @@ public TextEditorStyle() : base() [EditorBrowsable(EditorBrowsableState.Never)] public string FontFamily { - get - { - if (NUIApplication.IsUsingXaml) - { - return (string)GetValue(FontFamilyProperty); - } - else - { - return (string)GetInternalFontFamilyProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(FontFamilyProperty, value); - } - else - { - SetInternalFontFamilyProperty(this, null, value); - } - } + get => (string)GetValue(FontFamilyProperty); + set => SetValue(FontFamilyProperty, value); } /// @@ -749,28 +98,8 @@ public string FontFamily [EditorBrowsable(EditorBrowsableState.Never)] public HorizontalAlignment? HorizontalAlignment { - get - { - if (NUIApplication.IsUsingXaml) - { - return (HorizontalAlignment?)GetValue(HorizontalAlignmentProperty); - } - else - { - return (HorizontalAlignment?)GetInternalHorizontalAlignmentProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(HorizontalAlignmentProperty, value); - } - else - { - SetInternalHorizontalAlignmentProperty(this, null, value); - } - } + get => (HorizontalAlignment?)GetValue(HorizontalAlignmentProperty); + set => SetValue(HorizontalAlignmentProperty, value); } /// @@ -779,28 +108,8 @@ public HorizontalAlignment? HorizontalAlignment [EditorBrowsable(EditorBrowsableState.Never)] public VerticalAlignment? VerticalAlignment { - get - { - if (NUIApplication.IsUsingXaml) - { - return (VerticalAlignment?)GetValue(VerticalAlignmentProperty); - } - else - { - return (VerticalAlignment?)GetInternalVerticalAlignmentProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(VerticalAlignmentProperty, value); - } - else - { - SetInternalVerticalAlignmentProperty(this, null, value); - } - } + get => (VerticalAlignment?)GetValue(VerticalAlignmentProperty); + set => SetValue(VerticalAlignmentProperty, value); } /// @@ -810,28 +119,8 @@ public VerticalAlignment? VerticalAlignment [EditorBrowsable(EditorBrowsableState.Never)] public Vector4 SecondaryCursorColor { - get - { - if (NUIApplication.IsUsingXaml) - { - return (Vector4)GetValue(SecondaryCursorColorProperty); - } - else - { - return (Vector4)GetInternalSecondaryCursorColorProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(SecondaryCursorColorProperty, value); - } - else - { - SetInternalSecondaryCursorColorProperty(this, null, value); - } - } + get => (Vector4)GetValue(SecondaryCursorColorProperty); + set => SetValue(SecondaryCursorColorProperty, value); } /// @@ -840,28 +129,8 @@ public Vector4 SecondaryCursorColor [EditorBrowsable(EditorBrowsableState.Never)] public bool? EnableCursorBlink { - get - { - if (NUIApplication.IsUsingXaml) - { - return (bool?)GetValue(EnableCursorBlinkProperty); - } - else - { - return (bool?)GetInternalEnableCursorBlinkProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(EnableCursorBlinkProperty, value); - } - else - { - SetInternalEnableCursorBlinkProperty(this, null, value); - } - } + get => (bool?)GetValue(EnableCursorBlinkProperty); + set => SetValue(EnableCursorBlinkProperty, value); } /// @@ -870,28 +139,8 @@ public bool? EnableCursorBlink [EditorBrowsable(EditorBrowsableState.Never)] public float? CursorBlinkInterval { - get - { - if (NUIApplication.IsUsingXaml) - { - return (float?)GetValue(CursorBlinkIntervalProperty); - } - else - { - return (float?)GetInternalCursorBlinkIntervalProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(CursorBlinkIntervalProperty, value); - } - else - { - SetInternalCursorBlinkIntervalProperty(this, null, value); - } - } + get => (float?)GetValue(CursorBlinkIntervalProperty); + set => SetValue(CursorBlinkIntervalProperty, value); } /// @@ -900,28 +149,8 @@ public float? CursorBlinkInterval [EditorBrowsable(EditorBrowsableState.Never)] public float? CursorBlinkDuration { - get - { - if (NUIApplication.IsUsingXaml) - { - return (float?)GetValue(CursorBlinkDurationProperty); - } - else - { - return (float?)GetInternalCursorBlinkDurationProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(CursorBlinkDurationProperty, value); - } - else - { - SetInternalCursorBlinkDurationProperty(this, null, value); - } - } + get => (float?)GetValue(CursorBlinkDurationProperty); + set => SetValue(CursorBlinkDurationProperty, value); } /// @@ -930,28 +159,8 @@ public float? CursorBlinkDuration [EditorBrowsable(EditorBrowsableState.Never)] public int? CursorWidth { - get - { - if (NUIApplication.IsUsingXaml) - { - return (int?)GetValue(CursorWidthProperty); - } - else - { - return (int?)GetInternalCursorWidthProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(CursorWidthProperty, value); - } - else - { - SetInternalCursorWidthProperty(this, null, value); - } - } + get => (int?)GetValue(CursorWidthProperty); + set => SetValue(CursorWidthProperty, value); } /// @@ -960,28 +169,8 @@ public int? CursorWidth [EditorBrowsable(EditorBrowsableState.Never)] public Color GrabHandleColor { - get - { - if (NUIApplication.IsUsingXaml) - { - return (Color)GetValue(GrabHandleColorProperty); - } - else - { - return (Color)GetInternalGrabHandleColorProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(GrabHandleColorProperty, value); - } - else - { - SetInternalGrabHandleColorProperty(this, null, value); - } - } + get => (Color)GetValue(GrabHandleColorProperty); + set => SetValue(GrabHandleColorProperty, value); } /// @@ -990,28 +179,8 @@ public Color GrabHandleColor [EditorBrowsable(EditorBrowsableState.Never)] public string GrabHandleImage { - get - { - if (NUIApplication.IsUsingXaml) - { - return (string)GetValue(GrabHandleImageProperty); - } - else - { - return (string)GetInternalGrabHandleImageProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(GrabHandleImageProperty, value); - } - else - { - SetInternalGrabHandleImageProperty(this, null, value); - } - } + get => (string)GetValue(GrabHandleImageProperty); + set => SetValue(GrabHandleImageProperty, value); } /// @@ -1020,28 +189,8 @@ public string GrabHandleImage [EditorBrowsable(EditorBrowsableState.Never)] public string GrabHandlePressedImage { - get - { - if (NUIApplication.IsUsingXaml) - { - return (string)GetValue(GrabHandlePressedImageProperty); - } - else - { - return (string)GetInternalGrabHandlePressedImageProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(GrabHandlePressedImageProperty, value); - } - else - { - SetInternalGrabHandlePressedImageProperty(this, null, value); - } - } + get => (string)GetValue(GrabHandlePressedImageProperty); + set => SetValue(GrabHandlePressedImageProperty, value); } /// @@ -1050,28 +199,8 @@ public string GrabHandlePressedImage [EditorBrowsable(EditorBrowsableState.Never)] public PropertyMap SelectionHandleImageLeft { - get - { - if (NUIApplication.IsUsingXaml) - { - return (PropertyMap)GetValue(SelectionHandleImageLeftProperty); - } - else - { - return (PropertyMap)GetInternalSelectionHandleImageLeftProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(SelectionHandleImageLeftProperty, value); - } - else - { - SetInternalSelectionHandleImageLeftProperty(this, null, value); - } - } + get => (PropertyMap)GetValue(SelectionHandleImageLeftProperty); + set => SetValue(SelectionHandleImageLeftProperty, value); } /// @@ -1080,28 +209,8 @@ public PropertyMap SelectionHandleImageLeft [EditorBrowsable(EditorBrowsableState.Never)] public PropertyMap SelectionHandleImageRight { - get - { - if (NUIApplication.IsUsingXaml) - { - return (PropertyMap)GetValue(SelectionHandleImageRightProperty); - } - else - { - return (PropertyMap)GetInternalSelectionHandleImageRightProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(SelectionHandleImageRightProperty, value); - } - else - { - SetInternalSelectionHandleImageRightProperty(this, null, value); - } - } + get => (PropertyMap)GetValue(SelectionHandleImageRightProperty); + set => SetValue(SelectionHandleImageRightProperty, value); } /// @@ -1110,28 +219,8 @@ public PropertyMap SelectionHandleImageRight [EditorBrowsable(EditorBrowsableState.Never)] public float? ScrollThreshold { - get - { - if (NUIApplication.IsUsingXaml) - { - return (float?)GetValue(ScrollThresholdProperty); - } - else - { - return (float?)GetInternalScrollThresholdProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(ScrollThresholdProperty, value); - } - else - { - SetInternalScrollThresholdProperty(this, null, value); - } - } + get => (float?)GetValue(ScrollThresholdProperty); + set => SetValue(ScrollThresholdProperty, value); } /// @@ -1140,28 +229,8 @@ public float? ScrollThreshold [EditorBrowsable(EditorBrowsableState.Never)] public float? ScrollSpeed { - get - { - if (NUIApplication.IsUsingXaml) - { - return (float?)GetValue(ScrollSpeedProperty); - } - else - { - return (float?)GetInternalScrollSpeedProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(ScrollSpeedProperty, value); - } - else - { - SetInternalScrollSpeedProperty(this, null, value); - } - } + get => (float?)GetValue(ScrollSpeedProperty); + set => SetValue(ScrollSpeedProperty, value); } /// @@ -1171,28 +240,8 @@ public float? ScrollSpeed [EditorBrowsable(EditorBrowsableState.Never)] public Vector4 SelectionHighlightColor { - get - { - if (NUIApplication.IsUsingXaml) - { - return (Vector4)GetValue(SelectionHighlightColorProperty); - } - else - { - return (Vector4)GetInternalSelectionHighlightColorProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(SelectionHighlightColorProperty, value); - } - else - { - SetInternalSelectionHighlightColorProperty(this, null, value); - } - } + get => (Vector4)GetValue(SelectionHighlightColorProperty); + set => SetValue(SelectionHighlightColorProperty, value); } /// @@ -1202,28 +251,8 @@ public Vector4 SelectionHighlightColor [EditorBrowsable(EditorBrowsableState.Never)] public Rectangle DecorationBoundingBox { - get - { - if (NUIApplication.IsUsingXaml) - { - return (Rectangle)GetValue(DecorationBoundingBoxProperty); - } - else - { - return (Rectangle)GetInternalDecorationBoundingBoxProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(DecorationBoundingBoxProperty, value); - } - else - { - SetInternalDecorationBoundingBoxProperty(this, null, value); - } - } + get => (Rectangle)GetValue(DecorationBoundingBoxProperty); + set => SetValue(DecorationBoundingBoxProperty, value); } /// @@ -1233,28 +262,8 @@ public Rectangle DecorationBoundingBox [EditorBrowsable(EditorBrowsableState.Never)] public Vector4 InputColor { - get - { - if (NUIApplication.IsUsingXaml) - { - return (Vector4)GetValue(InputColorProperty); - } - else - { - return (Vector4)GetInternalInputColorProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(InputColorProperty, value); - } - else - { - SetInternalInputColorProperty(this, null, value); - } - } + get => (Vector4)GetValue(InputColorProperty); + set => SetValue(InputColorProperty, value); } /// @@ -1263,28 +272,8 @@ public Vector4 InputColor [EditorBrowsable(EditorBrowsableState.Never)] public string InputFontFamily { - get - { - if (NUIApplication.IsUsingXaml) - { - return (string)GetValue(InputFontFamilyProperty); - } - else - { - return (string)GetInternalInputFontFamilyProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(InputFontFamilyProperty, value); - } - else - { - SetInternalInputFontFamilyProperty(this, null, value); - } - } + get => (string)GetValue(InputFontFamilyProperty); + set => SetValue(InputFontFamilyProperty, value); } /// @@ -1293,28 +282,8 @@ public string InputFontFamily [EditorBrowsable(EditorBrowsableState.Never)] public float? InputPointSize { - get - { - if (NUIApplication.IsUsingXaml) - { - return (float?)GetValue(InputPointSizeProperty); - } - else - { - return (float?)GetInternalInputPointSizeProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(InputPointSizeProperty, value); - } - else - { - SetInternalInputPointSizeProperty(this, null, value); - } - } + get => (float?)GetValue(InputPointSizeProperty); + set => SetValue(InputPointSizeProperty, value); } /// @@ -1323,28 +292,8 @@ public float? InputPointSize [EditorBrowsable(EditorBrowsableState.Never)] public string InputUnderline { - get - { - if (NUIApplication.IsUsingXaml) - { - return (string)GetValue(InputUnderlineProperty); - } - else - { - return (string)GetInternalInputUnderlineProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(InputUnderlineProperty, value); - } - else - { - SetInternalInputUnderlineProperty(this, null, value); - } - } + get => (string)GetValue(InputUnderlineProperty); + set => SetValue(InputUnderlineProperty, value); } /// @@ -1353,28 +302,8 @@ public string InputUnderline [EditorBrowsable(EditorBrowsableState.Never)] public string InputShadow { - get - { - if (NUIApplication.IsUsingXaml) - { - return (string)GetValue(InputShadowProperty); - } - else - { - return (string)GetInternalInputShadowProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(InputShadowProperty, value); - } - else - { - SetInternalInputShadowProperty(this, null, value); - } - } + get => (string)GetValue(InputShadowProperty); + set => SetValue(InputShadowProperty, value); } /// @@ -1383,28 +312,8 @@ public string InputShadow [EditorBrowsable(EditorBrowsableState.Never)] public string Emboss { - get - { - if (NUIApplication.IsUsingXaml) - { - return (string)GetValue(EmbossProperty); - } - else - { - return (string)GetInternalEmbossProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(EmbossProperty, value); - } - else - { - SetInternalEmbossProperty(this, null, value); - } - } + get => (string)GetValue(EmbossProperty); + set => SetValue(EmbossProperty, value); } /// @@ -1413,28 +322,8 @@ public string Emboss [EditorBrowsable(EditorBrowsableState.Never)] public string InputEmboss { - get - { - if (NUIApplication.IsUsingXaml) - { - return (string)GetValue(InputEmbossProperty); - } - else - { - return (string)GetInternalInputEmbossProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(InputEmbossProperty, value); - } - else - { - SetInternalInputEmbossProperty(this, null, value); - } - } + get => (string)GetValue(InputEmbossProperty); + set => SetValue(InputEmbossProperty, value); } /// @@ -1443,28 +332,8 @@ public string InputEmboss [EditorBrowsable(EditorBrowsableState.Never)] public string InputOutline { - get - { - if (NUIApplication.IsUsingXaml) - { - return (string)GetValue(InputOutlineProperty); - } - else - { - return (string)GetInternalInputOutlineProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(InputOutlineProperty, value); - } - else - { - SetInternalInputOutlineProperty(this, null, value); - } - } + get => (string)GetValue(InputOutlineProperty); + set => SetValue(InputOutlineProperty, value); } /// @@ -1473,28 +342,8 @@ public string InputOutline [EditorBrowsable(EditorBrowsableState.Never)] public bool? SmoothScroll { - get - { - if (NUIApplication.IsUsingXaml) - { - return (bool?)GetValue(SmoothScrollProperty); - } - else - { - return (bool?)GetInternalSmoothScrollProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(SmoothScrollProperty, value); - } - else - { - SetInternalSmoothScrollProperty(this, null, value); - } - } + get => (bool?)GetValue(SmoothScrollProperty); + set => SetValue(SmoothScrollProperty, value); } /// @@ -1503,28 +352,8 @@ public bool? SmoothScroll [EditorBrowsable(EditorBrowsableState.Never)] public float? SmoothScrollDuration { - get - { - if (NUIApplication.IsUsingXaml) - { - return (float?)GetValue(SmoothScrollDurationProperty); - } - else - { - return (float?)GetInternalSmoothScrollDurationProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(SmoothScrollDurationProperty, value); - } - else - { - SetInternalSmoothScrollDurationProperty(this, null, value); - } - } + get => (float?)GetValue(SmoothScrollDurationProperty); + set => SetValue(SmoothScrollDurationProperty, value); } /// @@ -1533,28 +362,8 @@ public float? SmoothScrollDuration [EditorBrowsable(EditorBrowsableState.Never)] public bool? EnableScrollBar { - get - { - if (NUIApplication.IsUsingXaml) - { - return (bool?)GetValue(EnableScrollBarProperty); - } - else - { - return (bool?)GetInternalEnableScrollBarProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(EnableScrollBarProperty, value); - } - else - { - SetInternalEnableScrollBarProperty(this, null, value); - } - } + get => (bool?)GetValue(EnableScrollBarProperty); + set => SetValue(EnableScrollBarProperty, value); } /// @@ -1563,28 +372,8 @@ public bool? EnableScrollBar [EditorBrowsable(EditorBrowsableState.Never)] public float? ScrollBarShowDuration { - get - { - if (NUIApplication.IsUsingXaml) - { - return (float?)GetValue(ScrollBarShowDurationProperty); - } - else - { - return (float?)GetInternalScrollBarShowDurationProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(ScrollBarShowDurationProperty, value); - } - else - { - SetInternalScrollBarShowDurationProperty(this, null, value); - } - } + get => (float?)GetValue(ScrollBarShowDurationProperty); + set => SetValue(ScrollBarShowDurationProperty, value); } /// @@ -1593,28 +382,8 @@ public float? ScrollBarShowDuration [EditorBrowsable(EditorBrowsableState.Never)] public float? ScrollBarFadeDuration { - get - { - if (NUIApplication.IsUsingXaml) - { - return (float?)GetValue(ScrollBarFadeDurationProperty); - } - else - { - return (float?)GetInternalScrollBarFadeDurationProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(ScrollBarFadeDurationProperty, value); - } - else - { - SetInternalScrollBarFadeDurationProperty(this, null, value); - } - } + get => (float?)GetValue(ScrollBarFadeDurationProperty); + set => SetValue(ScrollBarFadeDurationProperty, value); } /// @@ -1623,28 +392,8 @@ public float? ScrollBarFadeDuration [EditorBrowsable(EditorBrowsableState.Never)] public float? PixelSize { - get - { - if (NUIApplication.IsUsingXaml) - { - return (float?)GetValue(PixelSizeProperty); - } - else - { - return (float?)GetInternalPixelSizeProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(PixelSizeProperty, value); - } - else - { - SetInternalPixelSizeProperty(this, null, value); - } - } + get => (float?)GetValue(PixelSizeProperty); + set => SetValue(PixelSizeProperty, value); } /// @@ -1653,28 +402,8 @@ public float? PixelSize [EditorBrowsable(EditorBrowsableState.Never)] public bool? EnableSelection { - get - { - if (NUIApplication.IsUsingXaml) - { - return (bool?)GetValue(EnableSelectionProperty); - } - else - { - return (bool?)GetInternalEnableSelectionProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(EnableSelectionProperty, value); - } - else - { - SetInternalEnableSelectionProperty(this, null, value); - } - } + get => (bool?)GetValue(EnableSelectionProperty); + set => SetValue(EnableSelectionProperty, value); } /// @@ -1683,28 +412,8 @@ public bool? EnableSelection [EditorBrowsable(EditorBrowsableState.Never)] public bool? MatchSystemLanguageDirection { - get - { - if (NUIApplication.IsUsingXaml) - { - return (bool?)GetValue(MatchSystemLanguageDirectionProperty); - } - else - { - return (bool?)GetInternalMatchSystemLanguageDirectionProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(MatchSystemLanguageDirectionProperty, value); - } - else - { - SetInternalMatchSystemLanguageDirectionProperty(this, null, value); - } - } + get => (bool?)GetValue(MatchSystemLanguageDirectionProperty); + set => SetValue(MatchSystemLanguageDirectionProperty, value); } /// @@ -1714,28 +423,8 @@ public bool? MatchSystemLanguageDirection [EditorBrowsable(EditorBrowsableState.Never)] public Vector4 TextColor { - get - { - if (NUIApplication.IsUsingXaml) - { - return (Vector4)GetValue(TextColorProperty); - } - else - { - return (Vector4)GetInternalTextColorProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(TextColorProperty, value); - } - else - { - SetInternalTextColorProperty(this, null, value); - } - } + get => (Vector4)GetValue(TextColorProperty); + set => SetValue(TextColorProperty, value); } /// @@ -1744,28 +433,8 @@ public Vector4 TextColor [EditorBrowsable(EditorBrowsableState.Never)] public float? PointSize { - get - { - if (NUIApplication.IsUsingXaml) - { - return (float?)GetValue(PointSizeProperty); - } - else - { - return (float?)GetInternalPointSizeProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(PointSizeProperty, value); - } - else - { - SetInternalPointSizeProperty(this, null, value); - } - } + get => (float?)GetValue(PointSizeProperty); + set => SetValue(PointSizeProperty, value); } /// @@ -1775,28 +444,8 @@ public float? PointSize [EditorBrowsable(EditorBrowsableState.Never)] public Color PlaceholderTextColor { - get - { - if (NUIApplication.IsUsingXaml) - { - return (Color)GetValue(PlaceholderTextColorProperty); - } - else - { - return (Color)GetInternalPlaceholderTextColorProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(PlaceholderTextColorProperty, value); - } - else - { - SetInternalPlaceholderTextColorProperty(this, null, value); - } - } + get => (Color)GetValue(PlaceholderTextColorProperty); + set => SetValue(PlaceholderTextColorProperty, value); } /// @@ -1806,28 +455,8 @@ public Color PlaceholderTextColor [EditorBrowsable(EditorBrowsableState.Never)] public Vector4 PrimaryCursorColor { - get - { - if (NUIApplication.IsUsingXaml) - { - return (Vector4)GetValue(PrimaryCursorColorProperty); - } - else - { - return (Vector4)GetInternalPrimaryCursorColorProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(PrimaryCursorColorProperty, value); - } - else - { - SetInternalPrimaryCursorColorProperty(this, null, value); - } - } + get => (Vector4)GetValue(PrimaryCursorColorProperty); + set => SetValue(PrimaryCursorColorProperty, value); } /// @@ -1836,56 +465,16 @@ public Vector4 PrimaryCursorColor [EditorBrowsable(EditorBrowsableState.Never)] public PropertyMap FontStyle { - get - { - if (NUIApplication.IsUsingXaml) - { - return (PropertyMap)GetValue(FontStyleProperty); - } - else - { - return (PropertyMap)GetInternalFontStyleProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(FontStyleProperty, value); - } - else - { - SetInternalFontStyleProperty(this, null, value); - } - } + get => (PropertyMap)GetValue(FontStyleProperty); + set => SetValue(FontStyleProperty, value); } /// This will be public opened in tizen_6.5 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public bool? Ellipsis { - get - { - if (NUIApplication.IsUsingXaml) - { - return (bool?)GetValue(EllipsisProperty); - } - else - { - return (bool?)GetInternalEllipsisProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(EllipsisProperty, value); - } - else - { - SetInternalEllipsisProperty(this, null, value); - } - } + get => (bool?)GetValue(EllipsisProperty); + set => SetValue(EllipsisProperty, value); } /// @@ -1894,28 +483,8 @@ public bool? Ellipsis [EditorBrowsable(EditorBrowsableState.Never)] public float? LineSpacing { - get - { - if (NUIApplication.IsUsingXaml) - { - return (float?)GetValue(LineSpacingProperty); - } - else - { - return (float?)GetInternalLineSpacingProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(LineSpacingProperty, value); - } - else - { - SetInternalLineSpacingProperty(this, null, value); - } - } + get => (float?)GetValue(LineSpacingProperty); + set => SetValue(LineSpacingProperty, value); } /// @@ -1924,28 +493,8 @@ public float? LineSpacing [EditorBrowsable(EditorBrowsableState.Never)] public float? MinLineSize { - get - { - if (NUIApplication.IsUsingXaml) - { - return (float?)GetValue(MinLineSizeProperty); - } - else - { - return (float?)GetInternalMinLineSizeProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(MinLineSizeProperty, value); - } - else - { - SetInternalMinLineSizeProperty(this, null, value); - } - } + get => (float?)GetValue(MinLineSizeProperty); + set => SetValue(MinLineSizeProperty, value); } /// @@ -1954,82 +503,22 @@ public float? MinLineSize [EditorBrowsable(EditorBrowsableState.Never)] public float? RelativeLineHeight { - get - { - if (NUIApplication.IsUsingXaml) - { - return (float?)GetValue(RelativeLineHeightProperty); - } - else - { - return (float?)GetInternalRelativeLineHeightProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(RelativeLineHeightProperty, value); - } - else - { - SetInternalRelativeLineHeightProperty(this, null, value); - } - } + get => (float?)GetValue(RelativeLineHeightProperty); + set => SetValue(RelativeLineHeightProperty, value); } [EditorBrowsable(EditorBrowsableState.Never)] public float? FontSizeScale { - get - { - if (NUIApplication.IsUsingXaml) - { - return (float?)GetValue(FontSizeScaleProperty); - } - else - { - return (float?)GetInternalFontSizeScaleProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(FontSizeScaleProperty, value); - } - else - { - SetInternalFontSizeScaleProperty(this, null, value); - } - } + get => (float?)GetValue(FontSizeScaleProperty); + set => SetValue(FontSizeScaleProperty, value); } [EditorBrowsable(EditorBrowsableState.Never)] public PropertyMap SelectionPopupStyle { - get - { - if (NUIApplication.IsUsingXaml) - { - return (PropertyMap)GetValue(SelectionPopupStyleProperty); - } - else - { - return (PropertyMap)GetInternalSelectionPopupStyleProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(SelectionPopupStyleProperty, value); - } - else - { - SetInternalSelectionPopupStyleProperty(this, null, value); - } - } + get => (PropertyMap)GetValue(SelectionPopupStyleProperty); + set => SetValue(SelectionPopupStyleProperty, value); } } } diff --git a/src/Tizen.NUI/src/public/BaseComponents/Style/TextFieldStyle.cs b/src/Tizen.NUI/src/public/BaseComponents/Style/TextFieldStyle.cs index b9b0cbcd437..b2859536730 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/Style/TextFieldStyle.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/Style/TextFieldStyle.cs @@ -14,9 +14,8 @@ * limitations under the License. * */ -using System; + using System.ComponentModel; -using Tizen.NUI.Binding; namespace Tizen.NUI.BaseComponents { @@ -27,707 +26,49 @@ namespace Tizen.NUI.BaseComponents [EditorBrowsable(EditorBrowsableState.Never)] public class TextFieldStyle : ViewStyle { - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty FontFamilyProperty = null; - internal static void SetInternalFontFamilyProperty(BindableObject bindable, object oldValue, object newValue) - { - var textFieldStyle = (TextFieldStyle)bindable; - textFieldStyle.fontFamily = (string)newValue; - } - internal static object GetInternalFontFamilyProperty(BindableObject bindable) - { - var textFieldStyle = (TextFieldStyle)bindable; - return textFieldStyle.fontFamily; - } - - /// 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 static readonly BindableProperty PointSizeProperty = null; - internal static void SetInternalPointSizeProperty(BindableObject bindable, object oldValue, object newValue) - { - var textFieldStyle = (TextFieldStyle)bindable; - textFieldStyle.pointSize = (float?)newValue; - } - internal static object GetInternalPointSizeProperty(BindableObject bindable) - { - var textFieldStyle = (TextFieldStyle)bindable; - return textFieldStyle.pointSize; - } - - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty FontSizeScaleProperty = null; - internal static void SetInternalFontSizeScaleProperty(BindableObject bindable, object oldValue, object newValue) - { - var textFieldStyle = (TextFieldStyle)bindable; - textFieldStyle.fontSizeScale = (float?)newValue; - } - internal static object GetInternalFontSizeScaleProperty(BindableObject bindable) - { - var textFieldStyle = (TextFieldStyle)bindable; - return textFieldStyle.fontSizeScale; - } - - /// 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 static readonly BindableProperty TextColorProperty = null; - internal static void SetInternalTextColorProperty(BindableObject bindable, object oldValue, object newValue) - { - var textFieldStyle = (TextFieldStyle)bindable; - textFieldStyle.textColor = (Color)newValue; - } - internal static object GetInternalTextColorProperty(BindableObject bindable) - { - var textFieldStyle = (TextFieldStyle)bindable; - return textFieldStyle.textColor; - } - - /// 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 static readonly BindableProperty PlaceholderTextColorProperty = null; - internal static void SetInternalPlaceholderTextColorProperty(BindableObject bindable, object oldValue, object newValue) - { - var textFieldStyle = (TextFieldStyle)bindable; - textFieldStyle.placeholderTextColor = (Vector4)newValue; - } - internal static object GetInternalPlaceholderTextColorProperty(BindableObject bindable) - { - var textFieldStyle = (TextFieldStyle)bindable; - return textFieldStyle.placeholderTextColor; - } - - /// 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 static readonly BindableProperty PrimaryCursorColorProperty = null; - internal static void SetInternalPrimaryCursorColorProperty(BindableObject bindable, object oldValue, object newValue) - { - var textFieldStyle = (TextFieldStyle)bindable; - textFieldStyle.primaryCursorColor = (Vector4)newValue; - } - internal static object GetInternalPrimaryCursorColorProperty(BindableObject bindable) - { - var textFieldStyle = (TextFieldStyle)bindable; - return textFieldStyle.primaryCursorColor; - } - - /// 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 static readonly BindableProperty PlaceholderTextProperty = null; - internal static void SetInternalPlaceholderTextProperty(BindableObject bindable, object oldValue, object newValue) - { - var textFieldStyle = (TextFieldStyle)bindable; - textFieldStyle.placeholderText = (string)newValue; - } - internal static object GetInternalPlaceholderTextProperty(BindableObject bindable) - { - var textFieldStyle = (TextFieldStyle)bindable; - return textFieldStyle.placeholderText; - } - - /// 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 static readonly BindableProperty PlaceholderTextFocusedProperty = null; - internal static void SetInternalPlaceholderTextFocusedProperty(BindableObject bindable, object oldValue, object newValue) - { - var textFieldStyle = (TextFieldStyle)bindable; - textFieldStyle.placeholderTextFocused = (string)newValue; - } - internal static object GetInternalPlaceholderTextFocusedProperty(BindableObject bindable) - { - var textFieldStyle = (TextFieldStyle)bindable; - return textFieldStyle.placeholderTextFocused; - } - - /// 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 static readonly BindableProperty MaxLengthProperty = null; - internal static void SetInternalMaxLengthProperty(BindableObject bindable, object oldValue, object newValue) - { - var textFieldStyle = (TextFieldStyle)bindable; - textFieldStyle.maxLength = (int?)newValue; - } - internal static object GetInternalMaxLengthProperty(BindableObject bindable) - { - var textFieldStyle = (TextFieldStyle)bindable; - return textFieldStyle.maxLength; - } - - /// 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 static readonly BindableProperty ExceedPolicyProperty = null; - internal static void SetInternalExceedPolicyProperty(BindableObject bindable, object oldValue, object newValue) - { - var textFieldStyle = (TextFieldStyle)bindable; - textFieldStyle.exceedPolicy = (int?)newValue; - } - internal static object GetInternalExceedPolicyProperty(BindableObject bindable) - { - var textFieldStyle = (TextFieldStyle)bindable; - return textFieldStyle.exceedPolicy; - } - - /// 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 static readonly BindableProperty HorizontalAlignmentProperty = null; - internal static void SetInternalHorizontalAlignmentProperty(BindableObject bindable, object oldValue, object newValue) - { - var textFieldStyle = (TextFieldStyle)bindable; - textFieldStyle.horizontalAlignment = (HorizontalAlignment?)newValue; - } - internal static object GetInternalHorizontalAlignmentProperty(BindableObject bindable) - { - var textFieldStyle = (TextFieldStyle)bindable; - return textFieldStyle.horizontalAlignment; - } - - /// 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 static readonly BindableProperty VerticalAlignmentProperty = null; - internal static void SetInternalVerticalAlignmentProperty(BindableObject bindable, object oldValue, object newValue) - { - var textFieldStyle = (TextFieldStyle)bindable; - textFieldStyle.verticalAlignment = (VerticalAlignment?)newValue; - } - internal static object GetInternalVerticalAlignmentProperty(BindableObject bindable) - { - var textFieldStyle = (TextFieldStyle)bindable; - return textFieldStyle.verticalAlignment; - } - - /// 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 static readonly BindableProperty SecondaryCursorColorProperty = null; - internal static void SetInternalSecondaryCursorColorProperty(BindableObject bindable, object oldValue, object newValue) - { - var textFieldStyle = (TextFieldStyle)bindable; - textFieldStyle.secondaryCursorColor = (Vector4)newValue; - } - internal static object GetInternalSecondaryCursorColorProperty(BindableObject bindable) - { - var textFieldStyle = (TextFieldStyle)bindable; - return textFieldStyle.secondaryCursorColor; - } - - /// 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 static readonly BindableProperty EnableCursorBlinkProperty = null; - internal static void SetInternalEnableCursorBlinkProperty(BindableObject bindable, object oldValue, object newValue) - { - var textFieldStyle = (TextFieldStyle)bindable; - textFieldStyle.enableCursorBlink = (bool?)newValue; - } - internal static object GetInternalEnableCursorBlinkProperty(BindableObject bindable) - { - var textFieldStyle = (TextFieldStyle)bindable; - return textFieldStyle.enableCursorBlink; - } - - /// 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 static readonly BindableProperty CursorBlinkIntervalProperty = null; - internal static void SetInternalCursorBlinkIntervalProperty(BindableObject bindable, object oldValue, object newValue) - { - var textFieldStyle = (TextFieldStyle)bindable; - textFieldStyle.cursorBlinkInterval = (float?)newValue; - } - internal static object GetInternalCursorBlinkIntervalProperty(BindableObject bindable) - { - var textFieldStyle = (TextFieldStyle)bindable; - return textFieldStyle.cursorBlinkInterval; - } - - /// 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 static readonly BindableProperty CursorBlinkDurationProperty = null; - internal static void SetInternalCursorBlinkDurationProperty(BindableObject bindable, object oldValue, object newValue) - { - var textFieldStyle = (TextFieldStyle)bindable; - textFieldStyle.cursorBlinkDuration = (float?)newValue; - } - internal static object GetInternalCursorBlinkDurationProperty(BindableObject bindable) - { - var textFieldStyle = (TextFieldStyle)bindable; - return textFieldStyle.cursorBlinkDuration; - } - - /// 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 static readonly BindableProperty CursorWidthProperty = null; - internal static void SetInternalCursorWidthProperty(BindableObject bindable, object oldValue, object newValue) - { - var textFieldStyle = (TextFieldStyle)bindable; - textFieldStyle.cursorWidth = (int?)newValue; - } - internal static object GetInternalCursorWidthProperty(BindableObject bindable) - { - var textFieldStyle = (TextFieldStyle)bindable; - return textFieldStyle.cursorWidth; - } - - /// This will be public opened in tizen_6.5 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty GrabHandleColorProperty = null; - internal static void SetInternalGrabHandleColorProperty(BindableObject bindable, object oldValue, object newValue) - { - var textFieldStyle = (TextFieldStyle)bindable; - textFieldStyle.grabHandleColor = (Color)newValue; - } - internal static object GetInternalGrabHandleColorProperty(BindableObject bindable) - { - var textFieldStyle = (TextFieldStyle)bindable; - return textFieldStyle.grabHandleColor; - } - - /// 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 static readonly BindableProperty GrabHandleImageProperty = null; - internal static void SetInternalGrabHandleImageProperty(BindableObject bindable, object oldValue, object newValue) - { - var textFieldStyle = (TextFieldStyle)bindable; - textFieldStyle.grabHandleImage = (string)newValue; - } - internal static object GetInternalGrabHandleImageProperty(BindableObject bindable) - { - var textFieldStyle = (TextFieldStyle)bindable; - return textFieldStyle.grabHandleImage; - } - - /// 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 static readonly BindableProperty GrabHandlePressedImageProperty = null; - internal static void SetInternalGrabHandlePressedImageProperty(BindableObject bindable, object oldValue, object newValue) - { - var textFieldStyle = (TextFieldStyle)bindable; - textFieldStyle.grabHandlePressedImage = (string)newValue; - } - internal static object GetInternalGrabHandlePressedImageProperty(BindableObject bindable) - { - var textFieldStyle = (TextFieldStyle)bindable; - return textFieldStyle.grabHandlePressedImage; - } - - /// This will be public opened in tizen_6.5 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty SelectionHandleImageLeftProperty = null; - internal static void SetInternalSelectionHandleImageLeftProperty(BindableObject bindable, object oldValue, object newValue) - { - var textFieldStyle = (TextFieldStyle)bindable; - textFieldStyle.selectionHandleImageLeft = (PropertyMap)newValue; - } - internal static object GetInternalSelectionHandleImageLeftProperty(BindableObject bindable) - { - var textFieldStyle = (TextFieldStyle)bindable; - return textFieldStyle.selectionHandleImageLeft; - } - - /// This will be public opened in tizen_6.5 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty SelectionHandleImageRightProperty = null; - internal static void SetInternalSelectionHandleImageRightProperty(BindableObject bindable, object oldValue, object newValue) - { - var textFieldStyle = (TextFieldStyle)bindable; - textFieldStyle.selectionHandleImageRight = (PropertyMap)newValue; - } - internal static object GetInternalSelectionHandleImageRightProperty(BindableObject bindable) - { - var textFieldStyle = (TextFieldStyle)bindable; - return textFieldStyle.selectionHandleImageRight; - } - - /// 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 static readonly BindableProperty ScrollThresholdProperty = null; - internal static void SetInternalScrollThresholdProperty(BindableObject bindable, object oldValue, object newValue) - { - var textFieldStyle = (TextFieldStyle)bindable; - textFieldStyle.scrollThreshold = (float?)newValue; - } - internal static object GetInternalScrollThresholdProperty(BindableObject bindable) - { - var textFieldStyle = (TextFieldStyle)bindable; - return textFieldStyle.scrollThreshold; - } - - /// 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 static readonly BindableProperty ScrollSpeedProperty = null; - internal static void SetInternalScrollSpeedProperty(BindableObject bindable, object oldValue, object newValue) - { - var textFieldStyle = (TextFieldStyle)bindable; - textFieldStyle.scrollSpeed = (float?)newValue; - } - internal static object GetInternalScrollSpeedProperty(BindableObject bindable) - { - var textFieldStyle = (TextFieldStyle)bindable; - return textFieldStyle.scrollSpeed; - } - - /// 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 static readonly BindableProperty SelectionHighlightColorProperty = null; - internal static void SetInternalSelectionHighlightColorProperty(BindableObject bindable, object oldValue, object newValue) - { - var textFieldStyle = (TextFieldStyle)bindable; - textFieldStyle.selectionHighlightColor = (Vector4)newValue; - } - internal static object GetInternalSelectionHighlightColorProperty(BindableObject bindable) - { - var textFieldStyle = (TextFieldStyle)bindable; - return textFieldStyle.selectionHighlightColor; - } - - /// 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 static readonly BindableProperty DecorationBoundingBoxProperty = null; - internal static void SetInternalDecorationBoundingBoxProperty(BindableObject bindable, object oldValue, object newValue) - { - var textFieldStyle = (TextFieldStyle)bindable; - textFieldStyle.decorationBoundingBox = (Rectangle)newValue; - } - internal static object GetInternalDecorationBoundingBoxProperty(BindableObject bindable) - { - var textFieldStyle = (TextFieldStyle)bindable; - return textFieldStyle.decorationBoundingBox; - } - - /// 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 static readonly BindableProperty InputColorProperty = null; - internal static void SetInternalInputColorProperty(BindableObject bindable, object oldValue, object newValue) - { - var textFieldStyle = (TextFieldStyle)bindable; - textFieldStyle.inputColor = (Vector4)newValue; - } - internal static object GetInternalInputColorProperty(BindableObject bindable) - { - var textFieldStyle = (TextFieldStyle)bindable; - return textFieldStyle.inputColor; - } - - /// 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 static readonly BindableProperty EnableMarkupProperty = null; - internal static void SetInternalEnableMarkupProperty(BindableObject bindable, object oldValue, object newValue) - { - var textFieldStyle = (TextFieldStyle)bindable; - textFieldStyle.enableMarkup = (bool?)newValue; - } - internal static object GetInternalEnableMarkupProperty(BindableObject bindable) - { - var textFieldStyle = (TextFieldStyle)bindable; - return textFieldStyle.enableMarkup; - } - - /// 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 static readonly BindableProperty InputFontFamilyProperty = null; - internal static void SetInternalInputFontFamilyProperty(BindableObject bindable, object oldValue, object newValue) - { - var textFieldStyle = (TextFieldStyle)bindable; - textFieldStyle.inputFontFamily = (string)newValue; - } - internal static object GetInternalInputFontFamilyProperty(BindableObject bindable) - { - var textFieldStyle = (TextFieldStyle)bindable; - return textFieldStyle.inputFontFamily; - } - - /// 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 static readonly BindableProperty InputPointSizeProperty = null; - internal static void SetInternalInputPointSizeProperty(BindableObject bindable, object oldValue, object newValue) - { - var textFieldStyle = (TextFieldStyle)bindable; - textFieldStyle.inputPointSize = (float?)newValue; - } - internal static object GetInternalInputPointSizeProperty(BindableObject bindable) - { - var textFieldStyle = (TextFieldStyle)bindable; - return textFieldStyle.inputPointSize; - } - - /// 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 static readonly BindableProperty InputUnderlineProperty = null; - internal static void SetInternalInputUnderlineProperty(BindableObject bindable, object oldValue, object newValue) - { - var textFieldStyle = (TextFieldStyle)bindable; - textFieldStyle.inputUnderline = (string)newValue; - } - internal static object GetInternalInputUnderlineProperty(BindableObject bindable) - { - var textFieldStyle = (TextFieldStyle)bindable; - return textFieldStyle.inputUnderline; - } - - /// 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 static readonly BindableProperty InputShadowProperty = null; - internal static void SetInternalInputShadowProperty(BindableObject bindable, object oldValue, object newValue) - { - var textFieldStyle = (TextFieldStyle)bindable; - textFieldStyle.inputShadow = (string)newValue; - } - internal static object GetInternalInputShadowProperty(BindableObject bindable) - { - var textFieldStyle = (TextFieldStyle)bindable; - return textFieldStyle.inputShadow; - } - - /// 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 static readonly BindableProperty EmbossProperty = null; - internal static void SetInternalEmbossProperty(BindableObject bindable, object oldValue, object newValue) - { - var textFieldStyle = (TextFieldStyle)bindable; - textFieldStyle.emboss = (string)newValue; - } - internal static object GetInternalEmbossProperty(BindableObject bindable) - { - var textFieldStyle = (TextFieldStyle)bindable; - return textFieldStyle.emboss; - } - - /// 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 static readonly BindableProperty InputEmbossProperty = null; - internal static void SetInternalInputEmbossProperty(BindableObject bindable, object oldValue, object newValue) - { - var textFieldStyle = (TextFieldStyle)bindable; - textFieldStyle.inputEmboss = (string)newValue; - } - internal static object GetInternalInputEmbossProperty(BindableObject bindable) - { - var textFieldStyle = (TextFieldStyle)bindable; - return textFieldStyle.inputEmboss; - } - - /// 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 static readonly BindableProperty InputOutlineProperty = null; - internal static void SetInternalInputOutlineProperty(BindableObject bindable, object oldValue, object newValue) - { - var textFieldStyle = (TextFieldStyle)bindable; - textFieldStyle.inputOutline = (string)newValue; - } - internal static object GetInternalInputOutlineProperty(BindableObject bindable) - { - var textFieldStyle = (TextFieldStyle)bindable; - return textFieldStyle.inputOutline; - } - - /// 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 static readonly BindableProperty PixelSizeProperty = null; - internal static void SetInternalPixelSizeProperty(BindableObject bindable, object oldValue, object newValue) - { - var textFieldStyle = (TextFieldStyle)bindable; - textFieldStyle.pixelSize = (float?)newValue; - } - internal static object GetInternalPixelSizeProperty(BindableObject bindable) - { - var textFieldStyle = (TextFieldStyle)bindable; - return textFieldStyle.pixelSize; - } - - /// 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 static readonly BindableProperty EnableSelectionProperty = null; - internal static void SetInternalEnableSelectionProperty(BindableObject bindable, object oldValue, object newValue) - { - var textFieldStyle = (TextFieldStyle)bindable; - textFieldStyle.enableSelection = (bool?)newValue; - } - internal static object GetInternalEnableSelectionProperty(BindableObject bindable) - { - var textFieldStyle = (TextFieldStyle)bindable; - return textFieldStyle.enableSelection; - } - - /// 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 static readonly BindableProperty EllipsisProperty = null; - internal static void SetInternalEllipsisProperty(BindableObject bindable, object oldValue, object newValue) - { - var textFieldStyle = (TextFieldStyle)bindable; - textFieldStyle.ellipsis = (bool?)newValue; - } - internal static object GetInternalEllipsisProperty(BindableObject bindable) - { - var textFieldStyle = (TextFieldStyle)bindable; - return textFieldStyle.ellipsis; - } - - /// 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 static readonly BindableProperty MatchSystemLanguageDirectionProperty = null; - internal static void SetInternalMatchSystemLanguageDirectionProperty(BindableObject bindable, object oldValue, object newValue) - { - var textFieldStyle = (TextFieldStyle)bindable; - textFieldStyle.matchSystemLanguageDirection = (bool?)newValue; - } - internal static object GetInternalMatchSystemLanguageDirectionProperty(BindableObject bindable) - { - var textFieldStyle = (TextFieldStyle)bindable; - return textFieldStyle.matchSystemLanguageDirection; - } - - /// This will be public opened in tizen_6.5 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty FontStyleProperty = null; - internal static void SetInternalFontStyleProperty(BindableObject bindable, object oldValue, object newValue) - { - var textFieldStyle = (TextFieldStyle)bindable; - textFieldStyle.fontStyle = (PropertyMap)newValue; - } - internal static object GetInternalFontStyleProperty(BindableObject bindable) - { - var textFieldStyle = (TextFieldStyle)bindable; - return textFieldStyle.fontStyle; - } - - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty SelectionPopupStyleProperty = null; - internal static void SetInternalSelectionPopupStyleProperty(BindableObject bindable, object oldValue, object newValue) - { - var textFieldStyle = (TextFieldStyle)bindable; - textFieldStyle.selectionPopupStyle = (PropertyMap)newValue; - } - internal static object GetInternalSelectionPopupStyleProperty(BindableObject bindable) - { - var textFieldStyle = (TextFieldStyle)bindable; - return textFieldStyle.selectionPopupStyle; - } - - private string placeholderText; - private string placeholderTextFocused; - private int? maxLength; - private int? exceedPolicy; - private HorizontalAlignment? horizontalAlignment; - private VerticalAlignment? verticalAlignment; - private Vector4 secondaryCursorColor; - private bool? enableCursorBlink; - private float? cursorBlinkInterval; - private float? cursorBlinkDuration; - private int? cursorWidth; - private Color grabHandleColor; - private string grabHandleImage; - private string grabHandlePressedImage; - private PropertyMap selectionHandleImageLeft; - private PropertyMap selectionHandleImageRight; - private float? scrollThreshold; - private float? scrollSpeed; - private Vector4 selectionHighlightColor; - private Rectangle decorationBoundingBox; - private Vector4 inputColor; - private bool? enableMarkup; - private string inputFontFamily; - private float? inputPointSize; - private string inputUnderline; - private string inputShadow; - private string emboss; - private string inputEmboss; - private string inputOutline; - private float? pixelSize; - private bool? enableSelection; - private bool? ellipsis; - private bool? matchSystemLanguageDirection; - private string fontFamily; - private Color textColor; - private float? pointSize; - private float? fontSizeScale; - private Vector4 placeholderTextColor; - private Vector4 primaryCursorColor; - private PropertyMap fontStyle; - private PropertyMap selectionPopupStyle; - - static TextFieldStyle() - { - if (NUIApplication.IsUsingXaml) - { - FontFamilyProperty = BindableProperty.Create(nameof(FontFamily), typeof(string), typeof(TextFieldStyle), null, - propertyChanged: SetInternalFontFamilyProperty, defaultValueCreator: GetInternalFontFamilyProperty); - PointSizeProperty = BindableProperty.Create(nameof(PointSize), typeof(float?), typeof(TextFieldStyle), null, - propertyChanged: SetInternalPointSizeProperty, defaultValueCreator: GetInternalPointSizeProperty); - FontSizeScaleProperty = BindableProperty.Create(nameof(FontSizeScale), typeof(float?), typeof(TextFieldStyle), null, - propertyChanged: SetInternalFontSizeScaleProperty, defaultValueCreator: GetInternalFontSizeScaleProperty); - TextColorProperty = BindableProperty.Create(nameof(TextColor), typeof(Color), typeof(TextFieldStyle), null, - propertyChanged: SetInternalTextColorProperty, defaultValueCreator: GetInternalTextColorProperty); - PlaceholderTextColorProperty = BindableProperty.Create(nameof(PlaceholderTextColor), typeof(Vector4), typeof(TextFieldStyle), null, - propertyChanged: SetInternalPlaceholderTextColorProperty, defaultValueCreator: GetInternalPlaceholderTextColorProperty); - PrimaryCursorColorProperty = BindableProperty.Create(nameof(PrimaryCursorColor), typeof(Vector4), typeof(TextFieldStyle), null, - propertyChanged: SetInternalPrimaryCursorColorProperty, defaultValueCreator: GetInternalPrimaryCursorColorProperty); - PlaceholderTextProperty = BindableProperty.Create(nameof(PlaceholderText), typeof(string), typeof(TextFieldStyle), String.Empty, - propertyChanged: SetInternalPlaceholderTextProperty, defaultValueCreator: GetInternalPlaceholderTextProperty); - PlaceholderTextFocusedProperty = BindableProperty.Create(nameof(PlaceholderTextFocused), typeof(string), typeof(TextFieldStyle), String.Empty, - propertyChanged: SetInternalPlaceholderTextFocusedProperty, defaultValueCreator: GetInternalPlaceholderTextFocusedProperty); - MaxLengthProperty = BindableProperty.Create(nameof(MaxLength), typeof(int?), typeof(TextFieldStyle), null, - propertyChanged: SetInternalMaxLengthProperty, defaultValueCreator: GetInternalMaxLengthProperty); - ExceedPolicyProperty = BindableProperty.Create(nameof(ExceedPolicy), typeof(int?), typeof(TextFieldStyle), null, - propertyChanged: SetInternalExceedPolicyProperty, defaultValueCreator: GetInternalExceedPolicyProperty); - HorizontalAlignmentProperty = BindableProperty.Create(nameof(HorizontalAlignment), typeof(HorizontalAlignment?), typeof(TextFieldStyle), null, - propertyChanged: SetInternalHorizontalAlignmentProperty, defaultValueCreator: GetInternalHorizontalAlignmentProperty); - VerticalAlignmentProperty = BindableProperty.Create(nameof(VerticalAlignment), typeof(VerticalAlignment?), typeof(TextFieldStyle), null, - propertyChanged: SetInternalVerticalAlignmentProperty, defaultValueCreator: GetInternalVerticalAlignmentProperty); - SecondaryCursorColorProperty = BindableProperty.Create(nameof(SecondaryCursorColor), typeof(Vector4), typeof(TextFieldStyle), null, - propertyChanged: SetInternalSecondaryCursorColorProperty, defaultValueCreator: GetInternalSecondaryCursorColorProperty); - EnableCursorBlinkProperty = BindableProperty.Create(nameof(EnableCursorBlink), typeof(bool?), typeof(TextFieldStyle), null, - propertyChanged: SetInternalEnableCursorBlinkProperty, defaultValueCreator: GetInternalEnableCursorBlinkProperty); - CursorBlinkIntervalProperty = BindableProperty.Create(nameof(CursorBlinkInterval), typeof(float?), typeof(TextFieldStyle), null, - propertyChanged: SetInternalCursorBlinkIntervalProperty, defaultValueCreator: GetInternalCursorBlinkIntervalProperty); - CursorBlinkDurationProperty = BindableProperty.Create(nameof(CursorBlinkDuration), typeof(float?), typeof(TextFieldStyle), null, - propertyChanged: SetInternalCursorBlinkDurationProperty, defaultValueCreator: GetInternalCursorBlinkDurationProperty); - CursorWidthProperty = BindableProperty.Create(nameof(CursorWidth), typeof(int?), typeof(TextFieldStyle), null, - propertyChanged: SetInternalCursorWidthProperty, defaultValueCreator: GetInternalCursorWidthProperty); - GrabHandleColorProperty = BindableProperty.Create(nameof(GrabHandleColor), typeof(Color), typeof(TextFieldStyle), null, - propertyChanged: SetInternalGrabHandleColorProperty, defaultValueCreator: GetInternalGrabHandleColorProperty); - GrabHandleImageProperty = BindableProperty.Create(nameof(GrabHandleImage), typeof(string), typeof(TextFieldStyle), String.Empty, - propertyChanged: SetInternalGrabHandleImageProperty, defaultValueCreator: GetInternalGrabHandleImageProperty); - GrabHandlePressedImageProperty = BindableProperty.Create(nameof(GrabHandlePressedImage), typeof(string), typeof(TextFieldStyle), String.Empty, - propertyChanged: SetInternalGrabHandlePressedImageProperty, defaultValueCreator: GetInternalGrabHandlePressedImageProperty); - SelectionHandleImageLeftProperty = BindableProperty.Create(nameof(SelectionHandleImageLeft), typeof(PropertyMap), typeof(TextFieldStyle), null, - propertyChanged: SetInternalSelectionHandleImageLeftProperty, defaultValueCreator: GetInternalSelectionHandleImageLeftProperty); - SelectionHandleImageRightProperty = BindableProperty.Create(nameof(SelectionHandleImageRight), typeof(PropertyMap), typeof(TextFieldStyle), null, - propertyChanged: SetInternalSelectionHandleImageRightProperty, defaultValueCreator: GetInternalSelectionHandleImageRightProperty); - ScrollThresholdProperty = BindableProperty.Create(nameof(ScrollThreshold), typeof(float?), typeof(TextFieldStyle), null, - propertyChanged: SetInternalScrollThresholdProperty, defaultValueCreator: GetInternalScrollThresholdProperty); - ScrollSpeedProperty = BindableProperty.Create(nameof(ScrollSpeed), typeof(float?), typeof(TextFieldStyle), null, - propertyChanged: SetInternalScrollSpeedProperty, defaultValueCreator: GetInternalScrollSpeedProperty); - SelectionHighlightColorProperty = BindableProperty.Create(nameof(SelectionHighlightColor), typeof(Vector4), typeof(TextFieldStyle), null, - propertyChanged: SetInternalSelectionHighlightColorProperty, defaultValueCreator: GetInternalSelectionHighlightColorProperty); - DecorationBoundingBoxProperty = BindableProperty.Create(nameof(DecorationBoundingBox), typeof(Rectangle), typeof(TextFieldStyle), null, - propertyChanged: SetInternalDecorationBoundingBoxProperty, defaultValueCreator: GetInternalDecorationBoundingBoxProperty); - InputColorProperty = BindableProperty.Create(nameof(InputColor), typeof(Vector4), typeof(TextFieldStyle), null, - propertyChanged: SetInternalInputColorProperty, defaultValueCreator: GetInternalInputColorProperty); - EnableMarkupProperty = BindableProperty.Create(nameof(EnableMarkup), typeof(bool?), typeof(TextFieldStyle), null, - propertyChanged: SetInternalEnableMarkupProperty, defaultValueCreator: GetInternalEnableMarkupProperty); - InputFontFamilyProperty = BindableProperty.Create(nameof(InputFontFamily), typeof(string), typeof(TextFieldStyle), String.Empty, - propertyChanged: SetInternalInputFontFamilyProperty, defaultValueCreator: GetInternalInputFontFamilyProperty); - InputPointSizeProperty = BindableProperty.Create(nameof(InputPointSize), typeof(float?), typeof(TextFieldStyle), null, - propertyChanged: SetInternalInputPointSizeProperty, defaultValueCreator: GetInternalInputPointSizeProperty); - InputUnderlineProperty = BindableProperty.Create(nameof(InputUnderline), typeof(string), typeof(TextFieldStyle), String.Empty, - propertyChanged: SetInternalInputUnderlineProperty, defaultValueCreator: GetInternalInputUnderlineProperty); - InputShadowProperty = BindableProperty.Create(nameof(InputShadow), typeof(string), typeof(TextFieldStyle), String.Empty, - propertyChanged: SetInternalInputShadowProperty, defaultValueCreator: GetInternalInputShadowProperty); - EmbossProperty = BindableProperty.Create(nameof(Emboss), typeof(string), typeof(TextFieldStyle), String.Empty, - propertyChanged: SetInternalEmbossProperty, defaultValueCreator: GetInternalEmbossProperty); - InputEmbossProperty = BindableProperty.Create(nameof(InputEmboss), typeof(string), typeof(TextFieldStyle), String.Empty, - propertyChanged: SetInternalInputEmbossProperty, defaultValueCreator: GetInternalInputEmbossProperty); - InputOutlineProperty = BindableProperty.Create(nameof(InputOutline), typeof(string), typeof(TextFieldStyle), String.Empty, - propertyChanged: SetInternalInputOutlineProperty, defaultValueCreator: GetInternalInputOutlineProperty); - PixelSizeProperty = BindableProperty.Create(nameof(PixelSize), typeof(float?), typeof(TextFieldStyle), null, - propertyChanged: SetInternalPixelSizeProperty, defaultValueCreator: GetInternalPixelSizeProperty); - EnableSelectionProperty = BindableProperty.Create(nameof(EnableSelection), typeof(bool?), typeof(TextFieldStyle), null, - propertyChanged: SetInternalEnableSelectionProperty, defaultValueCreator: GetInternalEnableSelectionProperty); - EllipsisProperty = BindableProperty.Create(nameof(Ellipsis), typeof(bool?), typeof(TextFieldStyle), null, - propertyChanged: SetInternalEllipsisProperty, defaultValueCreator: GetInternalEllipsisProperty); - MatchSystemLanguageDirectionProperty = BindableProperty.Create(nameof(MatchSystemLanguageDirection), typeof(bool?), typeof(TextFieldStyle), null, - propertyChanged: SetInternalMatchSystemLanguageDirectionProperty, defaultValueCreator: GetInternalMatchSystemLanguageDirectionProperty); - FontStyleProperty = BindableProperty.Create(nameof(FontStyle), typeof(PropertyMap), typeof(TextFieldStyle), null, - propertyChanged: SetInternalFontStyleProperty, defaultValueCreator: GetInternalFontStyleProperty); - SelectionPopupStyleProperty = BindableProperty.Create(nameof(SelectionPopupStyle), typeof(PropertyMap), typeof(TextFieldStyle), null, - propertyChanged: SetInternalSelectionPopupStyleProperty, defaultValueCreator: GetInternalSelectionPopupStyleProperty); - } - } + static readonly IStyleProperty PlaceholderTextProperty = new StyleProperty((v, o) => v.PlaceholderText = o); + static readonly IStyleProperty PlaceholderTextFocusedProperty = new StyleProperty((v, o) => v.PlaceholderTextFocused = o); + static readonly IStyleProperty FontFamilyProperty = new StyleProperty((v, o) => v.FontFamily = o); + static readonly IStyleProperty MaxLengthProperty = new StyleProperty((v, o) => v.MaxLength = o); + static readonly IStyleProperty ExceedPolicyProperty = new StyleProperty((v, o) => v.ExceedPolicy = o); + static readonly IStyleProperty HorizontalAlignmentProperty = new StyleProperty((v, o) => v.HorizontalAlignment = o); + static readonly IStyleProperty VerticalAlignmentProperty = new StyleProperty((v, o) => v.VerticalAlignment = o); + static readonly IStyleProperty SecondaryCursorColorProperty = new StyleProperty((v, o) => v.SecondaryCursorColor = o); + static readonly IStyleProperty EnableCursorBlinkProperty = new StyleProperty((v, o) => v.EnableCursorBlink = o); + static readonly IStyleProperty CursorBlinkIntervalProperty = new StyleProperty((v, o) => v.CursorBlinkInterval = o); + static readonly IStyleProperty CursorBlinkDurationProperty = new StyleProperty((v, o) => v.CursorBlinkDuration = o); + static readonly IStyleProperty CursorWidthProperty = new StyleProperty((v, o) => v.CursorWidth = o); + static readonly IStyleProperty GrabHandleColorProperty = new StyleProperty((v, o) => v.GrabHandleColor = o); + static readonly IStyleProperty GrabHandleImageProperty = new StyleProperty((v, o) => v.GrabHandleImage = o); + static readonly IStyleProperty GrabHandlePressedImageProperty = new StyleProperty((v, o) => v.GrabHandlePressedImage = o); + static readonly IStyleProperty SelectionHandleImageLeftProperty = new StyleProperty((v, o) => v.SelectionHandleImageLeft = o); + static readonly IStyleProperty SelectionHandleImageRightProperty = new StyleProperty((v, o) => v.SelectionHandleImageRight = o); + static readonly IStyleProperty ScrollThresholdProperty = new StyleProperty((v, o) => v.ScrollThreshold = o); + static readonly IStyleProperty ScrollSpeedProperty = new StyleProperty((v, o) => v.ScrollSpeed = o); + static readonly IStyleProperty SelectionHighlightColorProperty = new StyleProperty((v, o) => v.SelectionHighlightColor = o); + static readonly IStyleProperty DecorationBoundingBoxProperty = new StyleProperty((v, o) => v.DecorationBoundingBox = o); + static readonly IStyleProperty InputColorProperty = new StyleProperty((v, o) => v.InputColor = o); + static readonly IStyleProperty EnableMarkupProperty = new StyleProperty((v, o) => v.EnableMarkup = o); + static readonly IStyleProperty InputFontFamilyProperty = new StyleProperty((v, o) => v.InputFontFamily = o); + static readonly IStyleProperty InputPointSizeProperty = new StyleProperty((v, o) => v.InputPointSize = o); + static readonly IStyleProperty InputUnderlineProperty = new StyleProperty((v, o) => v.InputUnderline = o); + static readonly IStyleProperty InputShadowProperty = new StyleProperty((v, o) => v.InputShadow = o); + static readonly IStyleProperty EmbossProperty = new StyleProperty((v, o) => v.Emboss = o); + static readonly IStyleProperty InputEmbossProperty = new StyleProperty((v, o) => v.InputEmboss = o); + static readonly IStyleProperty InputOutlineProperty = new StyleProperty((v, o) => v.InputOutline = o); + static readonly IStyleProperty PixelSizeProperty = new StyleProperty((v, o) => v.PixelSize = o); + static readonly IStyleProperty EnableSelectionProperty = new StyleProperty((v, o) => v.EnableSelection = o); + static readonly IStyleProperty EllipsisProperty = new StyleProperty((v, o) => v.Ellipsis = o); + static readonly IStyleProperty MatchSystemLanguageDirectionProperty = new StyleProperty((v, o) => v.MatchSystemLanguageDirection = o); + static readonly IStyleProperty TextColorProperty = new StyleProperty((v, o) => v.TextColor = o); + static readonly IStyleProperty PointSizeProperty = new StyleProperty((v, o) => v.PointSize = o); + static readonly IStyleProperty FontSizeScaleProperty = new StyleProperty((v, o) => v.FontSizeScale = o); + static readonly IStyleProperty PlaceholderTextColorProperty = new StyleProperty((v, o) => v.PlaceholderTextColor = o); + static readonly IStyleProperty PrimaryCursorColorProperty = new StyleProperty((v, o) => v.PrimaryCursorColor = o); + static readonly IStyleProperty FontStyleProperty = new StyleProperty((v, o) => v.FontStyle = o); + static readonly IStyleProperty SelectionPopupStyleProperty = new StyleProperty((v, o) => v.SelectionPopupStyle = o); + + static TextFieldStyle() { } /// /// Create an empty instance. @@ -741,1063 +82,300 @@ public TextFieldStyle() : base() [EditorBrowsable(EditorBrowsableState.Never)] public string PlaceholderText { - get - { - if (NUIApplication.IsUsingXaml) - { - return (string)GetValue(PlaceholderTextProperty); - } - else - { - return (string)GetInternalPlaceholderTextProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(PlaceholderTextProperty, value); - } - else - { - SetInternalPlaceholderTextProperty(this, null, value); - } - } + get => (string)GetValue(PlaceholderTextProperty); + set => SetValue(PlaceholderTextProperty, value); } /// 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 string PlaceholderTextFocused { - get - { - if (NUIApplication.IsUsingXaml) - { - return (string)GetValue(PlaceholderTextFocusedProperty); - } - else - { - return (string)GetInternalPlaceholderTextFocusedProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(PlaceholderTextFocusedProperty, value); - } - else - { - SetInternalPlaceholderTextFocusedProperty(this, null, value); - } - } + get => (string)GetValue(PlaceholderTextFocusedProperty); + set => SetValue(PlaceholderTextFocusedProperty, value); } /// 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 string FontFamily { - get - { - if (NUIApplication.IsUsingXaml) - { - return (string)GetValue(FontFamilyProperty); - } - else - { - return (string)GetInternalFontFamilyProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(FontFamilyProperty, value); - } - else - { - SetInternalFontFamilyProperty(this, null, value); - } - } + get => (string)GetValue(FontFamilyProperty); + set => SetValue(FontFamilyProperty, value); } /// 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 int? MaxLength { - get - { - if (NUIApplication.IsUsingXaml) - { - return (int?)GetValue(MaxLengthProperty); - } - else - { - return (int?)GetInternalMaxLengthProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(MaxLengthProperty, value); - } - else - { - SetInternalMaxLengthProperty(this, null, value); - } - } + get => (int?)GetValue(MaxLengthProperty); + set => SetValue(MaxLengthProperty, value); } /// 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 int? ExceedPolicy { - get - { - if (NUIApplication.IsUsingXaml) - { - return (int?)GetValue(ExceedPolicyProperty); - } - else - { - return (int?)GetInternalExceedPolicyProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(ExceedPolicyProperty, value); - } - else - { - SetInternalExceedPolicyProperty(this, null, value); - } - } + get => (int?)GetValue(ExceedPolicyProperty); + set => SetValue(ExceedPolicyProperty, value); } /// 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 HorizontalAlignment? HorizontalAlignment { - get - { - if (NUIApplication.IsUsingXaml) - { - return (HorizontalAlignment?)GetValue(HorizontalAlignmentProperty); - } - else - { - return (HorizontalAlignment?)GetInternalHorizontalAlignmentProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(HorizontalAlignmentProperty, value); - } - else - { - SetInternalHorizontalAlignmentProperty(this, null, value); - } - } + get => (HorizontalAlignment?)GetValue(HorizontalAlignmentProperty); + set => SetValue(HorizontalAlignmentProperty, value); } /// 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 VerticalAlignment? VerticalAlignment { - get - { - if (NUIApplication.IsUsingXaml) - { - return (VerticalAlignment?)GetValue(VerticalAlignmentProperty); - } - else - { - return (VerticalAlignment?)GetInternalVerticalAlignmentProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(VerticalAlignmentProperty, value); - } - else - { - SetInternalVerticalAlignmentProperty(this, null, value); - } - } + get => (VerticalAlignment?)GetValue(VerticalAlignmentProperty); + set => SetValue(VerticalAlignmentProperty, value); } /// 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 Vector4 SecondaryCursorColor { - get - { - if (NUIApplication.IsUsingXaml) - { - return (Vector4)GetValue(SecondaryCursorColorProperty); - } - else - { - return (Vector4)GetInternalSecondaryCursorColorProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(SecondaryCursorColorProperty, value); - } - else - { - SetInternalSecondaryCursorColorProperty(this,null, value); - } - } + get => (Vector4)GetValue(SecondaryCursorColorProperty); + set => SetValue(SecondaryCursorColorProperty, value); } /// 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 bool? EnableCursorBlink { - get - { - if (NUIApplication.IsUsingXaml) - { - return (bool?)GetValue(EnableCursorBlinkProperty); - } - else - { - return (bool?)GetInternalEnableCursorBlinkProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(EnableCursorBlinkProperty, value); - } - else - { - SetInternalEnableCursorBlinkProperty(this,null, value); - } - } + get => (bool?)GetValue(EnableCursorBlinkProperty); + set => SetValue(EnableCursorBlinkProperty, value); } /// 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 float? CursorBlinkInterval { - get - { - if (NUIApplication.IsUsingXaml) - { - return (float?)GetValue(CursorBlinkIntervalProperty); - } - else - { - return (float?)GetInternalCursorBlinkIntervalProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(CursorBlinkIntervalProperty, value); - } - else - { - SetInternalCursorBlinkIntervalProperty(this,null, value); - } - } + get => (float?)GetValue(CursorBlinkIntervalProperty); + set => SetValue(CursorBlinkIntervalProperty, value); } /// 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 float? CursorBlinkDuration { - get - { - if (NUIApplication.IsUsingXaml) - { - return (float?)GetValue(CursorBlinkDurationProperty); - } - else - { - return (float?)GetInternalCursorBlinkDurationProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(CursorBlinkDurationProperty, value); - } - else - { - SetInternalCursorBlinkDurationProperty(this,null, value); - } - } + get => (float?)GetValue(CursorBlinkDurationProperty); + set => SetValue(CursorBlinkDurationProperty, value); } /// 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 int? CursorWidth { - get - { - if (NUIApplication.IsUsingXaml) - { - return (int?)GetValue(CursorWidthProperty); - } - else - { - return (int?)GetInternalCursorWidthProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(CursorWidthProperty, value); - } - else - { - SetInternalCursorWidthProperty(this,null, value); - } - } + get => (int?)GetValue(CursorWidthProperty); + set => SetValue(CursorWidthProperty, value); } /// This will be public opened in tizen_6.5 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public Color GrabHandleColor { - get - { - if (NUIApplication.IsUsingXaml) - { - return (Color)GetValue(GrabHandleColorProperty); - } - else - { - return (Color)GetInternalGrabHandleColorProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(GrabHandleColorProperty, value); - } - else - { - SetInternalGrabHandleColorProperty(this,null, value); - } - } + get => (Color)GetValue(GrabHandleColorProperty); + set => SetValue(GrabHandleColorProperty, value); } /// 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 string GrabHandleImage { - get - { - if (NUIApplication.IsUsingXaml) - { - return (string)GetValue(GrabHandleImageProperty); - } - else - { - return (string)GetInternalGrabHandleImageProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(GrabHandleImageProperty, value); - } - else - { - SetInternalGrabHandleImageProperty(this,null, value); - } - } + get => (string)GetValue(GrabHandleImageProperty); + set => SetValue(GrabHandleImageProperty, value); } /// 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 string GrabHandlePressedImage { - get - { - if (NUIApplication.IsUsingXaml) - { - return (string)GetValue(GrabHandlePressedImageProperty); - } - else - { - return (string)GetInternalGrabHandlePressedImageProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(GrabHandlePressedImageProperty, value); - } - else - { - SetInternalGrabHandlePressedImageProperty(this,null, value); - } - } + get => (string)GetValue(GrabHandlePressedImageProperty); + set => SetValue(GrabHandlePressedImageProperty, value); } - /// This will be public opened in tizen_6.5 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public PropertyMap SelectionHandleImageLeft { - get - { - if (NUIApplication.IsUsingXaml) - { - return (PropertyMap)GetValue(SelectionHandleImageLeftProperty); - } - else - { - return (PropertyMap)GetInternalSelectionHandleImageLeftProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(SelectionHandleImageLeftProperty, value); - } - else - { - SetInternalSelectionHandleImageLeftProperty(this,null, value); - } - } + get => (PropertyMap)GetValue(SelectionHandleImageLeftProperty); + set => SetValue(SelectionHandleImageLeftProperty, value); } - /// This will be public opened in tizen_6.5 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public PropertyMap SelectionHandleImageRight { - get - { - if (NUIApplication.IsUsingXaml) - { - return (PropertyMap)GetValue(SelectionHandleImageRightProperty); - } - else - { - return (PropertyMap)GetInternalSelectionHandleImageRightProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(SelectionHandleImageRightProperty, value); - } - else - { - SetInternalSelectionHandleImageRightProperty(this,null, value); - } - } + get => (PropertyMap)GetValue(SelectionHandleImageRightProperty); + set => SetValue(SelectionHandleImageRightProperty, value); } - /// 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 float? ScrollThreshold { - get - { - if (NUIApplication.IsUsingXaml) - { - return (float?)GetValue(ScrollThresholdProperty); - } - else - { - return (float?)GetInternalScrollThresholdProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(ScrollThresholdProperty, value); - } - else - { - SetInternalScrollThresholdProperty(this, null, value); - } - } + get => (float?)GetValue(ScrollThresholdProperty); + set => SetValue(ScrollThresholdProperty, value); } /// 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 float? ScrollSpeed { - get - { - if (NUIApplication.IsUsingXaml) - { - return (float?)GetValue(ScrollSpeedProperty); - } - else - { - return (float?)GetInternalScrollSpeedProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(ScrollSpeedProperty, value); - } - else - { - SetInternalScrollSpeedProperty(this, null, value); - } - } + get => (float?)GetValue(ScrollSpeedProperty); + set => SetValue(ScrollSpeedProperty, value); } /// 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 Vector4 SelectionHighlightColor { - get - { - if (NUIApplication.IsUsingXaml) - { - return (Vector4)GetValue(SelectionHighlightColorProperty); - } - else - { - return (Vector4)GetInternalSelectionHighlightColorProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(SelectionHighlightColorProperty, value); - } - else - { - SetInternalSelectionHighlightColorProperty(this, null, value); - } - } + get => (Vector4)GetValue(SelectionHighlightColorProperty); + set => SetValue(SelectionHighlightColorProperty, value); } /// 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 Rectangle DecorationBoundingBox { - get - { - if (NUIApplication.IsUsingXaml) - { - return (Rectangle)GetValue(DecorationBoundingBoxProperty); - } - else - { - return (Rectangle)GetInternalDecorationBoundingBoxProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(DecorationBoundingBoxProperty, value); - } - else - { - SetInternalDecorationBoundingBoxProperty(this, null, value); - } - } + get => (Rectangle)GetValue(DecorationBoundingBoxProperty); + set => SetValue(DecorationBoundingBoxProperty, value); } /// 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 Vector4 InputColor { - get - { - if (NUIApplication.IsUsingXaml) - { - return (Vector4)GetValue(InputColorProperty); - } - else - { - return (Vector4)GetInternalInputColorProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(InputColorProperty, value); - } - else - { - SetInternalInputColorProperty(this, null, value); - } - } + get => (Vector4)GetValue(InputColorProperty); + set => SetValue(InputColorProperty, value); } /// 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 bool? EnableMarkup { - get - { - if (NUIApplication.IsUsingXaml) - { - return (bool?)GetValue(EnableMarkupProperty); - } - else - { - return (bool?)GetInternalEnableMarkupProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(EnableMarkupProperty, value); - } - else - { - SetInternalEnableMarkupProperty(this, null, value); - } - } + get => (bool?)GetValue(EnableMarkupProperty); + set => SetValue(EnableMarkupProperty, value); } /// 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 string InputFontFamily { - get - { - if (NUIApplication.IsUsingXaml) - { - return (string)GetValue(InputFontFamilyProperty); - } - else - { - return (string)GetInternalInputFontFamilyProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(InputFontFamilyProperty, value); - } - else - { - SetInternalInputFontFamilyProperty(this, null, value); - } - } + get => (string)GetValue(InputFontFamilyProperty); + set => SetValue(InputFontFamilyProperty, value); } /// 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 float? InputPointSize { - get - { - if (NUIApplication.IsUsingXaml) - { - return (float?)GetValue(InputPointSizeProperty); - } - else - { - return (float?)GetInternalInputPointSizeProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(InputPointSizeProperty, value); - } - else - { - SetInternalInputPointSizeProperty(this, null, value); - } - } + get => (float?)GetValue(InputPointSizeProperty); + set => SetValue(InputPointSizeProperty, value); } /// 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 string InputUnderline { - get - { - if (NUIApplication.IsUsingXaml) - { - return (string)GetValue(InputUnderlineProperty); - } - else - { - return (string)GetInternalInputUnderlineProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(InputUnderlineProperty, value); - } - else - { - SetInternalInputUnderlineProperty(this, null, value); - } - } + get => (string)GetValue(InputUnderlineProperty); + set => SetValue(InputUnderlineProperty, value); } /// 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 string InputShadow { - get - { - if (NUIApplication.IsUsingXaml) - { - return (string)GetValue(InputShadowProperty); - } - else - { - return (string)GetInternalInputShadowProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(InputShadowProperty, value); - } - else - { - SetInternalInputShadowProperty(this, null, value); - } - } + get => (string)GetValue(InputShadowProperty); + set => SetValue(InputShadowProperty, value); } /// 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 string Emboss { - get - { - if (NUIApplication.IsUsingXaml) - { - return (string)GetValue(EmbossProperty); - } - else - { - return (string)GetInternalEmbossProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(EmbossProperty, value); - } - else - { - SetInternalEmbossProperty(this, null, value); - } - } + get => (string)GetValue(EmbossProperty); + set => SetValue(EmbossProperty, value); } /// 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 string InputEmboss { - get - { - if (NUIApplication.IsUsingXaml) - { - return (string)GetValue(InputEmbossProperty); - } - else - { - return (string)GetInternalInputEmbossProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(InputEmbossProperty, value); - } - else - { - SetInternalInputEmbossProperty(this, null, value); - } - } + get => (string)GetValue(InputEmbossProperty); + set => SetValue(InputEmbossProperty, value); } /// 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 string InputOutline { - get - { - if (NUIApplication.IsUsingXaml) - { - return (string)GetValue(InputOutlineProperty); - } - else - { - return (string)GetInternalInputOutlineProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(InputOutlineProperty, value); - } - else - { - SetInternalInputOutlineProperty(this, null, value); - } - } + get => (string)GetValue(InputOutlineProperty); + set => SetValue(InputOutlineProperty, value); } /// 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 float? PixelSize { - get - { - if (NUIApplication.IsUsingXaml) - { - return (float?)GetValue(PixelSizeProperty); - } - else - { - return (float?)GetInternalPixelSizeProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(PixelSizeProperty, value); - } - else - { - SetInternalPixelSizeProperty(this, null, value); - } - } + get => (float?)GetValue(PixelSizeProperty); + set => SetValue(PixelSizeProperty, value); } /// 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 bool? EnableSelection { - get - { - if (NUIApplication.IsUsingXaml) - { - return (bool?)GetValue(EnableSelectionProperty); - } - else - { - return (bool?)GetInternalEnableSelectionProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(EnableSelectionProperty, value); - } - else - { - SetInternalEnableSelectionProperty(this, null, value); - } - } + get => (bool?)GetValue(EnableSelectionProperty); + set => SetValue(EnableSelectionProperty, value); } /// 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 bool? Ellipsis { - get - { - if (NUIApplication.IsUsingXaml) - { - return (bool?)GetValue(EllipsisProperty); - } - else - { - return (bool?)GetInternalEllipsisProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(EllipsisProperty, value); - } - else - { - SetInternalEllipsisProperty(this, null, value); - } - } + get => (bool?)GetValue(EllipsisProperty); + set => SetValue(EllipsisProperty, value); } /// 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 bool? MatchSystemLanguageDirection { - get - { - if (NUIApplication.IsUsingXaml) - { - return (bool?)GetValue(MatchSystemLanguageDirectionProperty); - } - else - { - return (bool?)GetInternalMatchSystemLanguageDirectionProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(MatchSystemLanguageDirectionProperty, value); - } - else - { - SetInternalMatchSystemLanguageDirectionProperty(this, null, value); - } - } + get => (bool?)GetValue(MatchSystemLanguageDirectionProperty); + set => SetValue(MatchSystemLanguageDirectionProperty, value); } /// 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 Color TextColor { - get - { - if (NUIApplication.IsUsingXaml) - { - return (Color)GetValue(TextColorProperty); - } - else - { - return (Color)GetInternalTextColorProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(TextColorProperty, value); - } - else - { - SetInternalTextColorProperty(this, null, value); - } - } + get => (Color)GetValue(TextColorProperty); + set => SetValue(TextColorProperty, value); } /// 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 float? PointSize { - get - { - if (NUIApplication.IsUsingXaml) - { - return (float?)GetValue(PointSizeProperty); - } - else - { - return (float?)GetInternalPointSizeProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(PointSizeProperty, value); - } - else - { - SetInternalPointSizeProperty(this, null, value); - } - } + get => (float?)GetValue(PointSizeProperty); + set => SetValue(PointSizeProperty, value); } [EditorBrowsable(EditorBrowsableState.Never)] public float? FontSizeScale { - get - { - if (NUIApplication.IsUsingXaml) - { - return (float?)GetValue(FontSizeScaleProperty); - } - else - { - return (float?)GetInternalFontSizeScaleProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(FontSizeScaleProperty, value); - } - else - { - SetInternalFontSizeScaleProperty(this, null, value); - } - } + get => (float?)GetValue(FontSizeScaleProperty); + set => SetValue(FontSizeScaleProperty, value); } /// 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 Vector4 PlaceholderTextColor { - get - { - if (NUIApplication.IsUsingXaml) - { - return (Vector4)GetValue(PlaceholderTextColorProperty); - } - else - { - return (Vector4)GetInternalPlaceholderTextColorProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(PlaceholderTextColorProperty, value); - } - else - { - SetInternalPlaceholderTextColorProperty(this, null, value); - } - } + get => (Vector4)GetValue(PlaceholderTextColorProperty); + set => SetValue(PlaceholderTextColorProperty, value); } /// @@ -1808,83 +386,23 @@ public Vector4 PlaceholderTextColor [EditorBrowsable(EditorBrowsableState.Never)] public Vector4 PrimaryCursorColor { - get - { - if (NUIApplication.IsUsingXaml) - { - return (Vector4)GetValue(PrimaryCursorColorProperty); - } - else - { - return (Vector4)GetInternalPrimaryCursorColorProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(PrimaryCursorColorProperty, value); - } - else - { - SetInternalPrimaryCursorColorProperty(this, null, value); - } - } + get => (Vector4)GetValue(PrimaryCursorColorProperty); + set => SetValue(PrimaryCursorColorProperty, value); } /// This will be public opened in tizen_6.5 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public PropertyMap FontStyle { - get - { - if (NUIApplication.IsUsingXaml) - { - return (PropertyMap)GetValue(FontStyleProperty); - } - else - { - return (PropertyMap)GetInternalFontStyleProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(FontStyleProperty, value); - } - else - { - SetInternalFontStyleProperty(this, null, value); - } - } + get => (PropertyMap)GetValue(FontStyleProperty); + set => SetValue(FontStyleProperty, value); } [EditorBrowsable(EditorBrowsableState.Never)] public PropertyMap SelectionPopupStyle { - get - { - if (NUIApplication.IsUsingXaml) - { - return (PropertyMap)GetValue(SelectionPopupStyleProperty); - } - else - { - return (PropertyMap)GetInternalSelectionPopupStyleProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(SelectionPopupStyleProperty, value); - } - else - { - SetInternalSelectionPopupStyleProperty(this, null, value); - } - } + get => (PropertyMap)GetValue(SelectionPopupStyleProperty); + set => SetValue(SelectionPopupStyleProperty, value); } } } diff --git a/src/Tizen.NUI/src/public/BaseComponents/Style/TextLabelStyle.cs b/src/Tizen.NUI/src/public/BaseComponents/Style/TextLabelStyle.cs index 4a35713e0e7..9b8579137e0 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/Style/TextLabelStyle.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/Style/TextLabelStyle.cs @@ -15,7 +15,6 @@ * */ using System.ComponentModel; -using Tizen.NUI.Binding; namespace Tizen.NUI.BaseComponents { @@ -26,504 +25,38 @@ namespace Tizen.NUI.BaseComponents [EditorBrowsable(EditorBrowsableState.Never)] public class TextLabelStyle : ViewStyle { - /// 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 static readonly BindableProperty TranslatableTextSelectorProperty = null; - internal static void SetInternalTranslatableTextSelectorProperty(BindableObject bindable, object oldValue, object newValue) - { - ((TextLabelStyle)bindable).translatableTextSelector = ((Selector)newValue)?.Clone(); - } - internal static object GetInternalTranslatableTextSelectorProperty(BindableObject bindable) - { - return ((TextLabelStyle)bindable).translatableTextSelector; - } - - /// 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 static readonly BindableProperty TextSelectorProperty = null; - internal static void SetInternalTextSelectorProperty(BindableObject bindable, object oldValue, object newValue) - { - ((TextLabelStyle)bindable).textSelector = ((Selector)newValue)?.Clone(); - } - internal static object GetInternalTextSelectorProperty(BindableObject bindable) - { - return ((TextLabelStyle)bindable).textSelector; - } - - /// 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 static readonly BindableProperty FontFamilySelectorProperty = null; - internal static void SetInternalFontFamilySelectorProperty(BindableObject bindable, object oldValue, object newValue) - { - ((TextLabelStyle)bindable).fontFamilySelector = ((Selector)newValue)?.Clone(); - } - internal static object GetInternalFontFamilySelectorProperty(BindableObject bindable) - { - return ((TextLabelStyle)bindable).fontFamilySelector; - } - - /// 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 static readonly BindableProperty PointSizeSelectorProperty = null; - internal static void SetInternalPointSizeSelectorProperty(BindableObject bindable, object oldValue, object newValue) - { - ((TextLabelStyle)bindable).pointSizeSelector = ((Selector)newValue)?.Clone(); - } - internal static object GetInternalPointSizeSelectorProperty(BindableObject bindable) - { - return ((TextLabelStyle)bindable).pointSizeSelector; - } - - /// 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 static readonly BindableProperty TextColorSelectorProperty = null; - internal static void SetInternalTextColorSelectorProperty(BindableObject bindable, object oldValue, object newValue) - { - ((TextLabelStyle)bindable).textColorSelector = ((Selector)newValue)?.Clone(); - } - internal static object GetInternalTextColorSelectorProperty(BindableObject bindable) - { - return ((TextLabelStyle)bindable).textColorSelector; - } - - /// 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 static readonly BindableProperty MultiLineProperty = null; - internal static void SetInternalMultiLineProperty(BindableObject bindable, object oldValue, object newValue) - { - var textLabelStyle = (TextLabelStyle)bindable; - textLabelStyle.multiLine = (bool?)newValue; - } - internal static object GetInternalMultiLineProperty(BindableObject bindable) - { - var textLabelStyle = (TextLabelStyle)bindable; - return textLabelStyle.multiLine; - } - - /// 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 static readonly BindableProperty HorizontalAlignmentProperty = null; - internal static void SetInternalHorizontalAlignmentProperty(BindableObject bindable, object oldValue, object newValue) - { - var textLabelStyle = (TextLabelStyle)bindable; - textLabelStyle.horizontalAlignment = (HorizontalAlignment?)newValue; - } - internal static object GetInternalHorizontalAlignmentProperty(BindableObject bindable) - { - var textLabelStyle = (TextLabelStyle)bindable; - return textLabelStyle.horizontalAlignment; - } - - /// 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 static readonly BindableProperty VerticalAlignmentProperty = null; - internal static void SetInternalVerticalAlignmentProperty(BindableObject bindable, object oldValue, object newValue) - { - var textLabelStyle = (TextLabelStyle)bindable; - textLabelStyle.verticalAlignment = (VerticalAlignment?)newValue; - } - internal static object GetInternalVerticalAlignmentProperty(BindableObject bindable) - { - var textLabelStyle = (TextLabelStyle)bindable; - return textLabelStyle.verticalAlignment; - } - - /// 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 static readonly BindableProperty EnableMarkupProperty = null; - internal static void SetInternalEnableMarkupProperty(BindableObject bindable, object oldValue, object newValue) - { - var textLabelStyle = (TextLabelStyle)bindable; - textLabelStyle.enableMarkup = (bool?)newValue; - } - internal static object GetInternalEnableMarkupProperty(BindableObject bindable) - { - var textLabelStyle = (TextLabelStyle)bindable; - return textLabelStyle.enableMarkup; - } - - /// 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 static readonly BindableProperty EnableAutoScrollProperty = null; - internal static void SetInternalEnableAutoScrollProperty(BindableObject bindable, object oldValue, object newValue) - { - var textLabelStyle = (TextLabelStyle)bindable; - textLabelStyle.enableAutoScroll = (bool?)newValue; - } - internal static object GetInternalEnableAutoScrollProperty(BindableObject bindable) - { - var textLabelStyle = (TextLabelStyle)bindable; - return textLabelStyle.enableAutoScroll; - } - - /// 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 static readonly BindableProperty AutoScrollSpeedProperty = null; - internal static void SetInternalAutoScrollSpeedProperty(BindableObject bindable, object oldValue, object newValue) - { - var textLabelStyle = (TextLabelStyle)bindable; - textLabelStyle.autoScrollSpeed = (int?)newValue; - } - internal static object GetInternalAutoScrollSpeedProperty(BindableObject bindable) - { - var textLabelStyle = (TextLabelStyle)bindable; - return textLabelStyle.autoScrollSpeed; - } - - /// 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 static readonly BindableProperty AutoScrollLoopCountProperty = null; - internal static void SetInternalAutoScrollLoopCountProperty(BindableObject bindable, object oldValue, object newValue) - { - var textLabelStyle = (TextLabelStyle)bindable; - textLabelStyle.autoScrollLoopCount = (int?)newValue; - } - internal static object GetInternalAutoScrollLoopCountProperty(BindableObject bindable) - { - var textLabelStyle = (TextLabelStyle)bindable; - return textLabelStyle.autoScrollLoopCount; - } - - /// 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 static readonly BindableProperty AutoScrollGapProperty = null; - internal static void SetInternalAutoScrollGapProperty(BindableObject bindable, object oldValue, object newValue) - { - var textLabelStyle = (TextLabelStyle)bindable; - textLabelStyle.autoScrollGap = (float?)newValue; - } - internal static object GetInternalAutoScrollGapProperty(BindableObject bindable) - { - var textLabelStyle = (TextLabelStyle)bindable; - return textLabelStyle.autoScrollGap; - } - - /// 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 static readonly BindableProperty LineSpacingProperty = null; - internal static void SetInternalLineSpacingProperty(BindableObject bindable, object oldValue, object newValue) - { - var textLabelStyle = (TextLabelStyle)bindable; - textLabelStyle.lineSpacing = (float?)newValue; - } - internal static object GetInternalLineSpacingProperty(BindableObject bindable) - { - var textLabelStyle = (TextLabelStyle)bindable; - return textLabelStyle.lineSpacing; - } - - /// The bindable property of RelativeLineHeightProperty. - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty RelativeLineHeightProperty = null; - internal static void SetInternalRelativeLineHeightProperty(BindableObject bindable, object oldValue, object newValue) - { - var textLabelStyle = (TextLabelStyle)bindable; - textLabelStyle.relativeLineHeight = (float?)newValue; - } - internal static object GetInternalRelativeLineHeightProperty(BindableObject bindable) - { - var textLabelStyle = (TextLabelStyle)bindable; - return textLabelStyle.relativeLineHeight; - } - - /// 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 static readonly BindableProperty EmbossProperty = null; - internal static void SetInternalEmbossProperty(BindableObject bindable, object oldValue, object newValue) - { - var textLabelStyle = (TextLabelStyle)bindable; - textLabelStyle.emboss = (string)newValue; - } - internal static object GetInternalEmbossProperty(BindableObject bindable) - { - var textLabelStyle = (TextLabelStyle)bindable; - return textLabelStyle.emboss; - } - - /// 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 static readonly BindableProperty PixelSizeSelectorProperty = null; - internal static void SetInternalPixelSizeSelectorProperty(BindableObject bindable, object oldValue, object newValue) - { - ((TextLabelStyle)bindable).pixelSizeSelector = ((Selector)newValue)?.Clone(); - } - internal static object GetInternalPixelSizeSelectorProperty(BindableObject bindable) - { - return ((TextLabelStyle)bindable).pixelSizeSelector; - } - - /// 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 static readonly BindableProperty EllipsisProperty = null; - internal static void SetInternalEllipsisProperty(BindableObject bindable, object oldValue, object newValue) - { - var textLabelStyle = (TextLabelStyle)bindable; - textLabelStyle.ellipsis = (bool?)newValue; - } - internal static object GetInternalEllipsisProperty(BindableObject bindable) - { - var textLabelStyle = (TextLabelStyle)bindable; - return textLabelStyle.ellipsis; - } - - /// 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 static readonly BindableProperty AutoScrollLoopDelayProperty = null; - internal static void SetInternalAutoScrollLoopDelayProperty(BindableObject bindable, object oldValue, object newValue) - { - var textLabelStyle = (TextLabelStyle)bindable; - textLabelStyle.autoScrollLoopDelay = (float?)newValue; - } - internal static object GetInternalAutoScrollLoopDelayProperty(BindableObject bindable) - { - var textLabelStyle = (TextLabelStyle)bindable; - return textLabelStyle.autoScrollLoopDelay; - } - - /// 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 static readonly BindableProperty AutoScrollStopModeProperty = null; - internal static void SetInternalAutoScrollStopModeProperty(BindableObject bindable, object oldValue, object newValue) - { - var textLabelStyle = (TextLabelStyle)bindable; - textLabelStyle.autoScrollStopMode = (AutoScrollStopMode?)newValue; - } - internal static object GetInternalAutoScrollStopModeProperty(BindableObject bindable) - { - var textLabelStyle = (TextLabelStyle)bindable; - return textLabelStyle.autoScrollStopMode; - } - - /// 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 static readonly BindableProperty LineWrapModeProperty = null; - internal static void SetInternalLineWrapModeProperty(BindableObject bindable, object oldValue, object newValue) - { - var textLabelStyle = (TextLabelStyle)bindable; - textLabelStyle.lineWrapMode = (LineWrapMode?)newValue; - } - internal static object GetInternalLineWrapModeProperty(BindableObject bindable) - { - var textLabelStyle = (TextLabelStyle)bindable; - return textLabelStyle.lineWrapMode; - } - - /// 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 static readonly BindableProperty VerticalLineAlignmentProperty = null; - internal static void SetInternalVerticalLineAlignmentProperty(BindableObject bindable, object oldValue, object newValue) - { - var textLabelStyle = (TextLabelStyle)bindable; - textLabelStyle.verticalLineAlignment = (VerticalLineAlignment?)newValue; - } - internal static object GetInternalVerticalLineAlignmentProperty(BindableObject bindable) - { - var textLabelStyle = (TextLabelStyle)bindable; - return textLabelStyle.verticalLineAlignment; - } - - /// This will be public opened in tizen_6.5 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty EllipsisPositionProperty = null; - internal static void SetInternalEllipsisPositionProperty(BindableObject bindable, object oldValue, object newValue) - { - var textLabelStyle = (TextLabelStyle)bindable; - textLabelStyle.ellipsisPosition = (EllipsisPosition?)newValue; - } - internal static object GetInternalEllipsisPositionProperty(BindableObject bindable) - { - var textLabelStyle = (TextLabelStyle)bindable; - return textLabelStyle.ellipsisPosition; - } - - /// This will be public opened in tizen_6.5 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty CharacterSpacingProperty = null; - internal static void SetInternalCharacterSpacingProperty(BindableObject bindable, object oldValue, object newValue) - { - var textLabelStyle = (TextLabelStyle)bindable; - textLabelStyle.characterSpacing = (float?)newValue; - } - internal static object GetInternalCharacterSpacingProperty(BindableObject bindable) - { - var textLabelStyle = (TextLabelStyle)bindable; - return textLabelStyle.characterSpacing; - } - - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty FontSizeScaleProperty = null; - internal static void SetInternalFontSizeScaleProperty(BindableObject bindable, object oldValue, object newValue) - { - var textLabelStyle = (TextLabelStyle)bindable; - textLabelStyle.fontSizeScale = (float?)newValue; - } - internal static object GetInternalFontSizeScaleProperty(BindableObject bindable) - { - var textLabelStyle = (TextLabelStyle)bindable; - return textLabelStyle.fontSizeScale; - } - - public static readonly BindableProperty AnchorColorProperty = null; - internal static void SetInternalAnchorColorProperty(BindableObject bindable, object oldValue, object newValue) - { - var textLabelStyle = (TextLabelStyle)bindable; - textLabelStyle.anchorColor = (Color)newValue; - } - internal static object GetInternalAnchorColorProperty(BindableObject bindable) - { - var textLabelStyle = (TextLabelStyle)bindable; - return textLabelStyle.anchorColor; - } - - public static readonly BindableProperty AnchorClickedColorProperty = null; - internal static void SetInternalAnchorClickedColorProperty(BindableObject bindable, object oldValue, object newValue) - { - var textLabelStyle = (TextLabelStyle)bindable; - textLabelStyle.anchorClickedColor = (Color)newValue; - } - internal static object GetInternalAnchorClickedColorProperty(BindableObject bindable) - { - var textLabelStyle = (TextLabelStyle)bindable; - return textLabelStyle.anchorClickedColor; - } - - /// 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 static readonly BindableProperty MatchSystemLanguageDirectionProperty = null; - internal static void SetInternalMatchSystemLanguageDirectionProperty(BindableObject bindable, object oldValue, object newValue) - { - var textLabelStyle = (TextLabelStyle)bindable; - textLabelStyle.matchSystemLanguageDirection = (bool?)newValue; - } - internal static object GetInternalMatchSystemLanguageDirectionProperty(BindableObject bindable) - { - var textLabelStyle = (TextLabelStyle)bindable; - return textLabelStyle.matchSystemLanguageDirection; - } - - /// A BindableProperty for ImageShadow - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty TextShadowProperty = null; - internal static void SetInternalTextShadowProperty(BindableObject bindable, object oldValue, object newValue) - { - ((TextLabelStyle)bindable).textShadow = ((Selector)newValue)?.Clone(); - } - internal static object GetInternalTextShadowProperty(BindableObject bindable) - { - return ((TextLabelStyle)bindable).textShadow; - } - - /// This will be public opened in tizen_6.5 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty FontStyleProperty = null; - internal static void SetInternalFontStyleProperty(BindableObject bindable, object oldValue, object newValue) - { - var textLabelStyle = (TextLabelStyle)bindable; - textLabelStyle.fontStyle = (PropertyMap)newValue; - } - internal static object GetInternalFontStyleProperty(BindableObject bindable) - { - var textLabelStyle = (TextLabelStyle)bindable; - return textLabelStyle.fontStyle; - } - - private bool? multiLine; - private HorizontalAlignment? horizontalAlignment; - private VerticalAlignment? verticalAlignment; - private bool? enableMarkup; - private bool? enableAutoScroll; - private int? autoScrollSpeed; - private int? autoScrollLoopCount; - private float? autoScrollGap; - private float? lineSpacing; - private float? relativeLineHeight; - private string emboss; - private Selector pixelSizeSelector; - private bool? ellipsis; - private float? autoScrollLoopDelay; - private AutoScrollStopMode? autoScrollStopMode; - private LineWrapMode? lineWrapMode; - private VerticalLineAlignment? verticalLineAlignment; - private EllipsisPosition? ellipsisPosition; - private bool? matchSystemLanguageDirection; - private Selector translatableTextSelector; - private Selector fontFamilySelector; - private Selector textSelector; - private Selector textColorSelector; - private Selector pointSizeSelector; - private Selector textShadow; - private PropertyMap fontStyle; - private float? characterSpacing; - private float? fontSizeScale; - private Color anchorColor; - private Color anchorClickedColor; - - static TextLabelStyle() - { - if (NUIApplication.IsUsingXaml) - { - TranslatableTextSelectorProperty = BindableProperty.Create(nameof(TranslatableText), typeof(Selector), typeof(TextLabelStyle), null, - propertyChanged: SetInternalTranslatableTextSelectorProperty, defaultValueCreator: GetInternalTranslatableTextSelectorProperty); - TextSelectorProperty = BindableProperty.Create(nameof(Text), typeof(Selector), typeof(TextLabelStyle), null, - propertyChanged: SetInternalTextSelectorProperty, defaultValueCreator: GetInternalTextSelectorProperty); - FontFamilySelectorProperty = BindableProperty.Create(nameof(FontFamily), typeof(Selector), typeof(TextLabelStyle), null, - propertyChanged: SetInternalFontFamilySelectorProperty, defaultValueCreator: GetInternalFontFamilySelectorProperty); - PointSizeSelectorProperty = BindableProperty.Create(nameof(PointSize), typeof(Selector), typeof(TextLabelStyle), null, - propertyChanged: SetInternalPointSizeSelectorProperty, defaultValueCreator: GetInternalPointSizeSelectorProperty); - TextColorSelectorProperty = BindableProperty.Create(nameof(TextColor), typeof(Selector), typeof(TextLabelStyle), null, - propertyChanged: SetInternalTextColorSelectorProperty, defaultValueCreator: GetInternalTextColorSelectorProperty); - MultiLineProperty = BindableProperty.Create(nameof(MultiLine), typeof(bool?), typeof(TextLabelStyle), null, - propertyChanged: SetInternalMultiLineProperty, defaultValueCreator: GetInternalMultiLineProperty); - HorizontalAlignmentProperty = BindableProperty.Create(nameof(HorizontalAlignment), typeof(HorizontalAlignment?), typeof(TextLabelStyle), null, - propertyChanged: SetInternalHorizontalAlignmentProperty, defaultValueCreator: GetInternalHorizontalAlignmentProperty); - VerticalAlignmentProperty = BindableProperty.Create(nameof(VerticalAlignment), typeof(VerticalAlignment?), typeof(TextLabelStyle), null, - propertyChanged: SetInternalVerticalAlignmentProperty, defaultValueCreator: GetInternalVerticalAlignmentProperty); - EnableMarkupProperty = BindableProperty.Create(nameof(EnableMarkup), typeof(bool?), typeof(TextLabelStyle), null, - propertyChanged: SetInternalEnableMarkupProperty, defaultValueCreator: GetInternalEnableMarkupProperty); - EnableAutoScrollProperty = BindableProperty.Create(nameof(EnableAutoScroll), typeof(bool?), typeof(TextLabelStyle), null, - propertyChanged: SetInternalEnableAutoScrollProperty, defaultValueCreator: GetInternalEnableAutoScrollProperty); - AutoScrollSpeedProperty = BindableProperty.Create(nameof(AutoScrollSpeed), typeof(int?), typeof(TextLabelStyle), null, - propertyChanged: SetInternalAutoScrollSpeedProperty, defaultValueCreator: GetInternalAutoScrollSpeedProperty); - AutoScrollLoopCountProperty = BindableProperty.Create(nameof(AutoScrollLoopCount), typeof(int?), typeof(TextLabelStyle), null, - propertyChanged: SetInternalAutoScrollLoopCountProperty, defaultValueCreator: GetInternalAutoScrollLoopCountProperty); - AutoScrollGapProperty = BindableProperty.Create(nameof(AutoScrollGap), typeof(float?), typeof(TextLabelStyle), null, - propertyChanged: SetInternalAutoScrollGapProperty, defaultValueCreator: GetInternalAutoScrollGapProperty); - LineSpacingProperty = BindableProperty.Create(nameof(LineSpacing), typeof(float?), typeof(TextLabelStyle), null, - propertyChanged: SetInternalLineSpacingProperty, defaultValueCreator: GetInternalLineSpacingProperty); - RelativeLineHeightProperty = BindableProperty.Create(nameof(RelativeLineHeight), typeof(float?), typeof(TextLabelStyle), null, - propertyChanged: SetInternalRelativeLineHeightProperty, defaultValueCreator: GetInternalRelativeLineHeightProperty); - EmbossProperty = BindableProperty.Create(nameof(Emboss), typeof(string), typeof(TextLabelStyle), null, - propertyChanged: SetInternalEmbossProperty, defaultValueCreator: GetInternalEmbossProperty); - PixelSizeSelectorProperty = BindableProperty.Create(nameof(PixelSize), typeof(Selector), typeof(TextLabelStyle), null, - propertyChanged: SetInternalPixelSizeSelectorProperty, defaultValueCreator: GetInternalPixelSizeSelectorProperty); - EllipsisProperty = BindableProperty.Create(nameof(Ellipsis), typeof(bool?), typeof(TextLabelStyle), null, - propertyChanged: SetInternalEllipsisProperty, defaultValueCreator: GetInternalEllipsisProperty); - AutoScrollLoopDelayProperty = BindableProperty.Create(nameof(AutoScrollLoopDelay), typeof(float?), typeof(TextLabelStyle), null, - propertyChanged: SetInternalAutoScrollLoopDelayProperty, defaultValueCreator: GetInternalAutoScrollLoopDelayProperty); - AutoScrollStopModeProperty = BindableProperty.Create(nameof(AutoScrollStopMode), typeof(AutoScrollStopMode?), typeof(TextLabelStyle), null, - propertyChanged: SetInternalAutoScrollStopModeProperty, defaultValueCreator: GetInternalAutoScrollStopModeProperty); - LineWrapModeProperty = BindableProperty.Create(nameof(LineWrapMode), typeof(LineWrapMode?), typeof(TextLabelStyle), null, - propertyChanged: SetInternalLineWrapModeProperty, defaultValueCreator: GetInternalLineWrapModeProperty); - VerticalLineAlignmentProperty = BindableProperty.Create(nameof(VerticalLineAlignment), typeof(VerticalLineAlignment?), typeof(TextLabelStyle), null, - propertyChanged: SetInternalVerticalLineAlignmentProperty, defaultValueCreator: GetInternalVerticalLineAlignmentProperty); - EllipsisPositionProperty = BindableProperty.Create(nameof(EllipsisPosition), typeof(EllipsisPosition?), typeof(TextLabelStyle), null, - propertyChanged: SetInternalEllipsisPositionProperty, defaultValueCreator: GetInternalEllipsisPositionProperty); - CharacterSpacingProperty = BindableProperty.Create(nameof(CharacterSpacing), typeof(float?), typeof(TextLabelStyle), null, - propertyChanged: SetInternalCharacterSpacingProperty, defaultValueCreator: GetInternalCharacterSpacingProperty); - FontSizeScaleProperty = BindableProperty.Create(nameof(FontSizeScale), typeof(float?), typeof(TextLabelStyle), null, - propertyChanged: SetInternalFontSizeScaleProperty, defaultValueCreator: GetInternalFontSizeScaleProperty); - AnchorColorProperty = BindableProperty.Create(nameof(AnchorColor), typeof(Color), typeof(TextLabelStyle), null, - propertyChanged: SetInternalAnchorColorProperty, defaultValueCreator: GetInternalAnchorColorProperty); - AnchorClickedColorProperty = BindableProperty.Create(nameof(AnchorClickedColor), typeof(Color), typeof(TextLabelStyle), null, - propertyChanged: SetInternalAnchorClickedColorProperty, defaultValueCreator: GetInternalAnchorClickedColorProperty); - MatchSystemLanguageDirectionProperty = BindableProperty.Create(nameof(MatchSystemLanguageDirection), typeof(bool?), typeof(TextLabelStyle), null, - propertyChanged: SetInternalMatchSystemLanguageDirectionProperty, defaultValueCreator: GetInternalMatchSystemLanguageDirectionProperty); - TextShadowProperty = BindableProperty.Create(nameof(TextShadow), typeof(Selector), typeof(TextLabelStyle), null, - propertyChanged: SetInternalTextShadowProperty, defaultValueCreator: GetInternalTextShadowProperty); - FontStyleProperty = BindableProperty.Create(nameof(FontStyle), typeof(PropertyMap), typeof(TextLabelStyle), null, - propertyChanged: SetInternalFontStyleProperty, defaultValueCreator: GetInternalFontStyleProperty); - } - } + static readonly IStyleProperty TranslatableTextSelectorProperty = new StyleProperty>((v, o) => TextLabel.SetInternalTranslatableTextProperty(v, null, o)); + static readonly IStyleProperty FontFamilySelectorProperty = new StyleProperty>((v, o) => TextLabel.SetInternalFontFamilyProperty(v, null, o)); + static readonly IStyleProperty MultiLineProperty = new StyleProperty((v, o) => v.MultiLine = o); + static readonly IStyleProperty HorizontalAlignmentProperty = new StyleProperty((v, o) => v.HorizontalAlignment = o); + static readonly IStyleProperty VerticalAlignmentProperty = new StyleProperty((v, o) => v.VerticalAlignment = o); + static readonly IStyleProperty EnableMarkupProperty = new StyleProperty((v, o) => v.EnableMarkup = o); + static readonly IStyleProperty EnableAutoScrollProperty = new StyleProperty((v, o) => v.EnableAutoScroll = o); + static readonly IStyleProperty AutoScrollSpeedProperty = new StyleProperty((v, o) => v.AutoScrollSpeed = o); + static readonly IStyleProperty AutoScrollLoopCountProperty = new StyleProperty((v, o) => v.AutoScrollLoopCount = o); + static readonly IStyleProperty AutoScrollGapProperty = new StyleProperty((v, o) => v.AutoScrollGap = o); + static readonly IStyleProperty LineSpacingProperty = new StyleProperty((v, o) => v.LineSpacing = o); + static readonly IStyleProperty RelativeLineHeightProperty = new StyleProperty((v, o) => v.RelativeLineHeight = o); + static readonly IStyleProperty EmbossProperty = new StyleProperty((v, o) => v.Emboss = o); + static readonly IStyleProperty PixelSizeSelectorProperty = new StyleProperty>((v, o) => TextLabel.SetInternalPixelSizeProperty(v, null, o)); + static readonly IStyleProperty EllipsisProperty = new StyleProperty((v, o) => v.Ellipsis = o); + static readonly IStyleProperty AutoScrollLoopDelayProperty = new StyleProperty((v, o) => v.AutoScrollLoopDelay = o); + static readonly IStyleProperty AutoScrollStopModeProperty = new StyleProperty((v, o) => v.AutoScrollStopMode = o); + static readonly IStyleProperty LineWrapModeProperty = new StyleProperty((v, o) => v.LineWrapMode = o); + static readonly IStyleProperty VerticalLineAlignmentProperty = new StyleProperty((v, o) => v.VerticalLineAlignment = o); + static readonly IStyleProperty EllipsisPositionProperty = new StyleProperty((v, o) => v.EllipsisPosition = o); + static readonly IStyleProperty CharacterSpacingProperty = new StyleProperty((v, o) => v.CharacterSpacing = o); + static readonly IStyleProperty FontSizeScaleProperty = new StyleProperty((v, o) => v.FontSizeScale = o); + static readonly IStyleProperty AnchorColorProperty = new StyleProperty((v, o) => v.AnchorColor = o); + static readonly IStyleProperty AnchorClickedColorProperty = new StyleProperty((v, o) => v.AnchorClickedColor = o); + static readonly IStyleProperty MatchSystemLanguageDirectionProperty = new StyleProperty((v, o) => v.MatchSystemLanguageDirection = o); + static readonly IStyleProperty TextSelectorProperty = new StyleProperty>((v, o) => TextLabel.SetInternalTextProperty(v, null, o)); + static readonly IStyleProperty TextColorSelectorProperty = new StyleProperty>((v, o) => TextLabel.SetInternalTextColorProperty(v, null, o)); + static readonly IStyleProperty PointSizeSelectorProperty = new StyleProperty>((v, o) => TextLabel.SetInternalPointSizeProperty(v, null, o)); + static readonly IStyleProperty TextShadowProperty = new StyleProperty>((v, o) => TextLabel.SetInternalTextShadowProperty(v, null, o)); + static readonly IStyleProperty FontStyleProperty = new StyleProperty((v, o) => v.FontStyle = o); + + static TextLabelStyle() { } /// /// Create an empty instance. @@ -537,88 +70,24 @@ public TextLabelStyle() : base() [EditorBrowsable(EditorBrowsableState.Never)] public Selector TranslatableText { - get - { - Selector tmp = null; - if (NUIApplication.IsUsingXaml) - { - tmp = (Selector)GetValue(TranslatableTextSelectorProperty); - } - else - { - tmp = (Selector)GetInternalTranslatableTextSelectorProperty(this); - } - return (null != tmp) ? tmp : translatableTextSelector = new Selector(); - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(TranslatableTextSelectorProperty, value); - } - else - { - SetInternalTranslatableTextSelectorProperty(this, null, value); - } - } + get => GetOrCreateValue>(TranslatableTextSelectorProperty); + set => SetValue(TranslatableTextSelectorProperty, value); } /// 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 Selector FontFamily { - get - { - Selector tmp = null; - if (NUIApplication.IsUsingXaml) - { - tmp = (Selector)GetValue(FontFamilySelectorProperty); - } - else - { - tmp = (Selector)GetInternalFontFamilySelectorProperty(this); - } - return (null != tmp) ? tmp : fontFamilySelector = new Selector(); - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(FontFamilySelectorProperty, value); - } - else - { - SetInternalFontFamilySelectorProperty(this, null, value); - } - } + get => GetOrCreateValue>(FontFamilySelectorProperty); + set => SetValue(FontFamilySelectorProperty, value); } /// 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 bool? MultiLine { - get - { - if (NUIApplication.IsUsingXaml) - { - return (bool?)GetValue(MultiLineProperty); - } - else - { - return (bool?)GetInternalMultiLineProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(MultiLineProperty, value); - } - else - { - SetInternalMultiLineProperty(this, null, value); - } - } + get => (bool?)GetValue(MultiLineProperty); + set => SetValue(MultiLineProperty, value); } /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. @@ -633,197 +102,56 @@ public HorizontalAlignment? HorizontalAlignment [EditorBrowsable(EditorBrowsableState.Never)] public VerticalAlignment? VerticalAlignment { - get - { - if (NUIApplication.IsUsingXaml) - { - return (VerticalAlignment?)GetValue(VerticalAlignmentProperty); - } - else - { - return (VerticalAlignment?)GetInternalVerticalAlignmentProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(VerticalAlignmentProperty, value); - } - else - { - SetInternalVerticalAlignmentProperty(this, null, value); - } - } + get => (VerticalAlignment?)GetValue(VerticalAlignmentProperty); + set => SetValue(VerticalAlignmentProperty, value); } /// 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 bool? EnableMarkup { - get - { - if (NUIApplication.IsUsingXaml) - { - return (bool?)GetValue(EnableMarkupProperty); - } - else - { - return (bool?)GetInternalEnableMarkupProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(EnableMarkupProperty, value); - } - else - { - SetInternalEnableMarkupProperty(this, null, value); - } - } + get => (bool?)GetValue(EnableMarkupProperty); + set => SetValue(EnableMarkupProperty, value); } /// 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 bool? EnableAutoScroll { - get - { - if (NUIApplication.IsUsingXaml) - { - return (bool?)GetValue(EnableAutoScrollProperty); - } - else - { - return (bool?)GetInternalEnableAutoScrollProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(EnableAutoScrollProperty, value); - } - else - { - SetInternalEnableAutoScrollProperty(this, null, value); - } - } + get => (bool?)GetValue(EnableAutoScrollProperty); + set => SetValue(EnableAutoScrollProperty, value); } /// 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 int? AutoScrollSpeed { - get - { - if (NUIApplication.IsUsingXaml) - { - return (int?)GetValue(AutoScrollSpeedProperty); - } - else - - { - return (int?)GetInternalAutoScrollSpeedProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(AutoScrollSpeedProperty, value); - } - else - { - SetInternalAutoScrollSpeedProperty(this, null, value); - } - } + get => (int?)GetValue(AutoScrollSpeedProperty); + set => SetValue(AutoScrollSpeedProperty, value); } /// 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 int? AutoScrollLoopCount { - get - { - if (NUIApplication.IsUsingXaml) - { - return (int?)GetValue(AutoScrollLoopCountProperty); - } - else - { - return (int?)GetInternalAutoScrollLoopCountProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(AutoScrollLoopCountProperty, value); - } - else - { - SetInternalAutoScrollLoopCountProperty(this, null, value); - } - } + get => (int?)GetValue(AutoScrollLoopCountProperty); + set => SetValue(AutoScrollLoopCountProperty, value); } /// 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 float? AutoScrollGap { - get - { - if (NUIApplication.IsUsingXaml) - { - return (float?)GetValue(AutoScrollGapProperty); - } - else - { - return (float?)GetInternalAutoScrollGapProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(AutoScrollGapProperty, value); - } - else - { - SetInternalAutoScrollGapProperty(this, null, value); - } - } + get => (float?)GetValue(AutoScrollGapProperty); + set => SetValue(AutoScrollGapProperty, value); } /// 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 float? LineSpacing { - get - { - if (NUIApplication.IsUsingXaml) - { - return (float?)GetValue(LineSpacingProperty); - } - else - { - return (float?)GetInternalLineSpacingProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(LineSpacingProperty, value); - } - else - { - SetInternalLineSpacingProperty(this, null, value); - } - } + get => (float?)GetValue(LineSpacingProperty); + set => SetValue(LineSpacingProperty, value); } /// @@ -832,535 +160,149 @@ public float? LineSpacing [EditorBrowsable(EditorBrowsableState.Never)] public float? RelativeLineHeight { - get - { - if (NUIApplication.IsUsingXaml) - { - return (float?)GetValue(RelativeLineHeightProperty); - } - else - { - return (float?)GetInternalRelativeLineHeightProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(RelativeLineHeightProperty, value); - } - else - { - SetInternalRelativeLineHeightProperty(this, null, value); - } - } + get => (float?)GetValue(RelativeLineHeightProperty); + set => SetValue(RelativeLineHeightProperty, value); } /// 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 string Emboss { - get - { - if (NUIApplication.IsUsingXaml) - { - return (string)GetValue(EmbossProperty); - } - else - { - return (string)GetInternalEmbossProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(EmbossProperty, value); - } - else - { - SetInternalEmbossProperty(this, null, value); - } - } + get => (string)GetValue(EmbossProperty); + set => SetValue(EmbossProperty, value); } /// 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 Selector PixelSize { - get - { - if (NUIApplication.IsUsingXaml) - { - return (Selector)GetValue(PixelSizeSelectorProperty) ?? (pixelSizeSelector = new Selector()); - } - else - { - return (Selector)GetInternalPixelSizeSelectorProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(PixelSizeSelectorProperty, value); - } - else - { - SetInternalPixelSizeSelectorProperty(this, null, value); - } - } + get => GetOrCreateValue>(PixelSizeSelectorProperty); + set => SetValue(PixelSizeSelectorProperty, value); } /// 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 bool? Ellipsis { - get - { - if (NUIApplication.IsUsingXaml) - { - return (bool?)GetValue(EllipsisProperty); - } - else - { - return (bool?)GetInternalEllipsisProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(EllipsisProperty, value); - } - else - { - SetInternalEllipsisProperty(this, null, value); - } - } + get => (bool?)GetValue(EllipsisProperty); + set => SetValue(EllipsisProperty, value); } /// 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 float? AutoScrollLoopDelay { - get - { - if (NUIApplication.IsUsingXaml) - { - return (float?)GetValue(AutoScrollLoopDelayProperty); - } - else - { - return (float?)GetInternalAutoScrollLoopDelayProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(AutoScrollLoopDelayProperty, value); - } - else - { - SetInternalAutoScrollLoopDelayProperty(this, null, value); - } - } + get => (float?)GetValue(AutoScrollLoopDelayProperty); + set => SetValue(AutoScrollLoopDelayProperty, value); } /// 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 AutoScrollStopMode? AutoScrollStopMode { - get - { - if (NUIApplication.IsUsingXaml) - { - return (AutoScrollStopMode?)GetValue(AutoScrollStopModeProperty); - } - else - { - return (AutoScrollStopMode?)GetInternalAutoScrollStopModeProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(AutoScrollStopModeProperty, value); - } - else - { - SetInternalAutoScrollStopModeProperty(this, null, value); - } - } + get => (AutoScrollStopMode?)GetValue(AutoScrollStopModeProperty); + set => SetValue(AutoScrollStopModeProperty, value); } /// 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 LineWrapMode? LineWrapMode { - get - { - if (NUIApplication.IsUsingXaml) - { - return (LineWrapMode?)GetValue(LineWrapModeProperty); - } - else - { - return (LineWrapMode?)GetInternalLineWrapModeProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(LineWrapModeProperty, value); - } - else - { - SetInternalLineWrapModeProperty(this, null, value); - } - } + get => (LineWrapMode?)GetValue(LineWrapModeProperty); + set => SetValue(LineWrapModeProperty, value); } /// 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 VerticalLineAlignment? VerticalLineAlignment { - get - { - if (NUIApplication.IsUsingXaml) - { - return (VerticalLineAlignment?)GetValue(VerticalLineAlignmentProperty); - } - else - { - return (VerticalLineAlignment?)GetInternalVerticalLineAlignmentProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(VerticalLineAlignmentProperty, value); - } - else - { - SetInternalVerticalLineAlignmentProperty(this, null, value); - } - } + get => (VerticalLineAlignment?)GetValue(VerticalLineAlignmentProperty); + set => SetValue(VerticalLineAlignmentProperty, value); } /// This will be public opened in tizen_6.5 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public EllipsisPosition? EllipsisPosition { - get - { - if (NUIApplication.IsUsingXaml) - { - return (EllipsisPosition?)GetValue(EllipsisPositionProperty); - } - else - { - return (EllipsisPosition?)GetInternalEllipsisPositionProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(EllipsisPositionProperty, value); - } - else - { - SetInternalEllipsisPositionProperty(this, null, value); - } - } + get => (EllipsisPosition?)GetValue(EllipsisPositionProperty); + set => SetValue(EllipsisPositionProperty, value); } /// This will be public opened in tizen_6.5 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public float? CharacterSpacing { - get - { - if (NUIApplication.IsUsingXaml) - { - return (float?)GetValue(CharacterSpacingProperty); - } - else - { - return (float?)GetInternalCharacterSpacingProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(CharacterSpacingProperty, value); - } - else - { - SetInternalCharacterSpacingProperty(this, null, value); - } - } + get => (float?)GetValue(CharacterSpacingProperty); + set => SetValue(CharacterSpacingProperty, value); } [EditorBrowsable(EditorBrowsableState.Never)] public float? FontSizeScale { - get - { - if (NUIApplication.IsUsingXaml) - { - return (float?)GetValue(FontSizeScaleProperty); - } - else - { - return (float?)GetInternalFontSizeScaleProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(FontSizeScaleProperty, value); - } - else - { - SetInternalFontSizeScaleProperty(this, null, value); - } - } + get => (float?)GetValue(FontSizeScaleProperty); + set => SetValue(FontSizeScaleProperty, value); } [EditorBrowsable(EditorBrowsableState.Never)] public Color AnchorColor { - get - { - if (NUIApplication.IsUsingXaml) - { - return (Color)GetValue(AnchorColorProperty); - } - else - { - return (Color)GetInternalAnchorColorProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(AnchorColorProperty, value); - } - else - { - SetInternalAnchorColorProperty(this, null, value); - } - } + get => (Color)GetValue(AnchorColorProperty); + set => SetValue(AnchorColorProperty, value); } [EditorBrowsable(EditorBrowsableState.Never)] public Color AnchorClickedColor { - get - { - if (NUIApplication.IsUsingXaml) - { - return (Color)GetValue(AnchorClickedColorProperty); - } - else - { - return (Color)GetInternalAnchorClickedColorProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(AnchorClickedColorProperty, value); - } - else - { - SetInternalAnchorClickedColorProperty(this, null, value); - } - } + get => (Color)GetValue(AnchorClickedColorProperty); + set => SetValue(AnchorClickedColorProperty, value); } /// 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 bool? MatchSystemLanguageDirection { - get - { - if (NUIApplication.IsUsingXaml) - { - return (bool?)GetValue(MatchSystemLanguageDirectionProperty); - } - else - { - return (bool?)GetInternalMatchSystemLanguageDirectionProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(MatchSystemLanguageDirectionProperty, value); - } - else - { - SetInternalMatchSystemLanguageDirectionProperty(this, null, value); - } - } + get => (bool?)GetValue(MatchSystemLanguageDirectionProperty); + set => SetValue(MatchSystemLanguageDirectionProperty, value); } /// 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 Selector Text { - get - { - Selector tmp = null; - if (NUIApplication.IsUsingXaml) - { - tmp = (Selector)GetValue(TextSelectorProperty); - } - else - { - tmp = (Selector)GetInternalTextSelectorProperty(this); - } - return (null != tmp) ? tmp : textSelector = new Selector(); - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(TextSelectorProperty, value); - } - else - { - SetInternalTextSelectorProperty(this, null, value); - } - } + get => GetOrCreateValue>(TextSelectorProperty); + set => SetValue(TextSelectorProperty, value); } /// 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 Selector TextColor { - get - { - Selector tmp = null; - if (NUIApplication.IsUsingXaml) - { - tmp = (Selector)GetValue(TextColorSelectorProperty); - } - else - { - tmp = (Selector)GetInternalTextColorSelectorProperty(this); - } - return (null != tmp) ? tmp : textColorSelector = new Selector(); - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(TextColorSelectorProperty, value); - } - else - { - SetInternalTextColorSelectorProperty(this, null, value); - } - } + get => GetOrCreateValue>(TextColorSelectorProperty); + set => SetValue(TextColorSelectorProperty, value); } /// 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 Selector PointSize { - get - { - Selector tmp = null; - if (NUIApplication.IsUsingXaml) - { - tmp = (Selector)GetValue(PointSizeSelectorProperty); - } - else - { - tmp = (Selector)GetInternalPointSizeSelectorProperty(this); - } - return (null != tmp) ? tmp : pointSizeSelector = new Selector(); - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(PointSizeSelectorProperty, value); - } - else - { - SetInternalPointSizeSelectorProperty(this, null, value); - } - } + get => GetOrCreateValue>(PointSizeSelectorProperty); + set => SetValue(PointSizeSelectorProperty, value); } /// 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 Selector TextShadow { - get - { - if (NUIApplication.IsUsingXaml) - { - return (Selector)GetValue(TextShadowProperty); - } - else - { - return (Selector)GetInternalTextShadowProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(TextShadowProperty, value); - } - else - { - SetInternalTextShadowProperty(this, null, value); - } - } + get => (Selector)GetValue(TextShadowProperty); + set => SetValue(TextShadowProperty, value); } /// This will be public opened in tizen_6.5 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public PropertyMap FontStyle { - get - { - if (NUIApplication.IsUsingXaml) - { - return (PropertyMap)GetValue(FontStyleProperty); - } - else - { - return (PropertyMap)GetInternalFontStyleProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(FontStyleProperty, value); - } - else - { - SetInternalFontStyleProperty(this, null, value); - } - } + get => (PropertyMap)GetValue(FontStyleProperty); + set => SetValue(FontStyleProperty, value); } } } diff --git a/src/Tizen.NUI/src/public/BaseComponents/Style/ViewStyle.cs b/src/Tizen.NUI/src/public/BaseComponents/Style/ViewStyle.cs index 2f40d4a602a..a12315a30c5 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/Style/ViewStyle.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/Style/ViewStyle.cs @@ -18,6 +18,7 @@ using System.ComponentModel; using System.Collections.Generic; using Tizen.NUI.Binding; +using static Tizen.Applications.ApplicationInfoFilter; namespace Tizen.NUI.BaseComponents { @@ -28,132 +29,52 @@ namespace Tizen.NUI.BaseComponents /// 9 public partial class ViewStyle : BindableObject, IDisposable { + static readonly IStyleProperty BackgroundImageProperty = new StyleProperty>((v, o) => View.SetInternalBackgroundImageProperty(v, null, o)); + static readonly IStyleProperty FocusableProperty = new StyleProperty((v, o) => v.Focusable = o); + static readonly IStyleProperty FocusableChildrenProperty = new StyleProperty((v, o) => v.FocusableChildren = o); + static readonly IStyleProperty FocusableInTouchProperty = new StyleProperty((v, o) => v.FocusableInTouch = o); + static readonly IStyleProperty Size2DProperty = new StyleProperty((v, o) => v.Size2D = o); + static readonly IStyleProperty OpacityProperty = new StyleProperty>((v, o) => View.SetInternalOpacityProperty(v, null, o)); + static readonly IStyleProperty Position2DProperty = new StyleProperty((v, o) => v.Position2D = o); + static readonly IStyleProperty PositionUsesPivotPointProperty = new StyleProperty((v, o) => v.PositionUsesPivotPoint = o); + static readonly IStyleProperty ParentOriginProperty = new StyleProperty((v, o) => v.ParentOrigin = o); + static readonly IStyleProperty PivotPointProperty = new StyleProperty((v, o) => v.PivotPoint = o); + static readonly IStyleProperty SizeWidthProperty = new StyleProperty((v, o) => v.SizeWidth = o); + static readonly IStyleProperty SizeHeightProperty = new StyleProperty((v, o) => v.SizeHeight = o); + static readonly IStyleProperty PositionProperty = new StyleProperty((v, o) => v.Position = o); + static readonly IStyleProperty PositionXProperty = new StyleProperty((v, o) => v.PositionX = o); + static readonly IStyleProperty PositionYProperty = new StyleProperty((v, o) => v.PositionY = o); + static readonly IStyleProperty OrientationProperty = new StyleProperty((v, o) => v.Orientation = o); + static readonly IStyleProperty DrawModeProperty = new StyleProperty((v, o) => v.DrawMode = o); + static readonly IStyleProperty SizeModeFactorProperty = new StyleProperty((v, o) => v.SizeModeFactor = o); + static readonly IStyleProperty WidthResizePolicyProperty = new StyleProperty((v, o) => v.WidthResizePolicy = o); + static readonly IStyleProperty HeightResizePolicyProperty = new StyleProperty((v, o) => v.HeightResizePolicy = o); + static readonly IStyleProperty WidthForHeightProperty = new StyleProperty((v, o) => v.WidthForHeight = o); + static readonly IStyleProperty HeightForWidthProperty = new StyleProperty((v, o) => v.HeightForWidth = o); + static readonly IStyleProperty PaddingProperty = new StyleProperty((v, o) => v.Padding = o); + static readonly IStyleProperty MinimumSizeProperty = new StyleProperty((v, o) => v.MinimumSize = o); + static readonly IStyleProperty MaximumSizeProperty = new StyleProperty((v, o) => v.MaximumSize = o); + static readonly IStyleProperty ClippingModeProperty = new StyleProperty((v, o) => v.ClippingMode = o); + static readonly IStyleProperty SizeProperty = new StyleProperty((v, o) => v.Size = o); + static readonly IStyleProperty MarginProperty = new StyleProperty((v, o) => v.Margin = o); + static readonly IStyleProperty BackgroundColorProperty = new StyleProperty>((v, o) => View.SetInternalBackgroundColorProperty(v, null, o)); + static readonly IStyleProperty ColorProperty = new StyleProperty>((v, o) => View.SetInternalColorProperty(v, null, o)); + static readonly IStyleProperty BackgroundImageBorderProperty = new StyleProperty>((v, o) => View.SetInternalBackgroundImageBorderProperty(v, null, o)); + static readonly IStyleProperty ImageShadowProperty = new StyleProperty>((v, o) => View.SetInternalImageShadowProperty(v, null, o)); + static readonly IStyleProperty BoxShadowProperty = new StyleProperty>((v, o) => View.SetInternalBoxShadowProperty(v, null, o)); + static readonly IStyleProperty CornerRadiusProperty = new StyleProperty((v, o) => v.CornerRadius = o); + static readonly IStyleProperty CornerRadiusPolicyProperty = new StyleProperty((v, o) => v.CornerRadiusPolicy = o); + static readonly IStyleProperty BorderlineWidthProperty = new StyleProperty((v, o) => v.BorderlineWidth = o); + static readonly IStyleProperty BorderlineColorProperty = new StyleProperty((v, o) => v.BorderlineColor = o); + static readonly IStyleProperty BorderlineColorSelectorProperty = new StyleProperty>((v, o) => View.SetInternalBorderlineColorSelectorProperty(v, null, o)); + static readonly IStyleProperty BorderlineOffsetProperty = new StyleProperty((v, o) => v.BorderlineOffset = o); + static readonly IStyleProperty ThemeChangeSensitiveProperty = new StyleProperty((v, o) => v.ThemeChangeSensitive = o); + static readonly IStyleProperty IsEnabledProperty = new StyleProperty((v, o) => v.IsEnabled = o); + + private Dictionary values = new Dictionary(); private bool disposed = false; - private bool? focusable; - private bool? focusableChildren; - private bool? focusableInTouch; - private bool? positionUsesPivotPoint; - private Position parentOrigin; - private Position pivotPoint; - private Position position; - private Rotation orientation; - private DrawModeType? drawMode; - private Vector3 sizeModeFactor; - private ResizePolicyType? widthResizePolicy; - private ResizePolicyType? heightResizePolicy; - private bool? widthForHeight; - private bool? heightForWidth; - private Extents padding; - private Size2D minimumSize; - private Size2D maximumSize; - private ClippingModeType? clippingMode; - private Size size; - private Extents margin; - private bool? themeChangeSensitive; - private Vector4 cornerRadius; - private float? borderlineWidth; - private Color borderlineColor; - private float? borderlineOffset; - private bool? isEnabled; - - private Selector imageShadow; - private Selector boxShadow; - private Selector backgroundImageSelector; - private Selector opacitySelector; - private Selector backgroundColorSelector; - private Selector backgroundImageBorderSelector; - private Selector colorSelector; - private VisualTransformPolicyType? cornerRadiusPolicy; - private Selector borderlineColorSelector; - - static ViewStyle() - { - if (NUIApplication.IsUsingXaml) - { - BackgroundImageProperty = BindableProperty.Create(nameof(BackgroundImage), typeof(Selector), typeof(ViewStyle), null, - propertyChanged: SetInternalBackgroundImageProperty, defaultValueCreator: GetInternalBackgroundImageProperty); - FocusableProperty = BindableProperty.Create(nameof(Focusable), typeof(bool?), typeof(ViewStyle), null, - propertyChanged: SetInternalFocusableProperty, defaultValueCreator: GetInternalFocusableProperty); - FocusableChildrenProperty = BindableProperty.Create(nameof(FocusableChildren), typeof(bool?), typeof(ViewStyle), true, - propertyChanged: SetInternalFocusableChildrenProperty, defaultValueCreator: GetInternalFocusableChildrenProperty); - FocusableInTouchProperty = BindableProperty.Create(nameof(FocusableInTouch), typeof(bool?), typeof(ViewStyle), null, - propertyChanged: SetInternalFocusableInTouchProperty, defaultValueCreator: GetInternalFocusableInTouchProperty); - Size2DProperty = BindableProperty.Create(nameof(Size2D), typeof(Size2D), typeof(ViewStyle), null, - propertyChanged: SetInternalSize2DProperty, defaultValueCreator: GetInternalSize2DProperty); - OpacityProperty = BindableProperty.Create(nameof(Opacity), typeof(Selector), typeof(ViewStyle), null, - propertyChanged: SetInternalOpacityProperty, defaultValueCreator: GetInternalOpacityProperty); - Position2DProperty = BindableProperty.Create(nameof(Position2D), typeof(Position2D), typeof(ViewStyle), null, - propertyChanged: SetInternalPosition2DProperty, defaultValueCreator: GetInternalPosition2DProperty); - PositionUsesPivotPointProperty = BindableProperty.Create(nameof(PositionUsesPivotPoint), typeof(bool?), typeof(ViewStyle), null, - propertyChanged: SetInternalPositionUsesPivotPointProperty, defaultValueCreator: GetInternalPositionUsesPivotPointProperty); - ParentOriginProperty = BindableProperty.Create(nameof(ParentOrigin), typeof(Position), typeof(ViewStyle), null, - propertyChanged: SetInternalParentOriginProperty, defaultValueCreator: GetInternalParentOriginProperty); - PivotPointProperty = BindableProperty.Create(nameof(PivotPoint), typeof(Position), typeof(ViewStyle), null, - propertyChanged: SetInternalPivotPointProperty, defaultValueCreator: GetInternalPivotPointProperty); - SizeWidthProperty = BindableProperty.Create(nameof(SizeWidth), typeof(float?), typeof(ViewStyle), null, - propertyChanged: SetInternalSizeWidthProperty, defaultValueCreator: GetInternalSizeWidthProperty); - SizeHeightProperty = BindableProperty.Create(nameof(SizeHeight), typeof(float?), typeof(ViewStyle), null, - propertyChanged: SetInternalSizeHeightProperty, defaultValueCreator: GetInternalSizeHeightProperty); - PositionProperty = BindableProperty.Create(nameof(Position), typeof(Position), typeof(ViewStyle), null, - propertyChanged: SetInternalPositionProperty, defaultValueCreator: GetInternalPositionProperty); - PositionXProperty = BindableProperty.Create(nameof(PositionX), typeof(float?), typeof(ViewStyle), null, - propertyChanged: SetInternalPositionXProperty, defaultValueCreator: GetInternalPositionXProperty); - PositionYProperty = BindableProperty.Create(nameof(PositionY), typeof(float?), typeof(ViewStyle), null, - propertyChanged: SetInternalPositionYProperty, defaultValueCreator: GetInternalPositionYProperty); - OrientationProperty = BindableProperty.Create(nameof(Orientation), typeof(Rotation), typeof(ViewStyle), null, - propertyChanged: SetInternalOrientationProperty, defaultValueCreator: GetInternalOrientationProperty); - DrawModeProperty = BindableProperty.Create(nameof(DrawMode), typeof(DrawModeType?), typeof(ViewStyle), null, - propertyChanged: SetInternalDrawModeProperty, defaultValueCreator: GetInternalDrawModeProperty); - SizeModeFactorProperty = BindableProperty.Create(nameof(SizeModeFactor), typeof(Vector3), typeof(ViewStyle), null, - propertyChanged: SetInternalSizeModeFactorProperty, defaultValueCreator: GetInternalSizeModeFactorProperty); - WidthResizePolicyProperty = BindableProperty.Create(nameof(WidthResizePolicy), typeof(ResizePolicyType?), typeof(ViewStyle), null, - propertyChanged: SetInternalWidthResizePolicyProperty, defaultValueCreator: GetInternalWidthResizePolicyProperty); - HeightResizePolicyProperty = BindableProperty.Create(nameof(HeightResizePolicy), typeof(ResizePolicyType?), typeof(ViewStyle), null, - propertyChanged: SetInternalHeightResizePolicyProperty, defaultValueCreator: GetInternalHeightResizePolicyProperty); - WidthForHeightProperty = BindableProperty.Create(nameof(WidthForHeight), typeof(bool?), typeof(ViewStyle), null, - propertyChanged: SetInternalWidthForHeightProperty, defaultValueCreator: GetInternalWidthForHeightProperty); - HeightForWidthProperty = BindableProperty.Create(nameof(HeightForWidth), typeof(bool?), typeof(ViewStyle), null, - propertyChanged: SetInternalHeightForWidthProperty, defaultValueCreator: GetInternalHeightForWidthProperty); - PaddingProperty = BindableProperty.Create(nameof(Padding), typeof(Extents), typeof(ViewStyle), null, - propertyChanged: SetInternalPaddingProperty, defaultValueCreator: GetInternalPaddingProperty); - MinimumSizeProperty = BindableProperty.Create(nameof(MinimumSize), typeof(Size2D), typeof(ViewStyle), null, - propertyChanged: SetInternalMinimumSizeProperty, defaultValueCreator: GetInternalMinimumSizeProperty); - MaximumSizeProperty = BindableProperty.Create(nameof(MaximumSize), typeof(Size2D), typeof(ViewStyle), null, - propertyChanged: SetInternalMaximumSizeProperty, defaultValueCreator: GetInternalMaximumSizeProperty); - ClippingModeProperty = BindableProperty.Create(nameof(ClippingMode), typeof(ClippingModeType?), typeof(ViewStyle), null, - propertyChanged: SetInternalClippingModeProperty, defaultValueCreator: GetInternalClippingModeProperty); - SizeProperty = BindableProperty.Create(nameof(Size), typeof(Size), typeof(ViewStyle), null, - propertyChanged: SetInternalSizeProperty, defaultValueCreator: GetInternalSizeProperty); - MarginProperty = BindableProperty.Create(nameof(Margin), typeof(Extents), typeof(ViewStyle), null, - propertyChanged: SetInternalMarginProperty, defaultValueCreator: GetInternalMarginProperty); - BackgroundColorProperty = BindableProperty.Create(nameof(BackgroundColor), typeof(Selector), typeof(ViewStyle), null, - propertyChanged: SetInternalBackgroundColorProperty, defaultValueCreator: GetInternalBackgroundColorProperty); - ColorProperty = BindableProperty.Create(nameof(Color), typeof(Selector), typeof(ViewStyle), null, - propertyChanged: SetInternalColorProperty, defaultValueCreator: GetInternalColorProperty); - BackgroundImageBorderProperty = BindableProperty.Create(nameof(BackgroundImageBorder), typeof(Selector), typeof(ViewStyle), null, - propertyChanged: SetInternalBackgroundImageBorderProperty, defaultValueCreator: GetInternalBackgroundImageBorderProperty); - ImageShadowProperty = BindableProperty.Create(nameof(ImageShadow), typeof(Selector), typeof(ViewStyle), null, - propertyChanged: SetInternalImageShadowProperty, defaultValueCreator: GetInternalImageShadowProperty); - BoxShadowProperty = BindableProperty.Create(nameof(BoxShadow), typeof(Selector), typeof(ViewStyle), null, - propertyChanged: SetInternalBoxShadowProperty, defaultValueCreator: GetInternalBoxShadowProperty); - CornerRadiusProperty = BindableProperty.Create(nameof(CornerRadius), typeof(Vector4), typeof(ViewStyle), null, - propertyChanged: SetInternalCornerRadiusProperty, defaultValueCreator: GetInternalCornerRadiusProperty); - CornerRadiusPolicyProperty = BindableProperty.Create(nameof(CornerRadiusPolicy), typeof(VisualTransformPolicyType?), typeof(ViewStyle), null, - propertyChanged: SetInternalCornerRadiusPolicyProperty, defaultValueCreator: GetInternalCornerRadiusPolicyProperty); - BorderlineWidthProperty = BindableProperty.Create(nameof(BorderlineWidth), typeof(float?), typeof(ViewStyle), null, - propertyChanged: SetInternalBorderlineWidthProperty, defaultValueCreator: GetInternalBorderlineWidthProperty); - BorderlineColorProperty = BindableProperty.Create(nameof(BorderlineColor), typeof(Color), typeof(ViewStyle), null, - propertyChanged: SetInternalBorderlineColorProperty, defaultValueCreator: GetInternalBorderlineColorProperty); - BorderlineColorSelectorProperty = BindableProperty.Create(nameof(BorderlineColorSelector), typeof(Selector), typeof(ViewStyle), null, - propertyChanged: SetInternalBorderlineColorSelectorProperty, defaultValueCreator: GetInternalBorderlineColorSelectorProperty); - BorderlineOffsetProperty = BindableProperty.Create(nameof(BorderlineOffset), typeof(float?), typeof(ViewStyle), null, - propertyChanged: SetInternalBorderlineOffsetProperty, defaultValueCreator: GetInternalBorderlineOffsetProperty); - ThemeChangeSensitiveProperty = BindableProperty.Create(nameof(ThemeChangeSensitive), typeof(bool?), typeof(ViewStyle), null, - propertyChanged: SetInternalThemeChangeSensitiveProperty, defaultValueCreator: GetInternalThemeChangeSensitiveProperty); - IsEnabledProperty = BindableProperty.Create(nameof(IsEnabled), typeof(bool?), typeof(ViewStyle), null, - propertyChanged: SetInternalIsEnabledProperty, defaultValueCreator: GetInternalIsEnabledProperty); - } - } + + static ViewStyle() { } /// /// Create an empty style instance. @@ -183,58 +104,16 @@ public ViewStyle(ViewStyle viewAttributes) /// 9 public Selector BackgroundImage { - get - { - Selector image = null; - if (NUIApplication.IsUsingXaml) - { - image = (Selector)GetValue(BackgroundImageProperty); - } - else - { - image = (Selector)GetInternalBackgroundImageProperty(this); - } - return (null != image) ? image : backgroundImageSelector = new Selector(); - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(BackgroundImageProperty, value); - } - else - { - SetInternalBackgroundImageProperty(this, null, value); - } - } + get => GetOrCreateValue>(BackgroundImageProperty); + set => SetValue(BackgroundImageProperty, value); } /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public bool? Focusable { - get - { - if (NUIApplication.IsUsingXaml) - { - return (bool?)GetValue(FocusableProperty); - } - else - { - return (bool?)GetInternalFocusableProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(FocusableProperty, value); - } - else - { - SetInternalFocusableProperty(this, null, value); - } - } + get => (bool?)GetValue(FocusableProperty); + set => SetValue(FocusableProperty, value); } /// @@ -244,28 +123,8 @@ public bool? Focusable [EditorBrowsable(EditorBrowsableState.Never)] public bool? FocusableChildren { - get - { - if (NUIApplication.IsUsingXaml) - { - return (bool?)GetValue(FocusableChildrenProperty); - } - else - { - return (bool?)GetInternalFocusableChildrenProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(FocusableChildrenProperty, value); - } - else - { - SetInternalFocusableChildrenProperty(this, null, value); - } - } + get => (bool?)GetValue(FocusableChildrenProperty); + set => SetValue(FocusableChildrenProperty, value); } /// @@ -276,28 +135,8 @@ public bool? FocusableChildren [EditorBrowsable(EditorBrowsableState.Never)] public bool? FocusableInTouch { - get - { - if (NUIApplication.IsUsingXaml) - { - return (bool?)GetValue(FocusableInTouchProperty); - } - else - { - return (bool?)GetInternalFocusableInTouchProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(FocusableInTouchProperty, value); - } - else - { - SetInternalFocusableInTouchProperty(this, null, value); - } - } + get => (bool?)GetValue(FocusableInTouchProperty); + set => SetValue(FocusableInTouchProperty, value); } /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. @@ -305,28 +144,8 @@ public bool? FocusableInTouch [EditorBrowsable(EditorBrowsableState.Never)] public Size2D Size2D { - get - { - if (NUIApplication.IsUsingXaml) - { - return (Size2D)GetValue(Size2DProperty); - } - else - { - return (Size2D)GetInternalSize2DProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(Size2DProperty, value); - } - else - { - SetInternalSize2DProperty(this, null, value); - } - } + get => (Size2D)GetValue(Size2DProperty); + set => SetValue(Size2DProperty, value); } /// @@ -337,30 +156,8 @@ public Size2D Size2D /// 9 public Selector Opacity { - get - { - Selector opacity = null; - if (NUIApplication.IsUsingXaml) - { - opacity = (Selector)GetValue(OpacityProperty); - } - else - { - opacity = (Selector)GetInternalOpacityProperty(this); - } - return (null != opacity) ? opacity : opacitySelector = new Selector(); - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(OpacityProperty, value); - } - else - { - SetInternalOpacityProperty(this, null, value); - } - } + get => GetOrCreateValue>(OpacityProperty); + set => SetValue(OpacityProperty, value); } /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. @@ -368,28 +165,8 @@ public Selector Opacity [EditorBrowsable(EditorBrowsableState.Never)] public Position2D Position2D { - get - { - if (NUIApplication.IsUsingXaml) - { - return (Position2D)GetValue(Position2DProperty); - } - else - { - return (Position2D)GetInternalPosition2DProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(Position2DProperty, value); - } - else - { - SetInternalPosition2DProperty(this, null, value); - } - } + get => (Position2D)GetValue(Position2DProperty); + set => SetValue(Position2DProperty, value); } /// @@ -398,28 +175,8 @@ public Position2D Position2D /// 9 public bool? PositionUsesPivotPoint { - get - { - if (NUIApplication.IsUsingXaml) - { - return (bool?)GetValue(PositionUsesPivotPointProperty); - } - else - { - return (bool?)GetInternalPositionUsesPivotPointProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(PositionUsesPivotPointProperty, value); - } - else - { - SetInternalPositionUsesPivotPointProperty(this, null, value); - } - } + get => (bool?)GetValue(PositionUsesPivotPointProperty); + set => SetValue(PositionUsesPivotPointProperty, value); } /// @@ -431,28 +188,8 @@ public bool? PositionUsesPivotPoint /// 9 public Position ParentOrigin { - get - { - if (NUIApplication.IsUsingXaml) - { - return (Position)GetValue(ParentOriginProperty); - } - else - { - return (Position)GetInternalParentOriginProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(ParentOriginProperty, value); - } - else - { - SetInternalParentOriginProperty(this, null, value); - } - } + get => (Position)GetValue(ParentOriginProperty); + set => SetValue(ParentOriginProperty, value); } /// @@ -465,28 +202,8 @@ public Position ParentOrigin /// 9 public Position PivotPoint { - get - { - if (NUIApplication.IsUsingXaml) - { - return (Position)GetValue(PivotPointProperty); - } - else - { - return (Position)GetInternalPivotPointProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(PivotPointProperty, value); - } - else - { - SetInternalPivotPointProperty(this, null, value); - } - } + get => (Position)GetValue(PivotPointProperty); + set => SetValue(PivotPointProperty, value); } /// @@ -495,28 +212,8 @@ public Position PivotPoint /// 9 public float? SizeWidth { - get - { - if (NUIApplication.IsUsingXaml) - { - return (float?)GetValue(SizeWidthProperty); - } - else - { - return (float?)GetInternalSizeWidthProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(SizeWidthProperty, value); - } - else - { - SetInternalSizeWidthProperty(this, null, value); - } - } + get => (float?)GetValue(SizeWidthProperty); + set => SetValue(SizeWidthProperty, value); } /// @@ -525,28 +222,8 @@ public float? SizeWidth /// 9 public float? SizeHeight { - get - { - if (NUIApplication.IsUsingXaml) - { - return (float?)GetValue(SizeHeightProperty); - } - else - { - return (float?)GetInternalSizeHeightProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(SizeHeightProperty, value); - } - else - { - SetInternalSizeHeightProperty(this, null, value); - } - } + get => (float?)GetValue(SizeHeightProperty); + set => SetValue(SizeHeightProperty, value); } /// @@ -555,140 +232,40 @@ public float? SizeHeight /// 9 public Position Position { - get - { - if (NUIApplication.IsUsingXaml) - { - return (Position)GetValue(PositionProperty); - } - else - { - return (Position)GetInternalPositionProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(PositionProperty, value); - } - else - { - SetInternalPositionProperty(this, null, value); - } - } + get => (Position)GetValue(PositionProperty); + set => SetValue(PositionProperty, value); } /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public float? PositionX { - get - { - if (NUIApplication.IsUsingXaml) - { - return (float?)GetValue(PositionXProperty); - } - else - { - return (float?)GetInternalPositionXProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(PositionXProperty, value); - } - else - { - SetInternalPositionXProperty(this, null, value); - } - } + get => (float?)GetValue(PositionXProperty); + set => SetValue(PositionXProperty, value); } /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public float? PositionY { - get - { - if (NUIApplication.IsUsingXaml) - { - return (float?)GetValue(PositionYProperty); - } - else - { - return (float?)GetInternalPositionYProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(PositionYProperty, value); - } - else - { - SetInternalPositionYProperty(this, null, value); - } - } + get => (float?)GetValue(PositionYProperty); + set => SetValue(PositionYProperty, value); } /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public Rotation Orientation { - get - { - if (NUIApplication.IsUsingXaml) - { - return (Rotation)GetValue(OrientationProperty); - } - else - { - return (Rotation)GetInternalOrientationProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(OrientationProperty, value); - } - else - { - SetInternalOrientationProperty(this, null, value); - } - } + get => (Rotation)GetValue(OrientationProperty); + set => SetValue(OrientationProperty, value); } /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public DrawModeType? DrawMode { - get - { - if (NUIApplication.IsUsingXaml) - { - return (DrawModeType?)GetValue(DrawModeProperty); - } - else - { - return (DrawModeType?)GetInternalDrawModeProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(DrawModeProperty, value); - } - else - { - SetInternalDrawModeProperty(this, null, value); - } - } + get => (DrawModeType?)GetValue(DrawModeProperty); + set => SetValue(DrawModeProperty, value); } /// @@ -699,28 +276,8 @@ public DrawModeType? DrawMode /// 9 public Vector3 SizeModeFactor { - get - { - if (NUIApplication.IsUsingXaml) - { - return (Vector3)GetValue(SizeModeFactorProperty); - } - else - { - return (Vector3)GetInternalSizeModeFactorProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(SizeModeFactorProperty, value); - } - else - { - SetInternalSizeModeFactorProperty(this, null, value); - } - } + get => (Vector3)GetValue(SizeModeFactorProperty); + set => SetValue(SizeModeFactorProperty, value); } /// @@ -729,28 +286,8 @@ public Vector3 SizeModeFactor /// 9 public ResizePolicyType? WidthResizePolicy { - get - { - if (NUIApplication.IsUsingXaml) - { - return (ResizePolicyType?)GetValue(WidthResizePolicyProperty); - } - else - { - return (ResizePolicyType?)GetInternalWidthResizePolicyProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(WidthResizePolicyProperty, value); - } - else - { - SetInternalWidthResizePolicyProperty(this, null, value); - } - } + get => (ResizePolicyType?)GetValue(WidthResizePolicyProperty); + set => SetValue(WidthResizePolicyProperty, value); } /// @@ -759,84 +296,24 @@ public ResizePolicyType? WidthResizePolicy /// 9 public ResizePolicyType? HeightResizePolicy { - get - { - if (NUIApplication.IsUsingXaml) - { - return (ResizePolicyType?)GetValue(HeightResizePolicyProperty); - } - else - { - return (ResizePolicyType?)GetInternalHeightResizePolicyProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(HeightResizePolicyProperty, value); - } - else - { - SetInternalHeightResizePolicyProperty(this, null, value); - } - } + get => (ResizePolicyType?)GetValue(HeightResizePolicyProperty); + set => SetValue(HeightResizePolicyProperty, value); } /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public bool? WidthForHeight { - get - { - if (NUIApplication.IsUsingXaml) - { - return (bool?)GetValue(WidthForHeightProperty); - } - else - { - return (bool?)GetInternalWidthForHeightProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(WidthForHeightProperty, value); - } - else - { - SetInternalWidthForHeightProperty(this, null, value); - } - } + get => (bool?)GetValue(WidthForHeightProperty); + set => SetValue(WidthForHeightProperty, value); } /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public bool? HeightForWidth { - get - { - if (NUIApplication.IsUsingXaml) - { - return (bool?)GetValue(HeightForWidthProperty); - } - else - { - return (bool?)GetInternalHeightForWidthProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(HeightForWidthProperty, value); - } - else - { - SetInternalHeightForWidthProperty(this, null, value); - } - } + get => (bool?)GetValue(HeightForWidthProperty); + set => SetValue(HeightForWidthProperty, value); } /// @@ -845,28 +322,8 @@ public bool? HeightForWidth /// 9 public Extents Padding { - get - { - if (NUIApplication.IsUsingXaml) - { - return (Extents)GetValue(PaddingProperty) ?? (padding = new Extents()); - } - else - { - return (Extents)GetInternalPaddingProperty(this) ?? (padding = new Extents()); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(PaddingProperty, value); - } - else - { - SetInternalPaddingProperty(this, null, value); - } - } + get => GetOrCreateValue(PaddingProperty); + set => SetValue(PaddingProperty, value); } /// @@ -875,28 +332,8 @@ public Extents Padding /// 9 public Size2D MinimumSize { - get - { - if (NUIApplication.IsUsingXaml) - { - return (Size2D)GetValue(MinimumSizeProperty); - } - else - { - return (Size2D)GetInternalMinimumSizeProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(MinimumSizeProperty, value); - } - else - { - SetInternalMinimumSizeProperty(this, null, value); - } - } + get => (Size2D)GetValue(MinimumSizeProperty); + set => SetValue(MinimumSizeProperty, value); } /// @@ -905,56 +342,16 @@ public Size2D MinimumSize /// 9 public Size2D MaximumSize { - get - { - if (NUIApplication.IsUsingXaml) - { - return (Size2D)GetValue(MaximumSizeProperty); - } - else - { - return (Size2D)GetInternalMaximumSizeProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(MaximumSizeProperty, value); - } - else - { - SetInternalMaximumSizeProperty(this, null, value); - } - } + get => (Size2D)GetValue(MaximumSizeProperty); + set => SetValue(MaximumSizeProperty, value); } /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public ClippingModeType? ClippingMode - { - get - { - if (NUIApplication.IsUsingXaml) - { - return (ClippingModeType?)GetValue(ClippingModeProperty); - } - else - { - return (ClippingModeType?)GetInternalClippingModeProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(ClippingModeProperty, value); - } - else - { - SetInternalClippingModeProperty(this, null, value); - } - } + { + get => (ClippingModeType?)GetValue(ClippingModeProperty); + set => SetValue(ClippingModeProperty, value); } /// @@ -963,28 +360,8 @@ public ClippingModeType? ClippingMode /// 9 public Size Size { - get - { - if (NUIApplication.IsUsingXaml) - { - return (Size)GetValue(SizeProperty); - } - else - { - return (Size)GetInternalSizeProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(SizeProperty, value); - } - else - { - SetInternalSizeProperty(this, null, value); - } - } + get => (Size)GetValue(SizeProperty); + set => SetValue(SizeProperty, value); } /// @@ -993,28 +370,8 @@ public Size Size /// 9 public Extents Margin { - get - { - if (NUIApplication.IsUsingXaml) - { - return (Extents)GetValue(MarginProperty) ?? (margin = new Extents()); - } - else - { - return (Extents)GetInternalMarginProperty(this) ?? (margin = new Extents()); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(MarginProperty, value); - } - else - { - SetInternalMarginProperty(this, null, value); - } - } + get => GetOrCreateValue(MarginProperty); + set => SetValue(MarginProperty, value); } /// @@ -1024,30 +381,8 @@ public Extents Margin /// 9 public Selector BackgroundColor { - get - { - Selector color = null; - if (NUIApplication.IsUsingXaml) - { - color = (Selector)GetValue(BackgroundColorProperty); - } - else - { - color = (Selector)GetInternalBackgroundColorProperty(this); - } - return (null != color) ? color : backgroundColorSelector = new Selector(); - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(BackgroundColorProperty, value); - } - else - { - SetInternalBackgroundColorProperty(this, null, value); - } - } + get => GetOrCreateValue>(BackgroundColorProperty); + set => SetValue(BackgroundColorProperty, value); } /// @@ -1056,28 +391,8 @@ public Selector BackgroundColor [EditorBrowsable(EditorBrowsableState.Never)] public Selector Color { - get - { - if (NUIApplication.IsUsingXaml) - { - return (Selector)GetValue(ColorProperty) ?? (colorSelector = new Selector()); - } - else - { - return (Selector)GetInternalColorProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(ColorProperty, value); - } - else - { - SetInternalColorProperty(this, null, value); - } - } + get => GetOrCreateValue>(ColorProperty); + set => SetValue(ColorProperty, value); } /// View BackgroundBorder @@ -1085,30 +400,8 @@ public Selector Color [EditorBrowsable(EditorBrowsableState.Never)] public Selector BackgroundImageBorder { - get - { - Selector border = null; - if (NUIApplication.IsUsingXaml) - { - border = (Selector)GetValue(BackgroundImageBorderProperty); - } - else - { - border = (Selector)GetInternalBackgroundImageBorderProperty(this); - } - return (null != border) ? border : backgroundImageBorderSelector = new Selector(); - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(BackgroundImageBorderProperty, value); - } - else - { - SetInternalBackgroundImageBorderProperty(this, null, value); - } - } + get => GetOrCreateValue>(BackgroundImageBorderProperty); + set => SetValue(BackgroundImageBorderProperty, value); } /// @@ -1121,28 +414,8 @@ public Selector BackgroundImageBorder [EditorBrowsable(EditorBrowsableState.Never)] public Selector ImageShadow { - get - { - if (NUIApplication.IsUsingXaml) - { - return (Selector)GetValue(ImageShadowProperty); - } - else - { - return (Selector)GetInternalImageShadowProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(ImageShadowProperty, value); - } - else - { - SetInternalImageShadowProperty(this, null, value); - } - } + get => (Selector)GetValue(ImageShadowProperty); + set => SetValue(ImageShadowProperty, value); } /// @@ -1151,28 +424,8 @@ public Selector ImageShadow /// 9 public Selector BoxShadow { - get - { - if (NUIApplication.IsUsingXaml) - { - return (Selector)GetValue(BoxShadowProperty); - } - else - { - return (Selector)GetInternalBoxShadowProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(BoxShadowProperty, value); - } - else - { - SetInternalBoxShadowProperty(this, null, value); - } - } + get => (Selector)GetValue(BoxShadowProperty); + set => SetValue(BoxShadowProperty, value); } /// @@ -1183,28 +436,8 @@ public Selector BoxShadow /// 9 public Vector4 CornerRadius { - get - { - if (NUIApplication.IsUsingXaml) - { - return (Vector4)GetValue(CornerRadiusProperty); - } - else - { - return (Vector4)GetInternalCornerRadiusProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(CornerRadiusProperty, value); - } - else - { - SetInternalCornerRadiusProperty(this, null, value); - } - } + get => (Vector4)GetValue(CornerRadiusProperty); + set => SetValue(CornerRadiusProperty, value); } /// @@ -1215,28 +448,8 @@ public Vector4 CornerRadius /// 9 public VisualTransformPolicyType? CornerRadiusPolicy { - get - { - if (NUIApplication.IsUsingXaml) - { - return (VisualTransformPolicyType?)GetValue(CornerRadiusPolicyProperty); - } - else - { - return (VisualTransformPolicyType?)GetInternalCornerRadiusPolicyProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(CornerRadiusPolicyProperty, value); - } - else - { - SetInternalCornerRadiusPolicyProperty(this, null, value); - } - } + get => (VisualTransformPolicyType?)GetValue(CornerRadiusPolicyProperty); + set => SetValue(CornerRadiusPolicyProperty, value); } /// @@ -1245,28 +458,8 @@ public VisualTransformPolicyType? CornerRadiusPolicy /// 9 public float? BorderlineWidth { - get - { - if (NUIApplication.IsUsingXaml) - { - return (float?)GetValue(BorderlineWidthProperty); - } - else - { - return (float?)GetInternalBorderlineWidthProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(BorderlineWidthProperty, value); - } - else - { - SetInternalBorderlineWidthProperty(this, null, value); - } - } + get => (float?)GetValue(BorderlineWidthProperty); + set => SetValue(BorderlineWidthProperty, value); } /// @@ -1275,28 +468,8 @@ public float? BorderlineWidth /// 9 public Color BorderlineColor { - get - { - if (NUIApplication.IsUsingXaml) - { - return (Color)GetValue(BorderlineColorProperty); - } - else - { - return (Color)GetInternalBorderlineColorProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(BorderlineColorProperty, value); - } - else - { - SetInternalBorderlineColorProperty(this, null, value); - } - } + get => (Color)GetValue(BorderlineColorProperty); + set => SetValue(BorderlineColorProperty, value); } /// @@ -1305,30 +478,8 @@ public Color BorderlineColor [EditorBrowsable(EditorBrowsableState.Never)] public Selector BorderlineColorSelector { - get - { - Selector color = null; - if (NUIApplication.IsUsingXaml) - { - color = (Selector)GetValue(BorderlineColorSelectorProperty); - } - else - { - color = (Selector)GetInternalBorderlineColorSelectorProperty(this); - } - return (null != color) ? color : borderlineColorSelector = new Selector(); - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(BorderlineColorSelectorProperty, value); - } - else - { - SetInternalBorderlineColorSelectorProperty(this, null, value); - } - } + get => GetOrCreateValue>(BorderlineColorSelectorProperty); + set => SetValue(BorderlineColorSelectorProperty, value); } /// @@ -1341,28 +492,8 @@ public Selector BorderlineColorSelector /// 9 public float? BorderlineOffset { - get - { - if (NUIApplication.IsUsingXaml) - { - return (float?)GetValue(BorderlineOffsetProperty); - } - else - { - return (float?)GetInternalBorderlineOffsetProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(BorderlineOffsetProperty, value); - } - else - { - SetInternalBorderlineOffsetProperty(this, null, value); - } - } + get => (float?)GetValue(BorderlineOffsetProperty); + set => SetValue(BorderlineOffsetProperty, value); } /// @@ -1371,28 +502,8 @@ public float? BorderlineOffset [EditorBrowsable(EditorBrowsableState.Never)] public bool? ThemeChangeSensitive { - get - { - if (NUIApplication.IsUsingXaml) - { - return (bool?)GetValue(ThemeChangeSensitiveProperty); - } - else - { - return (bool?)GetInternalThemeChangeSensitiveProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(ThemeChangeSensitiveProperty, value); - } - else - { - SetInternalThemeChangeSensitiveProperty(this, null, value); - } - } + get => (bool?)GetValue(ThemeChangeSensitiveProperty); + set => SetValue(ThemeChangeSensitiveProperty, value); } /// @@ -1401,28 +512,8 @@ public bool? ThemeChangeSensitive [EditorBrowsable(EditorBrowsableState.Never)] public bool? IsEnabled { - get - { - if (NUIApplication.IsUsingXaml) - { - return (bool?)GetValue(IsEnabledProperty); - } - else - { - return (bool?)GetInternalIsEnabledProperty(this); - } - } - set - { - if (NUIApplication.IsUsingXaml) - { - SetValue(IsEnabledProperty, value); - } - else - { - SetInternalIsEnabledProperty(this, null, value); - } - } + get => (bool?)GetValue(IsEnabledProperty); + set => SetValue(IsEnabledProperty, value); } /// @@ -1465,9 +556,7 @@ public void Dispose() [EditorBrowsable(EditorBrowsableState.Never)] public override void CopyFrom(BindableObject other) { - var source = other as ViewStyle; - - if (source == null || source.DirtyProperties == null || source.DirtyProperties.Count == 0) + if (!(other is ViewStyle source)) { return; } @@ -1475,29 +564,16 @@ public override void CopyFrom(BindableObject other) IncludeDefaultStyle = source.IncludeDefaultStyle; SolidNull = source.SolidNull; - BindableProperty.GetBindablePropertysOfType(GetType(), out var thisBindableProperties); - - if (thisBindableProperties == null) - { - return; - } - - foreach (var sourceProperty in source.DirtyProperties) + foreach (var (property, value) in source.values) { - var sourceValue = source.GetValue(sourceProperty); - - if (sourceValue == null) - { - continue; - } - - thisBindableProperties.TryGetValue(sourceProperty.PropertyName, out var destinationProperty); - - if (destinationProperty != null) + if (value != null) { - InternalSetValue(destinationProperty, sourceValue); + values[property] = value; } } + + // NOTE Support backward compatibility. + CopyBindablePropertyValues(source); } /// @@ -1515,18 +591,7 @@ protected virtual void Dispose(bool disposing) if (disposing) { // Dispose managed state (managed objects). - margin?.Dispose(); - maximumSize?.Dispose(); - minimumSize?.Dispose(); - orientation?.Dispose(); - padding?.Dispose(); - parentOrigin?.Dispose(); - pivotPoint?.Dispose(); - position?.Dispose(); - size?.Dispose(); - sizeModeFactor?.Dispose(); - cornerRadius?.Dispose(); - borderlineColor?.Dispose(); + values = null; } disposed = true; @@ -1557,6 +622,80 @@ internal void MergeDirectly(ViewStyle other) { CopyFrom(other); } + + internal IEnumerable<(IStyleProperty, object)> GetProperties() + { + foreach (var (key, value) in values) + { + if (value != null) + { + yield return (key, value); + } + } + } + + [EditorBrowsable(EditorBrowsableState.Never)] + protected virtual object GetValue(IStyleProperty styleProperty) + { + if (values.TryGetValue(styleProperty, out var value)) + { + return value; + } + return default; + } + + [EditorBrowsable(EditorBrowsableState.Never)] + protected virtual T GetOrCreateValue(IStyleProperty styleProperty) + { + T newValue = (T)Activator.CreateInstance(typeof(T)); + values[styleProperty] = newValue; + return newValue; + } + + [EditorBrowsable(EditorBrowsableState.Never)] + protected virtual void SetValue(IStyleProperty styleProperty, object value) + { + // NOTE Allow null value. It is used when merging styles with solid null option + values[styleProperty] = value; + } + + private void CopyBindablePropertyValues(ViewStyle source) + { + // NOTE This is to support legacy way of copying styles using bindable properties. + // Please do not spend time to keep this code + // This is just to make sure we don't break backward compatibility + if (source.DirtyProperties == null || source.DirtyProperties.Count == 0) + { + return; + } + + IncludeDefaultStyle = source.IncludeDefaultStyle; + SolidNull = source.SolidNull; + + BindableProperty.GetBindablePropertysOfType(GetType(), out var thisBindableProperties); + + if (thisBindableProperties == null) + { + return; + } + + foreach (var sourceProperty in source.DirtyProperties) + { + var sourceValue = source.GetValue(sourceProperty); + + if (sourceValue == null) + { + continue; + } + + thisBindableProperties.TryGetValue(sourceProperty.PropertyName, out var destinationProperty); + + if (destinationProperty != null) + { + InternalSetValue(destinationProperty, sourceValue); + } + } + } } /// Extension methods for ViewStyle class. diff --git a/src/Tizen.NUI/src/public/BaseComponents/Style/ViewStyleBindableProperty.cs b/src/Tizen.NUI/src/public/BaseComponents/Style/ViewStyleBindableProperty.cs deleted file mode 100755 index 2de5ebec66f..00000000000 --- a/src/Tizen.NUI/src/public/BaseComponents/Style/ViewStyleBindableProperty.cs +++ /dev/null @@ -1,610 +0,0 @@ -/* - * Copyright(c) 2022 Samsung Electronics Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -using System.ComponentModel; -using Tizen.NUI.Binding; - -namespace Tizen.NUI.BaseComponents -{ - public partial class ViewStyle - { - /// Bindable property of BackgroundImage. Do not open it. - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty BackgroundImageProperty = null; - internal static void SetInternalBackgroundImageProperty(BindableObject bindable, object oldValue, object newValue) - { - var viewStyle = (ViewStyle)bindable; - if (newValue == null) - { - viewStyle.backgroundImageSelector = null; - } - else - { - viewStyle.backgroundImageSelector = (Selector)newValue; - viewStyle.backgroundColorSelector = null; - } - } - internal static object GetInternalBackgroundImageProperty(BindableObject bindable) - { - return ((ViewStyle)bindable).backgroundImageSelector; - } - - /// Bindable property of Focusable. Do not open it. - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty FocusableProperty = null; - internal static void SetInternalFocusableProperty(BindableObject bindable, object oldValue, object newValue) - { - ((ViewStyle)bindable).focusable = (bool?)newValue; - } - internal static object GetInternalFocusableProperty(BindableObject bindable) - { - return ((ViewStyle)bindable).focusable; - } - - /// Bindable property of FocusableChildren. Do not open it. - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty FocusableChildrenProperty = null; - internal static void SetInternalFocusableChildrenProperty(BindableObject bindable, object oldValue, object newValue) - { - ((ViewStyle)bindable).focusableChildren = (bool?)newValue; - } - internal static object GetInternalFocusableChildrenProperty(BindableObject bindable) - { - return ((ViewStyle)bindable).focusableChildren; - } - - /// Bindable property of FocusableInTouch. Do not open it. - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty FocusableInTouchProperty = null; - internal static void SetInternalFocusableInTouchProperty(BindableObject bindable, object oldValue, object newValue) - { - ((ViewStyle)bindable).focusableInTouch = (bool?)newValue; - } - internal static object GetInternalFocusableInTouchProperty(BindableObject bindable) - { - return ((ViewStyle)bindable).focusableInTouch; - } - - /// Bindable property of Focusable. Do not open it. - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty Size2DProperty = null; - internal static void SetInternalSize2DProperty(BindableObject bindable, object oldValue, object newValue) - { - var viewStyle = (ViewStyle)bindable; - viewStyle.size = newValue == null ? null : new Size((Size2D)newValue); - } - internal static object GetInternalSize2DProperty(BindableObject bindable) - { - var viewStyle = (ViewStyle)bindable; - return viewStyle.size == null ? null : (Size2D)viewStyle.size; - } - - /// Bindable property of Opacity. Do not open it. - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty OpacityProperty = null; - internal static void SetInternalOpacityProperty(BindableObject bindable, object oldValue, object newValue) - { - ((ViewStyle)bindable).opacitySelector = (Selector)newValue; - } - internal static object GetInternalOpacityProperty(BindableObject bindable) - { - return ((ViewStyle)bindable).opacitySelector; - } - - /// Bindable property of Position2D. Do not open it. - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty Position2DProperty = null; - internal static void SetInternalPosition2DProperty(BindableObject bindable, object oldValue, object newValue) - { - var viewStyle = (ViewStyle)bindable; - viewStyle.position = newValue == null ? null : new Position((Position2D)newValue); - } - internal static object GetInternalPosition2DProperty(BindableObject bindable) - { - var viewStyle = (ViewStyle)bindable; - return viewStyle.position == null ? null : new Position2D(viewStyle.position); - } - - /// Bindable property of PositionUsesPivotPoint. Do not open it. - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty PositionUsesPivotPointProperty = null; - internal static void SetInternalPositionUsesPivotPointProperty(BindableObject bindable, object oldValue, object newValue) - { - ((ViewStyle)bindable).positionUsesPivotPoint = (bool?)newValue; - } - internal static object GetInternalPositionUsesPivotPointProperty(BindableObject bindable) - { - return ((ViewStyle)bindable).positionUsesPivotPoint; - } - - /// Bindable property of ParentOrigin. Do not open it. - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty ParentOriginProperty = null; - internal static void SetInternalParentOriginProperty(BindableObject bindable, object oldValue, object newValue) - { - ((ViewStyle)bindable).parentOrigin = (Position)newValue; - } - internal static object GetInternalParentOriginProperty(BindableObject bindable) - { - return ((ViewStyle)bindable).parentOrigin; - } - - /// Bindable property of PivotPoint. Do not open it. - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty PivotPointProperty = null; - internal static void SetInternalPivotPointProperty(BindableObject bindable, object oldValue, object newValue) - { - ((ViewStyle)bindable).pivotPoint = (Position)newValue; - } - internal static object GetInternalPivotPointProperty(BindableObject bindable) - { - return ((ViewStyle)bindable).pivotPoint; - } - - /// Bindable property of SizeWidth. Do not open it. - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty SizeWidthProperty = null; - internal static void SetInternalSizeWidthProperty(BindableObject bindable, object oldValue, object newValue) - { - var viewStyle = (ViewStyle)bindable; - if (newValue != null) - { - if (viewStyle.size == null) - { - if ((float)newValue == 0) return; - } - viewStyle.size = new Size((float)newValue, viewStyle.size?.Height ?? 0); - } - } - internal static object GetInternalSizeWidthProperty(BindableObject bindable) - { - return ((ViewStyle)bindable).size?.Width; - } - - /// Bindable property of SizeHeight. Do not open it. - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty SizeHeightProperty = null; - internal static void SetInternalSizeHeightProperty(BindableObject bindable, object oldValue, object newValue) - { - var viewStyle = (ViewStyle)bindable; - if (newValue != null) - { - if (viewStyle.size == null) - { - if ((float)newValue == 0) return; - } - viewStyle.size = new Size(viewStyle.size?.Width ?? 0, (float)newValue); - } - } - internal static object GetInternalSizeHeightProperty(BindableObject bindable) - { - return ((ViewStyle)bindable).size?.Height; - } - - /// Bindable property of Position. Do not open it. - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty PositionProperty = null; - internal static void SetInternalPositionProperty(BindableObject bindable, object oldValue, object newValue) - { - var viewStyle = (ViewStyle)bindable; - viewStyle.position = (Position)newValue; - if (viewStyle.position != null && viewStyle.position.X == 0 && viewStyle.position.Y == 0) - { - viewStyle.position = null; - } - } - internal static object GetInternalPositionProperty(BindableObject bindable) - { - var viewStyle = (ViewStyle)bindable; - return viewStyle.position; - } - - /// Bindable property of PositionX. Do not open it. - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty PositionXProperty = null; - internal static void SetInternalPositionXProperty(BindableObject bindable, object oldValue, object newValue) - { - var viewStyle = (ViewStyle)bindable; - if (newValue != null) - { - if (viewStyle.position == null) - { - if ((float)newValue == 0) return; - } - viewStyle.position = new Position((float)newValue, viewStyle.position?.Y ?? 0); - } - } - internal static object GetInternalPositionXProperty(BindableObject bindable) - { - return ((ViewStyle)bindable).position?.X; - } - - /// Bindable property of PositionY. Do not open it. - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty PositionYProperty = null; - internal static void SetInternalPositionYProperty(BindableObject bindable, object oldValue, object newValue) - { - var viewStyle = (ViewStyle)bindable; - if (newValue != null) - { - if (viewStyle.position == null) - { - if ((float)newValue == 0) return; - } - viewStyle.position = new Position(viewStyle.position?.X ?? 0, (float)newValue); - } - } - internal static object GetInternalPositionYProperty(BindableObject bindable) - { - return ((ViewStyle)bindable).position?.Y; - } - - /// Bindable property of Orientation. Do not open it. - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty OrientationProperty = null; - internal static void SetInternalOrientationProperty(BindableObject bindable, object oldValue, object newValue) - { - ((ViewStyle)bindable).orientation = (Rotation)newValue; - } - internal static object GetInternalOrientationProperty(BindableObject bindable) - { - return ((ViewStyle)bindable).orientation; - } - - /// Bindable property of DrawMode. Do not open it. - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty DrawModeProperty = null; - internal static void SetInternalDrawModeProperty(BindableObject bindable, object oldValue, object newValue) - { - ((ViewStyle)bindable).drawMode = (DrawModeType?)newValue; - } - internal static object GetInternalDrawModeProperty(BindableObject bindable) - { - return ((ViewStyle)bindable).drawMode; - } - - /// Bindable property of SizeModeFactor. Do not open it. - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty SizeModeFactorProperty = null; - internal static void SetInternalSizeModeFactorProperty(BindableObject bindable, object oldValue, object newValue) - { - ((ViewStyle)bindable).sizeModeFactor = (Vector3)newValue; - } - internal static object GetInternalSizeModeFactorProperty(BindableObject bindable) - { - return ((ViewStyle)bindable).sizeModeFactor; - } - - /// Bindable property of WidthResizePolicy. Do not open it. - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty WidthResizePolicyProperty = null; - internal static void SetInternalWidthResizePolicyProperty(BindableObject bindable, object oldValue, object newValue) - { - ((ViewStyle)bindable).widthResizePolicy = (ResizePolicyType?)newValue; - } - internal static object GetInternalWidthResizePolicyProperty(BindableObject bindable) - { - return ((ViewStyle)bindable).widthResizePolicy; - } - - /// Bindable property of HeightResizePolicy. Do not open it. - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty HeightResizePolicyProperty = null; - internal static void SetInternalHeightResizePolicyProperty(BindableObject bindable, object oldValue, object newValue) - { - ((ViewStyle)bindable).heightResizePolicy = (ResizePolicyType?)newValue; - } - internal static object GetInternalHeightResizePolicyProperty(BindableObject bindable) - { - return ((ViewStyle)bindable).heightResizePolicy; - } - - /// Bindable property of WidthForHeight. Do not open it. - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty WidthForHeightProperty = null; - internal static void SetInternalWidthForHeightProperty(BindableObject bindable, object oldValue, object newValue) - { - ((ViewStyle)bindable).widthForHeight = (bool?)newValue; - } - internal static object GetInternalWidthForHeightProperty(BindableObject bindable) - { - return ((ViewStyle)bindable).widthForHeight; - } - - /// Bindable property of HeightForWidth. Do not open it. - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty HeightForWidthProperty = null; - internal static void SetInternalHeightForWidthProperty(BindableObject bindable, object oldValue, object newValue) - { - ((ViewStyle)bindable).heightForWidth = (bool?)newValue; - } - internal static object GetInternalHeightForWidthProperty(BindableObject bindable) - { - return ((ViewStyle)bindable).heightForWidth; - } - - /// Bindable property of Padding. Do not open it. - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty PaddingProperty = null; - internal static void SetInternalPaddingProperty(BindableObject bindable, object oldValue, object newValue) - { - ((ViewStyle)bindable).padding = (Extents)newValue; - } - internal static object GetInternalPaddingProperty(BindableObject bindable) - { - return ((ViewStyle)bindable).padding; - } - - /// Bindable property of MinimumSize. Do not open it. - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty MinimumSizeProperty = null; - internal static void SetInternalMinimumSizeProperty(BindableObject bindable, object oldValue, object newValue) - { - ((ViewStyle)bindable).minimumSize = (Size2D)newValue; - } - internal static object GetInternalMinimumSizeProperty(BindableObject bindable) - { - return ((ViewStyle)bindable).minimumSize; - } - - /// Bindable property of MaximumSize. Do not open it. - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty MaximumSizeProperty = null; - internal static void SetInternalMaximumSizeProperty(BindableObject bindable, object oldValue, object newValue) - { - ((ViewStyle)bindable).maximumSize = (Size2D)newValue; - } - internal static object GetInternalMaximumSizeProperty(BindableObject bindable) - { - return ((ViewStyle)bindable).maximumSize; - } - - /// Bindable property of ClippingMode. Do not open it. - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty ClippingModeProperty = null; - internal static void SetInternalClippingModeProperty(BindableObject bindable, object oldValue, object newValue) - { - ((ViewStyle)bindable).clippingMode = (ClippingModeType?)newValue; - } - internal static object GetInternalClippingModeProperty(BindableObject bindable) - { - return ((ViewStyle)bindable).clippingMode; - } - - /// Bindable property of Size. Do not open it. - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty SizeProperty = null; - internal static void SetInternalSizeProperty(BindableObject bindable, object oldValue, object newValue) - { - var viewStyle = (ViewStyle)bindable; - viewStyle.size = (Size)newValue; - if (viewStyle.size != null && viewStyle.size.Width == 0 && viewStyle.size.Height == 0) - { - viewStyle.size = null; - } - } - internal static object GetInternalSizeProperty(BindableObject bindable) - { - var viewStyle = (ViewStyle)bindable; - return viewStyle.size; - } - - /// Bindable property of Margin. Do not open it. - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty MarginProperty = null; - internal static void SetInternalMarginProperty(BindableObject bindable, object oldValue, object newValue) - { - ((ViewStyle)bindable).margin = (Extents)newValue; - } - internal static object GetInternalMarginProperty(BindableObject bindable) - { - return ((ViewStyle)bindable).margin; - } - - /// Bindable property of BackgroundColor. Do not open it. - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty BackgroundColorProperty = null; - internal static void SetInternalBackgroundColorProperty(BindableObject bindable, object oldValue, object newValue) - { - var viewStyle = (ViewStyle)bindable; - - if (newValue == null) - { - viewStyle.backgroundColorSelector = null; - } - else - { - viewStyle.backgroundColorSelector = (Selector)newValue; - viewStyle.backgroundImageSelector = null; - } - } - internal static object GetInternalBackgroundColorProperty(BindableObject bindable) - { - return ((ViewStyle)bindable).backgroundColorSelector; - } - - /// Bindable property of ColorSelector. Do not open it. - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty ColorProperty = null; - internal static void SetInternalColorProperty(BindableObject bindable, object oldValue, object newValue) - { - ((ViewStyle)bindable).colorSelector = (Selector)newValue; - } - internal static object GetInternalColorProperty(BindableObject bindable) - { - return ((ViewStyle)bindable).colorSelector; - } - - /// Bindable property of BackgroundImageBorder. Do not open it. - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty BackgroundImageBorderProperty = null; - internal static void SetInternalBackgroundImageBorderProperty(BindableObject bindable, object oldValue, object newValue) - { - ((ViewStyle)bindable).backgroundImageBorderSelector = (Selector)newValue; - } - internal static object GetInternalBackgroundImageBorderProperty(BindableObject bindable) - { - return ((ViewStyle)bindable).backgroundImageBorderSelector; - } - - /// Bindable property of ImageShadow. Do not open it. - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty ImageShadowProperty = null; - internal static void SetInternalImageShadowProperty(BindableObject bindable, object oldValue, object newValue) - { - var viewStyle = (ViewStyle)bindable; - - viewStyle.imageShadow = (Selector)newValue; - - if (viewStyle.imageShadow != null) - { - viewStyle.boxShadow = null; - } - } - internal static object GetInternalImageShadowProperty(BindableObject bindable) - { - var viewStyle = (ViewStyle)bindable; - return ((ViewStyle)bindable).imageShadow; - } - - /// Bindable property of BoxShadow. Do not open it. - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty BoxShadowProperty = null; - internal static void SetInternalBoxShadowProperty(BindableObject bindable, object oldValue, object newValue) - { - var viewStyle = (ViewStyle)bindable; - - viewStyle.boxShadow = (Selector)newValue; - - if (viewStyle.boxShadow != null) - { - viewStyle.imageShadow = null; - } - } - internal static object GetInternalBoxShadowProperty(BindableObject bindable) - { - var viewStyle = (ViewStyle)bindable; - return ((ViewStyle)bindable).boxShadow; - } - - /// Bindable property of CornerRadius. Do not open it. - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty CornerRadiusProperty = null; - internal static void SetInternalCornerRadiusProperty(BindableObject bindable, object oldValue, object newValue) - { - ((ViewStyle)bindable).cornerRadius = (Vector4)newValue; - } - internal static object GetInternalCornerRadiusProperty(BindableObject bindable) - { - return ((ViewStyle)bindable).cornerRadius; - } - - /// Bindable property of CornerRadiusPolicy. Do not open it. - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty CornerRadiusPolicyProperty = null; - internal static void SetInternalCornerRadiusPolicyProperty(BindableObject bindable, object oldValue, object newValue) - { - ((ViewStyle)bindable).cornerRadiusPolicy = (VisualTransformPolicyType?)newValue; - } - internal static object GetInternalCornerRadiusPolicyProperty(BindableObject bindable) - { - return ((ViewStyle)bindable).cornerRadiusPolicy; - } - - /// Bindable property of BorderlineWidth. Do not open it. - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty BorderlineWidthProperty = null; - internal static void SetInternalBorderlineWidthProperty(BindableObject bindable, object oldValue, object newValue) - { - ((ViewStyle)bindable).borderlineWidth = (float?)newValue; - } - internal static object GetInternalBorderlineWidthProperty(BindableObject bindable) - { - return ((ViewStyle)bindable).borderlineWidth; - } - - /// Bindable property of BorderlineColor. Do not open it. - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty BorderlineColorProperty = null; - internal static void SetInternalBorderlineColorProperty(BindableObject bindable, object oldValue, object newValue) - { - ((ViewStyle)bindable).borderlineColor = (Color)newValue; - } - internal static object GetInternalBorderlineColorProperty(BindableObject bindable) - { - return ((ViewStyle)bindable).borderlineColor ?? Tizen.NUI.Color.Black; - } - - /// Bindable property of BorderlineColorSelector. Do not open it. - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty BorderlineColorSelectorProperty = null; - internal static void SetInternalBorderlineColorSelectorProperty(BindableObject bindable, object oldValue, object newValue) - { - var viewStyle = (ViewStyle)bindable; - - if (newValue == null) - { - viewStyle.borderlineColorSelector = null; - } - else - { - viewStyle.borderlineColorSelector = (Selector)newValue; - } - } - internal static object GetInternalBorderlineColorSelectorProperty(BindableObject bindable) - { - return ((ViewStyle)bindable).borderlineColorSelector; - } - - /// Bindable property of BorderlineOffset. Do not open it. - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty BorderlineOffsetProperty = null; - internal static void SetInternalBorderlineOffsetProperty(BindableObject bindable, object oldValue, object newValue) - { - ((ViewStyle)bindable).borderlineOffset = (float?)newValue; - } - internal static object GetInternalBorderlineOffsetProperty(BindableObject bindable) - { - return ((ViewStyle)bindable).borderlineOffset; - } - - /// Bindable property of ThemeChangeSensitive. Do not open it. - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty ThemeChangeSensitiveProperty = null; - internal static void SetInternalThemeChangeSensitiveProperty(BindableObject bindable, object oldValue, object newValue) - { - ((ViewStyle)bindable).themeChangeSensitive = (bool?)newValue; - } - internal static object GetInternalThemeChangeSensitiveProperty(BindableObject bindable) - { - return ((ViewStyle)bindable).themeChangeSensitive; - } - - /// 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 static readonly BindableProperty IsEnabledProperty = null; - internal static void SetInternalIsEnabledProperty(BindableObject bindable, object oldValue, object newValue) - { - var buttonStyle = (ViewStyle)bindable; - buttonStyle.isEnabled = (bool?)newValue; - } - internal static object GetInternalIsEnabledProperty(BindableObject bindable) - { - var buttonStyle = (ViewStyle)bindable; - return buttonStyle.isEnabled; - } - } -} diff --git a/src/Tizen.NUI/src/public/BaseComponents/View.cs b/src/Tizen.NUI/src/public/BaseComponents/View.cs index 430fb0a4332..c630e3a0524 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/View.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/View.cs @@ -5857,44 +5857,16 @@ public virtual void ApplyStyle(ViewStyle viewStyle) themeData.viewStyle = viewStyle; - if (viewStyle.DirtyProperties == null || viewStyle.DirtyProperties.Count == 0) - { - // Nothing to apply - return; - } + ChangedPropertiesSetExcludingStyle = new HashSet(); - BindableProperty.GetBindablePropertysOfType(GetType(), out var bindablePropertyOfView); - - if (bindablePropertyOfView == null) + foreach (var (property, value) in viewStyle.GetProperties()) { - return; + // TODO Check isThemeChanged & ChangedPropertiesSetExcludingStyle + property.ApplyTo(this, value); } - var dirtyStyleProperties = new BindableProperty[viewStyle.DirtyProperties.Count]; - viewStyle.DirtyProperties.CopyTo(dirtyStyleProperties); - - foreach (var sourceProperty in dirtyStyleProperties) - { - var sourceValue = viewStyle.GetValue(sourceProperty); - - if (sourceValue == null) - { - continue; - } - - bindablePropertyOfView.TryGetValue(sourceProperty.PropertyName, out var destinationProperty); - - // Do not set value again when theme is changed and the value has been set already. - if (isThemeChanged && ChangedPropertiesSetExcludingStyle.Contains(destinationProperty)) - { - continue; - } - - if (destinationProperty != null) - { - InternalSetValue(destinationProperty, sourceValue); - } - } + // NOTE Support backward compatibility. + ApplyStyleUsingBindableProperty(viewStyle); } /// @@ -6055,5 +6027,48 @@ private LayoutExtraData EnsureLayoutExtraData() } private void RequestLayout() => layoutExtraData?.Layout?.RequestLayout(); + + private void ApplyStyleUsingBindableProperty(ViewStyle viewStyle) + { + // NOTE Support backward compatibility. + if (viewStyle.DirtyProperties == null || viewStyle.DirtyProperties.Count == 0) + { + // Nothing to apply + return; + } + + BindableProperty.GetBindablePropertysOfType(GetType(), out var bindablePropertyOfView); + + if (bindablePropertyOfView == null) + { + return; + } + + var dirtyStyleProperties = new BindableProperty[viewStyle.DirtyProperties.Count]; + viewStyle.DirtyProperties.CopyTo(dirtyStyleProperties); + + foreach (var sourceProperty in dirtyStyleProperties) + { + var sourceValue = viewStyle.GetValue(sourceProperty); + + if (sourceValue == null) + { + continue; + } + + bindablePropertyOfView.TryGetValue(sourceProperty.PropertyName, out var destinationProperty); + + // Do not set value again when theme is changed and the value has been set already. + if (isThemeChanged && ChangedPropertiesSetExcludingStyle != null && ChangedPropertiesSetExcludingStyle.Contains(destinationProperty.PropertyName)) + { + continue; + } + + if (destinationProperty != null) + { + InternalSetValue(destinationProperty, sourceValue); + } + } + } } } diff --git a/src/Tizen.NUI/src/public/Common/BaseHandle.cs b/src/Tizen.NUI/src/public/Common/BaseHandle.cs index 61cafd19ce8..97b344c46db 100755 --- a/src/Tizen.NUI/src/public/Common/BaseHandle.cs +++ b/src/Tizen.NUI/src/public/Common/BaseHandle.cs @@ -576,6 +576,11 @@ public bool IsEqual(BaseHandle rhs) internal void NotifyPropertyChanged([CallerMemberName] String propertyName = "") { PropertySet?.Invoke(this, new PropertyChangedEventArgs(propertyName)); + + if (!ThemeManager.InitialThemeDisabled && ChangedPropertiesSetExcludingStyle != null) + { + ChangedPropertiesSetExcludingStyle.Add(propertyName); + } } internal void UnregisterFromRegistry() diff --git a/src/Tizen.NUI/src/public/Theme/Theme.cs b/src/Tizen.NUI/src/public/Theme/Theme.cs index 48852b62437..5139c5b3253 100755 --- a/src/Tizen.NUI/src/public/Theme/Theme.cs +++ b/src/Tizen.NUI/src/public/Theme/Theme.cs @@ -358,11 +358,13 @@ public void Merge(Theme theme) } else if (map.ContainsKey(item.Key) && !item.Value.SolidNull) { - map[item.Key].MergeDirectly(item.Value); + var merged = map[item.Key].Clone(); + merged.MergeDirectly(item.Value); + map[item.Key] = merged; } else { - map[item.Key] = item.Value.Clone(); + map[item.Key] = item.Value; } } diff --git a/src/Tizen.NUI/src/public/Theme/ThemeManager.cs b/src/Tizen.NUI/src/public/Theme/ThemeManager.cs index df6cddfa935..bbfa74b44ae 100755 --- a/src/Tizen.NUI/src/public/Theme/ThemeManager.cs +++ b/src/Tizen.NUI/src/public/Theme/ThemeManager.cs @@ -61,6 +61,7 @@ public static class ThemeManager private static readonly List packages = new List();// This is to store base theme creators by packages. private static bool platformThemeEnabled = false; private static bool isInEventProgress = false; + private static bool updateThemeDirty = false; static ThemeManager() { @@ -174,7 +175,7 @@ internal static bool PlatformThemeEnabled #if PROFILE_TV internal const bool InitialThemeDisabled = true; -#else +#else internal const bool InitialThemeDisabled = false; #endif @@ -215,22 +216,26 @@ public static void ApplyTheme(Theme theme) [EditorBrowsable(EditorBrowsableState.Never)] public static void AppendTheme(Theme theme) { - var newTheme = (Theme)theme?.Clone() ?? throw new ArgumentNullException(nameof(theme)); + if (theme == null) + { + throw new ArgumentNullException(nameof(theme)); + } - if (string.IsNullOrEmpty(newTheme.Id)) + // var newTheme = (Theme)theme?.Clone() ?? throw new ArgumentNullException(nameof(theme)); + + if (string.IsNullOrEmpty(theme.Id)) { - newTheme.Id = "NONAME"; + theme.Id = "NONAME"; } - if (newTheme.SmallBrokenImageUrl != null) StyleManager.Instance.SetBrokenImageUrl(StyleManager.BrokenImageType.Small, newTheme.SmallBrokenImageUrl); - if (newTheme.BrokenImageUrl != null) StyleManager.Instance.SetBrokenImageUrl(StyleManager.BrokenImageType.Normal, newTheme.BrokenImageUrl); - if (newTheme.LargeBrokenImageUrl != null) StyleManager.Instance.SetBrokenImageUrl(StyleManager.BrokenImageType.Large, newTheme.LargeBrokenImageUrl); + if (theme.SmallBrokenImageUrl != null) StyleManager.Instance.SetBrokenImageUrl(StyleManager.BrokenImageType.Small, theme.SmallBrokenImageUrl); + if (theme.BrokenImageUrl != null) StyleManager.Instance.SetBrokenImageUrl(StyleManager.BrokenImageType.Normal, theme.BrokenImageUrl); + if (theme.LargeBrokenImageUrl != null) StyleManager.Instance.SetBrokenImageUrl(StyleManager.BrokenImageType.Large, theme.LargeBrokenImageUrl); - if (userTheme == null) userTheme = newTheme; + if (userTheme == null) userTheme = theme; else { - userTheme = (Theme)userTheme.Clone(); - userTheme.MergeWithoutClone(newTheme); + userTheme.Merge(theme); } UpdateThemeForInitialize(); @@ -342,13 +347,13 @@ public static ViewStyle GetPlatformStyle(Type viewType) /// Load a style with style name in the current theme. /// /// The style name. - internal static ViewStyle GetUpdateStyleWithoutClone(string styleName) => themeForUpdate?.GetStyle(styleName); + internal static ViewStyle GetUpdateStyleWithoutClone(string styleName) => ThemeForUpdate?.GetStyle(styleName); /// /// Load a style with View type in the current theme. /// /// The type of View. - internal static ViewStyle GetUpdateStyleWithoutClone(Type viewType) => themeForUpdate?.GetStyle(viewType); + internal static ViewStyle GetUpdateStyleWithoutClone(Type viewType) => ThemeForUpdate?.GetStyle(viewType); /// /// Load a initial component style. @@ -491,21 +496,33 @@ internal static void AddPackageTheme(IThemeCreator themeCreator) // TODO Please make it private after removing Tizen.NUI.Components.StyleManager. internal static void UpdateThemeForUpdate() { - if (userTheme == null) - { - themeForUpdate = platformTheme; - return; - } + updateThemeDirty = true; + } - if (platformTheme == null) + static Theme ThemeForUpdate + { + get { - themeForUpdate = userTheme; - return; + if (updateThemeDirty) + { + if (userTheme == null) + { + themeForUpdate = platformTheme; + } + else if (platformTheme == null) + { + themeForUpdate = userTheme; + } + else + { + themeForUpdate = new Theme(); + themeForUpdate.Merge(platformTheme); + themeForUpdate.Merge(userTheme); + } + updateThemeDirty = false; + } + return themeForUpdate; } - - themeForUpdate = new Theme(); - themeForUpdate.Merge(platformTheme); - themeForUpdate.MergeWithoutClone(userTheme); } // TODO Please make it private after removing Tizen.NUI.Components.StyleManager. @@ -523,12 +540,12 @@ internal static void UpdateThemeForInitialize() if (userTheme == null) { - if (platformTheme != null) themeForInitialize.MergeWithoutClone(platformTheme); + if (platformTheme != null) themeForInitialize.Merge(platformTheme); } else { if (platformTheme != null) themeForInitialize.Merge(platformTheme); - themeForInitialize.MergeWithoutClone(userTheme); + themeForInitialize.Merge(userTheme); } } @@ -543,7 +560,7 @@ private static void UpdatePlatformTheme(Theme theme) for (var i = theme.PackageCount; i < packages.Count; i++) { - theme.MergeWithoutClone(CreatePlatformTheme(sharedResourcePath, packages[i])); + theme.Merge(CreatePlatformTheme(sharedResourcePath, packages[i])); } theme.PackageCount = packages.Count; } diff --git a/src/Tizen.NUI/src/public/XamlBinding/BindableObject.cs b/src/Tizen.NUI/src/public/XamlBinding/BindableObject.cs index 199c16a1006..33637ae42bc 100755 --- a/src/Tizen.NUI/src/public/XamlBinding/BindableObject.cs +++ b/src/Tizen.NUI/src/public/XamlBinding/BindableObject.cs @@ -299,7 +299,6 @@ public void EnforceNotifyBindedInstance(BindableProperty property) public void SetValue(BindableProperty property, object value) { InternalSetValue(property, value); - ChangedPropertiesSetExcludingStyle.Add(property); } internal void InternalSetValue(BindableProperty property, object value) @@ -332,19 +331,7 @@ internal void InternalSetValue(BindableProperty property, object value) } } - private HashSet changedPropertiesSetExcludingStyle; - internal protected HashSet ChangedPropertiesSetExcludingStyle - { - get - { - if (null == changedPropertiesSetExcludingStyle) - { - changedPropertiesSetExcludingStyle = new HashSet(); - } - - return changedPropertiesSetExcludingStyle; - } - } + internal HashSet ChangedPropertiesSetExcludingStyle { get; set; } /// /// Sets the value of the propertyKey. @@ -417,6 +404,7 @@ public static void RegisterPropertyGroup(BindableProperty property, HashSet /// Apply the bindings to BindingContext. ///