[NUI] Add ThemeManager (#2034)
authorJiyun Yang <ji.yang@samsung.com>
Thu, 29 Oct 2020 03:22:42 +0000 (12:22 +0900)
committerGitHub <noreply@github.com>
Thu, 29 Oct 2020 03:22:42 +0000 (12:22 +0900)
* [NUI] Refactoring Theme and StyleManager

* [NUI] Fix bugs and improve ThemeManager code

Signed-off-by: Jiyun Yang <ji.yang@samsung.com>
* [NUI] Fix button bugs that come after applying ThemeManager

In the DropDown button, the IconRelativeOrientation was not working
because it is set before ApplyStyle().
Potentially, IconPadding and TextPadding had same problem.
This patch fixes it.

Signed-off-by: Jiyun Yang <ji.yang@samsung.com>
93 files changed:
src/Tizen.NUI.Components/Controls/Button.Internal.cs
src/Tizen.NUI.Components/Controls/Button.cs
src/Tizen.NUI.Components/Controls/CheckBox.cs
src/Tizen.NUI.Components/Controls/Control.cs
src/Tizen.NUI.Components/Controls/DropDown.DropDownDataItem.cs
src/Tizen.NUI.Components/Controls/DropDown.DropDownItemView.cs
src/Tizen.NUI.Components/Controls/DropDown.cs
src/Tizen.NUI.Components/Controls/Extension/LottieButtonExtension.cs
src/Tizen.NUI.Components/Controls/Extension/LottieSwitchExtension.cs
src/Tizen.NUI.Components/Controls/ImageScrollBar.cs
src/Tizen.NUI.Components/Controls/Loading.cs
src/Tizen.NUI.Components/Controls/Popup.cs
src/Tizen.NUI.Components/Controls/Progress.cs
src/Tizen.NUI.Components/Controls/RadioButton.cs
src/Tizen.NUI.Components/Controls/ScrollableBase.cs
src/Tizen.NUI.Components/Controls/Scrollbar.cs
src/Tizen.NUI.Components/Controls/Slider.cs
src/Tizen.NUI.Components/Controls/Switch.cs
src/Tizen.NUI.Components/Controls/Tab.cs
src/Tizen.NUI.Components/Controls/Toast.cs
src/Tizen.NUI.Components/PreloadStyle/DefaultTheme.cs [deleted file]
src/Tizen.NUI.Components/PreloadStyle/OverlayAnimationButtonStyle.cs
src/Tizen.NUI.Components/PreloadStyle/WearableTheme.cs [deleted file]
src/Tizen.NUI.Components/Style/ButtonStyle.cs
src/Tizen.NUI.Components/Style/ControlStyle.cs
src/Tizen.NUI.Components/Style/DropDownStyle.cs
src/Tizen.NUI.Components/Style/LoadingStyle.cs
src/Tizen.NUI.Components/Style/PaginationStyle.cs
src/Tizen.NUI.Components/Style/PopupStyle.cs
src/Tizen.NUI.Components/Style/ProgressStyle.cs
src/Tizen.NUI.Components/Style/ScrollbarStyle.cs
src/Tizen.NUI.Components/Style/SliderStyle.cs
src/Tizen.NUI.Components/Style/SwitchStyle.cs
src/Tizen.NUI.Components/Style/TabStyle.cs
src/Tizen.NUI.Components/Style/Theme.cs [deleted file]
src/Tizen.NUI.Components/Style/ToastStyle.cs
src/Tizen.NUI.Components/Tizen.NUI.Components.csproj
src/Tizen.NUI.Components/Utils/StyleManager.cs
src/Tizen.NUI.Components/res/Theme/Tizen.NUI.Components_Tizen.NUI.Theme.Common.xaml [new file with mode: 0644]
src/Tizen.NUI.Components/res/Theme/Tizen.NUI.Components_Tizen.NUI.Theme.Wearable.xaml [new file with mode: 0644]
src/Tizen.NUI.Wearable/Tizen.NUI.Wearable.csproj
src/Tizen.NUI.Wearable/res/Theme/Tizen.NUI.Wearable_Tizen.NUI.Theme.Common.xaml [new file with mode: 0644]
src/Tizen.NUI.Wearable/src/public/CircularProgress.cs
src/Tizen.NUI.Wearable/src/public/CircularScrollbar.cs
src/Tizen.NUI.Wearable/src/public/CircularSlider.cs
src/Tizen.NUI.Wearable/src/public/Popup.cs
src/Tizen.NUI.Wearable/src/public/WearableStyle/CircularPaginationStyle.cs
src/Tizen.NUI.Wearable/src/public/WearableStyle/CircularProgressStyle.cs
src/Tizen.NUI.Wearable/src/public/WearableStyle/CircularScrollbarStyle.cs
src/Tizen.NUI.Wearable/src/public/WearableStyle/CircularSliderStyle.cs
src/Tizen.NUI.Wearable/src/public/WearableStyle/PopupStyle.cs
src/Tizen.NUI/Tizen.NUI.csproj
src/Tizen.NUI/res/Theme/Tizen.NUI_Tizen.NUI.Theme.Common.xaml [new file with mode: 0644]
src/Tizen.NUI/res/Theme/Tizen.NUI_Tizen.NUI.Theme.Wearable.xaml [new file with mode: 0644]
src/Tizen.NUI/src/internal/Xaml/ApplyPropertiesVisitor.cs
src/Tizen.NUI/src/internal/Xaml/XamlLoader.cs
src/Tizen.NUI/src/internal/Xaml/XamlParser.cs
src/Tizen.NUI/src/internal/XamlBinding/ExtentsTypeConverter.cs
src/Tizen.NUI/src/public/BaseComponents/ImageView.cs
src/Tizen.NUI/src/public/BaseComponents/LottieAnimationView.cs
src/Tizen.NUI/src/public/BaseComponents/Style/ImageViewStyle.cs
src/Tizen.NUI/src/public/BaseComponents/Style/Selector.cs
src/Tizen.NUI/src/public/BaseComponents/Style/TextFieldStyle.cs
src/Tizen.NUI/src/public/BaseComponents/Style/TextLabelStyle.cs
src/Tizen.NUI/src/public/BaseComponents/Style/ViewStyle.cs
src/Tizen.NUI/src/public/BaseComponents/Style/ViewStyleBindableProperty.cs
src/Tizen.NUI/src/public/BaseComponents/TextField.cs
src/Tizen.NUI/src/public/BaseComponents/TextLabel.cs
src/Tizen.NUI/src/public/BaseComponents/View.cs
src/Tizen.NUI/src/public/BaseComponents/ViewBindableProperty.cs
src/Tizen.NUI/src/public/BaseComponents/ViewInternal.cs
src/Tizen.NUI/src/public/Color.cs
src/Tizen.NUI/src/public/Extents.cs
src/Tizen.NUI/src/public/Position.cs
src/Tizen.NUI/src/public/Position2D.cs
src/Tizen.NUI/src/public/Rectangle.cs
src/Tizen.NUI/src/public/Size.cs
src/Tizen.NUI/src/public/Size2D.cs
src/Tizen.NUI/src/public/StyleManager.cs
src/Tizen.NUI/src/public/Theme/Theme.cs [new file with mode: 0644]
src/Tizen.NUI/src/public/Theme/ThemeChangedEventArgs.cs [new file with mode: 0644]
src/Tizen.NUI/src/public/Theme/ThemeManager.cs [new file with mode: 0644]
src/Tizen.NUI/src/public/Vector2.cs
src/Tizen.NUI/src/public/Vector3.cs
src/Tizen.NUI/src/public/Vector4.cs
src/Tizen.NUI/src/public/ViewProperty/ImageShadow.cs
src/Tizen.NUI/src/public/ViewProperty/Shadow.cs
src/Tizen.NUI/src/public/ViewProperty/ShadowBase.cs
src/Tizen.NUI/src/public/ViewProperty/TextShadow.cs
src/Tizen.NUI/src/public/ViewWrapper.cs
src/Tizen.NUI/src/public/Xaml/MarkupExtensions/ApplicationResourcePathExtension.cs [new file with mode: 0644]
src/Tizen.NUI/src/public/Xaml/MarkupExtensions/NUIResourcePathExtension.cs [new file with mode: 0644]
src/Tizen.NUI/src/public/XamlBinding/BindableObject.cs

index 9ab7334..2a03d3d 100755 (executable)
@@ -30,7 +30,16 @@ namespace Tizen.NUI.Components
         [EditorBrowsable(EditorBrowsableState.Never)]
         protected virtual TextLabel CreateText()
         {
-            return new TextLabel();
+            return new TextLabel
+            {
+                PositionUsesPivotPoint = true,
+                ParentOrigin = NUI.ParentOrigin.Center,
+                PivotPoint = NUI.PivotPoint.Center,
+                WidthResizePolicy = ResizePolicyType.FillToParent,
+                HeightResizePolicy = ResizePolicyType.FillToParent,
+                HorizontalAlignment = HorizontalAlignment.Center,
+                VerticalAlignment = VerticalAlignment.Center
+            };
         }
 
         /// <summary>
@@ -40,7 +49,12 @@ namespace Tizen.NUI.Components
         [EditorBrowsable(EditorBrowsableState.Never)]
         protected virtual ImageView CreateIcon()
         {
-            return new ImageView();
+            return new ImageView
+            {
+                PositionUsesPivotPoint = true,
+                ParentOrigin = NUI.ParentOrigin.Center,
+                PivotPoint = NUI.PivotPoint.Center
+            };
         }
 
         /// <summary>
@@ -50,7 +64,14 @@ namespace Tizen.NUI.Components
         [EditorBrowsable(EditorBrowsableState.Never)]
         protected virtual ImageView CreateOverlayImage()
         {
-            return new ImageView();
+            return new ImageView
+            {
+                PositionUsesPivotPoint = true,
+                ParentOrigin = NUI.ParentOrigin.Center,
+                PivotPoint = NUI.PivotPoint.Center,
+                WidthResizePolicy = ResizePolicyType.FillToParent,
+                HeightResizePolicy = ResizePolicyType.FillToParent
+            };
         }
 
         /// <summary>
@@ -185,31 +206,34 @@ namespace Tizen.NUI.Components
         [EditorBrowsable(EditorBrowsableState.Never)]
         protected virtual void MeasureText()
         {
-            if (Icon == null || TextLabel == null)
+            if (buttonIcon == null || buttonText == null)
             {
                 return;
             }
-            TextLabel.WidthResizePolicy = ResizePolicyType.Fixed;
-            TextLabel.HeightResizePolicy = ResizePolicyType.Fixed;
-            int textPaddingStart = buttonStyle.TextPadding.Start;
-            int textPaddingEnd = buttonStyle.TextPadding.End;
-            int textPaddingTop = buttonStyle.TextPadding.Top;
-            int textPaddingBottom = buttonStyle.TextPadding.Bottom;
-
-            int iconPaddingStart = buttonStyle.IconPadding.Start;
-            int iconPaddingEnd = buttonStyle.IconPadding.End;
-            int iconPaddingTop = buttonStyle.IconPadding.Top;
-            int iconPaddingBottom = buttonStyle.IconPadding.Bottom;
+            buttonText.WidthResizePolicy = ResizePolicyType.Fixed;
+            buttonText.HeightResizePolicy = ResizePolicyType.Fixed;
+
+            var textPadding = TextPadding;
+            int textPaddingStart = textPadding.Start;
+            int textPaddingEnd = textPadding.End;
+            int textPaddingTop = textPadding.Top;
+            int textPaddingBottom = textPadding.Bottom;
+
+            var iconPadding = IconPadding;
+            int iconPaddingStart = iconPadding.Start;
+            int iconPaddingEnd = iconPadding.End;
+            int iconPaddingTop = iconPadding.Top;
+            int iconPaddingBottom = iconPadding.Bottom;
 
             if (IconRelativeOrientation == IconOrientation.Top || IconRelativeOrientation == IconOrientation.Bottom)
             {
-                TextLabel.SizeWidth = SizeWidth - textPaddingStart - textPaddingEnd;
-                TextLabel.SizeHeight = SizeHeight - textPaddingTop - textPaddingBottom - iconPaddingTop - iconPaddingBottom - Icon.SizeHeight;
+                buttonText.SizeWidth = SizeWidth - textPaddingStart - textPaddingEnd;
+                buttonText.SizeHeight = SizeHeight - textPaddingTop - textPaddingBottom - iconPaddingTop - iconPaddingBottom - buttonIcon.SizeHeight;
             }
             else
             {
-                TextLabel.SizeWidth = SizeWidth - textPaddingStart - textPaddingEnd - iconPaddingStart - iconPaddingEnd - Icon.SizeWidth;
-                TextLabel.SizeHeight = SizeHeight - textPaddingTop - textPaddingBottom;
+                buttonText.SizeWidth = SizeWidth - textPaddingStart - textPaddingEnd - iconPaddingStart - iconPaddingEnd - buttonIcon.SizeWidth;
+                buttonText.SizeHeight = SizeHeight - textPaddingTop - textPaddingBottom;
             }
         }
 
@@ -221,23 +245,22 @@ namespace Tizen.NUI.Components
         [EditorBrowsable(EditorBrowsableState.Never)]
         protected virtual void LayoutChild()
         {
-            if (Icon == null || TextLabel == null)
+            if (buttonIcon == null || buttonText == null)
             {
                 return;
             }
 
-            var buttonIcon = Icon;
-            var buttonText = TextLabel;
-
-            int textPaddingStart = buttonStyle.TextPadding.Start;
-            int textPaddingEnd = buttonStyle.TextPadding.End;
-            int textPaddingTop = buttonStyle.TextPadding.Top;
-            int textPaddingBottom = buttonStyle.TextPadding.Bottom;
+            var textPadding = TextPadding;
+            int textPaddingStart = textPadding.Start;
+            int textPaddingEnd = textPadding.End;
+            int textPaddingTop = textPadding.Top;
+            int textPaddingBottom = textPadding.Bottom;
 
-            int iconPaddingStart = buttonStyle.IconPadding.Start;
-            int iconPaddingEnd = buttonStyle.IconPadding.End;
-            int iconPaddingTop = buttonStyle.IconPadding.Top;
-            int iconPaddingBottom = buttonStyle.IconPadding.Bottom;
+            var iconPadding = IconPadding;
+            int iconPaddingStart = iconPadding.Start;
+            int iconPaddingEnd = iconPadding.End;
+            int iconPaddingTop = iconPadding.Top;
+            int iconPaddingBottom = iconPadding.Bottom;
 
             switch (IconRelativeOrientation)
             {
@@ -327,22 +350,6 @@ namespace Tizen.NUI.Components
         }
 
         /// <summary>
-        /// Theme change callback when theme is changed, this callback will be trigger.
-        /// </summary>
-        /// <param name="sender">The sender</param>
-        /// <param name="e">The event data</param>
-        [EditorBrowsable(EditorBrowsableState.Never)]
-        protected override void OnThemeChangedEvent(object sender, StyleManager.ThemeChangeEventArgs e)
-        {
-            ButtonStyle buttonStyle = StyleManager.Instance.GetViewStyle(StyleName) as ButtonStyle;
-            if (buttonStyle != null)
-            {
-                ApplyStyle(buttonStyle);
-                UpdateUIContent();
-            }
-        }
-
-        /// <summary>
         /// Dispose Button and all children on it.
         /// </summary>
         /// <param name="type">Dispose type.</param>
@@ -358,17 +365,17 @@ namespace Tizen.NUI.Components
             {
                 Extension?.OnDispose(this);
 
-                if (Icon != null)
+                if (buttonIcon != null)
                 {
-                    Utility.Dispose(Icon);
+                    Utility.Dispose(buttonIcon);
                 }
-                if (TextLabel != null)
+                if (buttonText != null)
                 {
-                    Utility.Dispose(TextLabel);
+                    Utility.Dispose(buttonText);
                 }
-                if (OverlayImage != null)
+                if (overlayImage != null)
                 {
-                    Utility.Dispose(OverlayImage);
+                    Utility.Dispose(overlayImage);
                 }
             }
 
index 64b70cc..27e8f22 100755 (executable)
@@ -54,20 +54,16 @@ namespace Tizen.NUI.Components
         public static readonly BindableProperty IconRelativeOrientationProperty = BindableProperty.Create(nameof(IconRelativeOrientation), typeof(IconOrientation?), typeof(Button), null, propertyChanged: (bindable, oldValue, newValue) =>
         {
             var instance = (Button)bindable;
-            if (newValue != null)
+            var newIconOrientation = (IconOrientation?)newValue;
+            if (instance.iconRelativeOrientation != newIconOrientation)
             {
-                if (instance.buttonStyle != null && instance.buttonStyle.IconRelativeOrientation != (IconOrientation?)newValue)
-                {
-                    instance.buttonStyle.IconRelativeOrientation = (IconOrientation?)newValue;
-                    instance.UpdateUIContent();
-                }
+                instance.iconRelativeOrientation = newIconOrientation;
+                instance.UpdateUIContent();
             }
         },
-        defaultValueCreator: (bindable) =>
-        {
-            var instance = (Button)bindable;
-            return instance.buttonStyle?.IconRelativeOrientation;
-        });
+        defaultValueCreator: (bindable) => ((Button)bindable).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 IsEnabledProperty = BindableProperty.Create(nameof(IsEnabled), typeof(bool), typeof(Button), true, propertyChanged: (bindable, oldValue, newValue) =>
@@ -75,18 +71,21 @@ namespace Tizen.NUI.Components
             var instance = (Button)bindable;
             if (newValue != null)
             {
-                if (instance.buttonStyle != null && (!instance.styleApplied || instance.buttonStyle.IsEnabled != (bool)newValue))
+                bool newEnabled = (bool)newValue;
+                if (instance.isEnabled != newEnabled)
                 {
-                    instance.buttonStyle.IsEnabled = (bool)newValue;
+                    instance.isEnabled = newEnabled;
+
+                    if (instance.buttonStyle != null)
+                    {
+                        instance.buttonStyle.IsEnabled = newEnabled;
+                    }
+
                     instance.UpdateState();
                 }
             }
         },
-        defaultValueCreator: (bindable) =>
-        {
-            var instance = (Button)bindable;
-            return instance.buttonStyle?.IsEnabled ?? true;
-        });
+        defaultValueCreator: (bindable) => ((Button)bindable).isEnabled);
         /// 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 = BindableProperty.Create(nameof(IsSelected), typeof(bool), typeof(Button), true, propertyChanged: (bindable, oldValue, newValue) =>
@@ -94,17 +93,27 @@ namespace Tizen.NUI.Components
             var instance = (Button)bindable;
             if (newValue != null)
             {
-                if (instance.buttonStyle != null && instance.IsSelectable && (!instance.styleApplied || instance.buttonStyle.IsSelected != (bool)newValue))
+                bool newSelected = (bool)newValue;
+                if (instance.isSelected != newSelected)
                 {
-                    instance.buttonStyle.IsSelected = (bool)newValue;
-                    instance.UpdateState();
+                    instance.isSelected = newSelected;
+
+                    if (instance.buttonStyle != null)
+                    {
+                        instance.buttonStyle.IsSelected = newSelected;
+                    }
+
+                    if (instance.isSelectable)
+                    {
+                        instance.UpdateState();
+                    }
                 }
             }
         },
         defaultValueCreator: (bindable) =>
         {
             var instance = (Button)bindable;
-            return instance.IsSelectable && (instance.buttonStyle.IsSelected ?? false);
+            return instance.isSelectable && instance.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)]
@@ -113,49 +122,48 @@ namespace Tizen.NUI.Components
             var instance = (Button)bindable;
             if (newValue != null)
             {
-                if (instance.buttonStyle != null && (!instance.styleApplied || instance.buttonStyle.IsSelectable != (bool)newValue))
+                bool newSelectable = (bool)newValue;
+                if (instance.isSelectable != newSelectable)
                 {
-                    instance.buttonStyle.IsSelectable = (bool)newValue;
+                    instance.isSelectable = newSelectable;
+
+                    if (instance.buttonStyle != null)
+                    {
+                        instance.buttonStyle.IsSelectable = newSelectable;
+                    }
+
+                    instance.UpdateState();
                 }
             }
         },
-        defaultValueCreator: (bindable) =>
-        {
-            var instance = (Button)bindable;
-            return instance.buttonStyle?.IsSelectable ?? false;
-        });
+        defaultValueCreator: (bindable) => ((Button)bindable).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 IconPaddingProperty = BindableProperty.Create(nameof(IconPadding), typeof(Extents), typeof(Button), null, propertyChanged: (bindable, oldValue, newValue) =>
         {
             var instance = (Button)bindable;
-            if (null != newValue && null != instance.buttonStyle?.IconPadding)
-            {
-                instance.buttonStyle.IconPadding.CopyFrom((Extents)newValue);
-                instance.UpdateUIContent();
-            }
+            instance.iconPadding = (Extents)((Extents)newValue).Clone();
+            instance.UpdateUIContent();
         },
-        defaultValueCreator: (bindable) =>
-        {
-            var instance = (Button)bindable;
-            return instance.buttonStyle?.IconPadding;
-        });
+        defaultValueCreator: (bindable) => ((Button)bindable).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 = BindableProperty.Create(nameof(TextPadding), typeof(Extents), typeof(Button), null, propertyChanged: (bindable, oldValue, newValue) =>
         {
             var instance = (Button)bindable;
-            if (null != newValue && null != instance.buttonStyle?.TextPadding)
-            {
-                instance.buttonStyle.TextPadding.CopyFrom((Extents)newValue);
-                instance.UpdateUIContent();
-            }
+            instance.textPadding = (Extents)((Extents)newValue).Clone();
+            instance.UpdateUIContent();
         },
-        defaultValueCreator: (bindable) =>
-        {
-            var instance = (Button)bindable;
-            return instance.buttonStyle?.TextPadding;
-        });
+        defaultValueCreator: (bindable) => ((Button)bindable).textPadding);
+
+        private IconOrientation? iconRelativeOrientation;
+        private bool isSelected = false;
+        private bool isSelectable = false;
+        private bool isEnabled = true;
+        private Extents iconPadding;
+        private Extents textPadding;
 
         static Button() { }
 
@@ -261,8 +269,11 @@ namespace Tizen.NUI.Components
                     {
                         buttonIcon = Extension.OnCreateIcon(this, buttonIcon);
                     }
-                    Add(buttonIcon);
-                    buttonIcon.Relayout += OnIconRelayout;
+                    if (null != buttonIcon)
+                    {
+                        Add(buttonIcon);
+                        buttonIcon.Relayout += OnIconRelayout;
+                    }
                 }
                 return buttonIcon;
             }
@@ -287,9 +298,10 @@ namespace Tizen.NUI.Components
                     {
                         overlayImage = Extension.OnCreateOverlayImage(this, overlayImage);
                     }
-                    overlayImage.WidthResizePolicy = ResizePolicyType.FillToParent;
-                    overlayImage.HeightResizePolicy = ResizePolicyType.FillToParent;
-                    Add(overlayImage);
+                    if (null != overlayImage)
+                    {
+                        Add(overlayImage);
+                    }
                 }
                 return overlayImage;
             }
@@ -314,9 +326,10 @@ namespace Tizen.NUI.Components
                     {
                         buttonText = Extension.OnCreateText(this, buttonText);
                     }
-                    buttonText.HorizontalAlignment = HorizontalAlignment.Center;
-                    buttonText.VerticalAlignment = VerticalAlignment.Center;
-                    Add(buttonText);
+                    if (null != buttonText)
+                    {
+                        Add(buttonText);
+                    }
                 }
                 return buttonText;
             }
@@ -626,7 +639,7 @@ namespace Tizen.NUI.Components
         {
             get
             {
-                return (IconOrientation?)GetValue(IconRelativeOrientationProperty);
+                return (IconOrientation?)GetValue(IconRelativeOrientationProperty) ?? IconOrientation.Left;
             }
             set
             {
@@ -640,7 +653,7 @@ namespace Tizen.NUI.Components
         /// <since_tizen> 6 </since_tizen>
         public Extents IconPadding
         {
-            get => (Extents)GetValue(IconPaddingProperty);
+            get => (Extents)GetValue(IconPaddingProperty) ?? new Extents();
             set => SetValue(IconPaddingProperty, value);
         }
 
@@ -650,7 +663,7 @@ namespace Tizen.NUI.Components
         /// <since_tizen> 6 </since_tizen>
         public Extents TextPadding
         {
-            get => (Extents)GetValue(TextPaddingProperty);
+            get => (Extents)GetValue(TextPaddingProperty) ?? new Extents();
             set => SetValue(TextPaddingProperty, value);
         }
 
@@ -795,47 +808,5 @@ namespace Tizen.NUI.Components
             [Obsolete("Deprecated in API8; Will be removed in API10")]
             public ControlStates CurrentState;
         }
-
-        /// <summary>
-        /// Get current text part to the attached ButtonExtension.
-        /// </summary>
-        /// <remarks>
-        /// It returns null if the passed extension is invalid.
-        /// </remarks>
-        /// <param name="extension">The extension instance that is currently attached to this Button.</param>
-        /// <return>The button's text part.</return>
-        [EditorBrowsable(EditorBrowsableState.Never)]
-        public TextLabel GetCurrentText(ButtonExtension extension)
-        {
-            return (extension == Extension) ? TextLabel : null;
-        }
-
-        /// <summary>
-        /// Get current icon part to the attached ButtonExtension.
-        /// </summary>
-        /// <remarks>
-        /// It returns null if the passed extension is invalid.
-        /// </remarks>
-        /// <param name="extension">The extension instance that is currently attached to this Button.</param>
-        /// <return>The button's icon part.</return>
-        [EditorBrowsable(EditorBrowsableState.Never)]
-        public ImageView GetCurrentIcon(ButtonExtension extension)
-        {
-            return (extension == Extension) ? Icon : null;
-        }
-
-        /// <summary>
-        /// Get current overlay image part to the attached ButtonExtension.
-        /// </summary>
-        /// <remarks>
-        /// It returns null if the passed extension is invalid.
-        /// </remarks>
-        /// <param name="extension">The extension instance that is currently attached to this Button.</param>
-        /// <return>The button's overlay image part.</return>
-        [EditorBrowsable(EditorBrowsableState.Never)]
-        public ImageView GetCurrentOverlayImage(ButtonExtension extension)
-        {
-            return (extension == Extension) ? OverlayImage : null;
-        }
     }
 }
index a032508..639c7b9 100755 (executable)
@@ -75,5 +75,20 @@ namespace Tizen.NUI.Components
                 base.ApplyStyle(buttonStyle);
             }
         }
+
+        /// <inheritdoc/>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        protected override ImageView CreateIcon()
+        {
+            return new ImageView
+            {
+                PositionUsesPivotPoint = true,
+                ParentOrigin = NUI.ParentOrigin.Center,
+                PivotPoint = NUI.PivotPoint.Center,
+                WidthResizePolicy = ResizePolicyType.DimensionDependency,
+                HeightResizePolicy = ResizePolicyType.SizeRelativeToParent,
+                SizeModeFactor = new Vector3(1, 1, 1),
+            };
+        }
     }
 }
index 54e9c93..8daafcf 100755 (executable)
@@ -40,11 +40,7 @@ namespace Tizen.NUI.Components
         public static readonly BindableProperty CommandParameterProperty = BindableProperty.Create("CommandParameter", typeof(object), typeof(Button), null,
             propertyChanged: (bindable, oldvalue, newvalue) => ((Button)bindable).CommandCanExecuteChanged(bindable, EventArgs.Empty));
 
-        /// <summary> Control style. </summary>
-        /// <since_tizen> 6 </since_tizen>
-        /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
-        [EditorBrowsable(EditorBrowsableState.Never)]
-        protected string StyleName { get; set; }
+        private bool onThemeChangedEventOverrideChecker;
 
         private TapGestureDetector tapGestureDetector = new TapGestureDetector();
 
@@ -60,25 +56,8 @@ namespace Tizen.NUI.Components
         /// <since_tizen> 6 </since_tizen>
         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
         [EditorBrowsable(EditorBrowsableState.Never)]
-        public Control() : base()
+        public Control() : this((ControlStyle)null)
         {
-            var cur_type = this.GetType();
-            ViewStyle viewStyle = null;
-
-            do
-            {
-                if (cur_type.Equals(typeof(Tizen.NUI.Components.Control))) break;
-                viewStyle = StyleManager.Instance.GetComponentStyle(cur_type);
-                cur_type = cur_type.BaseType;
-            }
-            while (viewStyle == null);
-
-            if (viewStyle != null)
-            {
-                ApplyStyle(viewStyle);
-            }
-
-            Initialize();
         }
 
         /// <summary>
@@ -100,18 +79,15 @@ namespace Tizen.NUI.Components
         /// <since_tizen> 6 </since_tizen>
         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
         [EditorBrowsable(EditorBrowsableState.Never)]
-        public Control(string styleName) : base()
+        public Control(string styleName) : this(ThemeManager.GetStyle(styleName) as ControlStyle)
         {
-            ViewStyle viewStyle = StyleManager.Instance.GetViewStyle(styleName);
-            if (viewStyle == null)
+            if (ThemeManager.GetStyle(styleName) == null)
             {
                 throw new InvalidOperationException($"There is no style {styleName}");
             }
 
-            ApplyStyle(viewStyle);
-            this.StyleName = styleName;
-
-            Initialize();
+            this.styleName = styleName;
+            ThemeChangeSensitive = true;
         }
 
         /// Internal used.
@@ -170,7 +146,6 @@ namespace Tizen.NUI.Components
 
             if (type == DisposeTypes.Explicit)
             {
-                StyleManager.Instance.ThemeChangedEvent -= OnThemeChangedEvent;
                 tapGestureDetector.Detected -= OnTapGestureDetected;
                 tapGestureDetector.Detach(this);
             }
@@ -252,13 +227,17 @@ namespace Tizen.NUI.Components
 
         /// <summary>
         /// Theme change callback when theme is changed, this callback will be trigger.
+        /// Note that it is deprecated API.Please use OnThemeChanged instead.
         /// </summary>
         /// <param name="sender">The sender</param>
         /// <param name="e">The event data</param>
         /// <since_tizen> 6 </since_tizen>
         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
         [EditorBrowsable(EditorBrowsableState.Never)]
-        protected virtual void OnThemeChangedEvent(object sender, StyleManager.ThemeChangeEventArgs e) { }
+        protected virtual void OnThemeChangedEvent(object sender, StyleManager.ThemeChangeEventArgs e)
+        {
+            onThemeChangedEventOverrideChecker = false;
+        }
 
         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
         [EditorBrowsable(EditorBrowsableState.Never)]
@@ -267,6 +246,21 @@ namespace Tizen.NUI.Components
             return new ControlStyle();
         }
 
+        /// <inheritdoc/>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        protected override void OnThemeChanged(object sender, ThemeChangedEventArgs e)
+        {
+            // TODO Remove checker after update Tizen.FH.NUI.
+            onThemeChangedEventOverrideChecker = true;
+
+            OnThemeChangedEvent(sender, new StyleManager.ThemeChangeEventArgs { CurrentTheme = e.ThemeId });
+
+            if (onThemeChangedEventOverrideChecker) return;
+
+            // If the OnThemeChangedEvent is not implemented, ApplyStyle()
+            base.OnThemeChanged(sender, e);
+        }
+
         private void Initialize()
         {
             LeaveRequired = true;
@@ -277,8 +271,6 @@ namespace Tizen.NUI.Components
             tapGestureDetector.Detected += OnTapGestureDetected;
 
             EnableControlState = true;
-
-            StyleManager.Instance.ThemeChangedEvent += OnThemeChangedEvent;
         }
     }
 }
index 548a82f..0946e6d 100755 (executable)
@@ -24,7 +24,7 @@ namespace Tizen.NUI.Components
             [EditorBrowsable(EditorBrowsableState.Never)]
             public DropDownDataItem()
             {
-                itemDataStyle = (DropDownItemStyle)StyleManager.Instance.GetComponentStyle(this.GetType());
+                itemDataStyle = ThemeManager.GetStyle("Tizen.NUI.Components.DropDown.DropDownDataItem") as DropDownItemStyle;
                 Initialize();
             }
 
index 62268a9..cd49e4b 100755 (executable)
@@ -283,6 +283,7 @@ namespace Tizen.NUI.Components
                         HeightResizePolicy = ResizePolicyType.FillToParent,
                         VerticalAlignment = VerticalAlignment.Center,
                         HorizontalAlignment = HorizontalAlignment.Begin,
+                        Text = "List item",
                     };
                     Add(mText);
                 }
index 4b8d4bb..fbbadbb 100755 (executable)
@@ -245,8 +245,8 @@ namespace Tizen.NUI.Components
                 {
                     button = new Button()
                     {
-                        ParentOrigin = NUI.ParentOrigin.CenterLeft,
-                        PivotPoint = NUI.PivotPoint.CenterLeft,
+                        ParentOrigin = NUI.ParentOrigin.TopLeft,
+                        PivotPoint = NUI.PivotPoint.TopLeft,
                         PositionUsesPivotPoint = true,
                         HeightResizePolicy = ResizePolicyType.FitToChildren,
                         IconRelativeOrientation = Button.IconOrientation.Right,
index cdb194b..922e89a 100644 (file)
@@ -48,6 +48,10 @@ namespace Tizen.NUI.Components.Extension
         [EditorBrowsable(EditorBrowsableState.Never)]
         public override ImageView OnCreateIcon(Button button, ImageView icon)
         {
+            LottieView.PositionUsesPivotPoint = true;
+            LottieView.ParentOrigin = NUI.ParentOrigin.Center;
+            LottieView.PivotPoint = NUI.PivotPoint.Center;
+
             InitializeLottieView(button, LottieView);
 
             return LottieView;
index 246bde2..e623242 100644 (file)
@@ -47,6 +47,10 @@ namespace Tizen.NUI.Components.Extension
         [EditorBrowsable(EditorBrowsableState.Never)]
         public override ImageView OnCreateIcon(Button button, ImageView icon)
         {
+            LottieView.PositionUsesPivotPoint = true;
+            LottieView.ParentOrigin = NUI.ParentOrigin.Center;
+            LottieView.PivotPoint = NUI.PivotPoint.Center;
+
             LottieButtonExtension.InitializeLottieView(button, LottieView);
 
             return LottieView;
index 4cfe86f..8962036 100755 (executable)
@@ -497,22 +497,6 @@ namespace Tizen.NUI.Components
             return new ScrollBarStyle();
         }
 
-        /// <summary>
-        /// Theme change callback when theme is changed, this callback will be trigger.
-        /// </summary>
-        /// <param name="sender">The sender</param>
-        /// <param name="e">The event data</param>
-        [EditorBrowsable(EditorBrowsableState.Never)]
-        protected override void OnThemeChangedEvent(object sender, StyleManager.ThemeChangeEventArgs e)
-        {
-            ScrollBarStyle tempStyle = StyleManager.Instance.GetViewStyle(StyleName) as ScrollBarStyle;
-            if (tempStyle != null)
-            {
-                Style.CopyFrom(tempStyle);
-                UpdateValue();
-            }
-        }
-
         private void Initialize()
         {
             this.Focusable = false;
index d4761f2..1096517 100755 (executable)
@@ -72,7 +72,7 @@ namespace Tizen.NUI.Components
                 int frameRate = (int)newValue;
                 if (0 != frameRate) //It will crash if 0
                 {
-                    instance.loadingStyle.FrameRate.All = frameRate;
+                    instance.loadingStyle.FrameRate = frameRate;
                     instance.imageVisual.FrameDelay = 1000.0f / frameRate;
                 }
             }
index 9a44d4a..87103f7 100755 (executable)
@@ -357,7 +357,15 @@ namespace Tizen.NUI.Components
             {
                 if (null == titleText)
                 {
-                    titleText = new TextLabel();
+                    titleText = new TextLabel
+                    {
+                        PositionUsesPivotPoint = true,
+                        ParentOrigin = Tizen.NUI.ParentOrigin.TopLeft,
+                        PivotPoint = Tizen.NUI.PivotPoint.TopLeft,
+                        HorizontalAlignment = HorizontalAlignment.Begin,
+                        VerticalAlignment = VerticalAlignment.Bottom,
+                        Text = "Title"
+                    };
                     Add(titleText);
                 }
                 return titleText;
@@ -740,9 +748,26 @@ namespace Tizen.NUI.Components
         public override void ApplyStyle(ViewStyle viewStyle)
         {
             base.ApplyStyle(viewStyle);
-            PopupStyle ppStyle = viewStyle as PopupStyle;
-            if (null != ppStyle)
+
+            if (viewStyle is PopupStyle ppStyle)
             {
+                if (ppStyle.Buttons == null)
+                {
+                    ppStyle.Buttons = new ButtonStyle();
+                }
+
+                if (ppStyle.Buttons.PositionUsesPivotPoint == null) ppStyle.Buttons.PositionUsesPivotPoint = true;
+                if (ppStyle.Buttons.ParentOrigin == null) ppStyle.Buttons.ParentOrigin = Tizen.NUI.ParentOrigin.BottomLeft;
+                if (ppStyle.Buttons.PivotPoint == null) ppStyle.Buttons.PivotPoint = Tizen.NUI.PivotPoint.BottomLeft;
+
+                if (btGroup != null)
+                {
+                    for (int i = 0; i < btGroup.Count; i++)
+                    {
+                        GetButton(i)?.ApplyStyle(ppStyle.Buttons);
+                    }
+                }
+
                 Title.ApplyStyle(ppStyle.Title);
                 Title.RaiseToTop();
             }
@@ -758,20 +783,12 @@ namespace Tizen.NUI.Components
             return new PopupStyle();
         }
 
-        /// <summary>
-        /// Theme change callback when theme is changed, this callback will be trigger.
-        /// </summary>
-        /// <param name="sender">The sender</param>
-        /// <param name="e">The event data</param>
+        /// <inheritdoc/>
         [EditorBrowsable(EditorBrowsableState.Never)]
-        protected override void OnThemeChangedEvent(object sender, StyleManager.ThemeChangeEventArgs e)
+        protected override void OnUpdate()
         {
-            PopupStyle ppStyle = StyleManager.Instance.GetViewStyle(StyleName) as PopupStyle;
-            if (ppStyle != null)
-            {
-                ApplyStyle(ppStyle);
-                UpdateView();
-            }
+            base.OnUpdate();
+            UpdateView();
         }
 
         private void Initialize()
@@ -799,6 +816,7 @@ namespace Tizen.NUI.Components
 
         private void UpdateView()
         {
+            if (popupStyle == null) return;
             btGroup.UpdateButton(popupStyle.Buttons);
             UpdateContentView();
             UpdateTitle();
index 42f6ae0..5b18b4a 100755 (executable)
@@ -426,22 +426,6 @@ namespace Tizen.NUI.Components
         }
 
         /// <summary>
-        /// Theme change callback when theme is changed, this callback will be trigger.
-        /// </summary>
-        /// <param name="sender">The sender</param>
-        /// <param name="e">The event data</param>
-        [EditorBrowsable(EditorBrowsableState.Never)]
-        protected override void OnThemeChangedEvent(object sender, StyleManager.ThemeChangeEventArgs e)
-        {
-            ProgressStyle tempStyle = StyleManager.Instance.GetViewStyle(StyleName) as ProgressStyle;
-            if (null != tempStyle)
-            {
-                progressStyle.CopyFrom(tempStyle);
-                RelayoutRequest();
-            }
-        }
-
-        /// <summary>
         /// Change Image status. It can be override.
         /// </summary>
         /// <since_tizen> 6 </since_tizen>
index 4791cd8..dcbb75d 100755 (executable)
@@ -97,5 +97,20 @@ namespace Tizen.NUI.Components
                 IsSelected = true;
             }
         }
+
+        /// <inheritdoc/>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        protected override ImageView CreateIcon()
+        {
+            return new ImageView
+            {
+                PositionUsesPivotPoint = true,
+                ParentOrigin = NUI.ParentOrigin.Center,
+                PivotPoint = NUI.PivotPoint.Center,
+                WidthResizePolicy = ResizePolicyType.DimensionDependency,
+                HeightResizePolicy = ResizePolicyType.SizeRelativeToParent,
+                SizeModeFactor = new Vector3(1, 1, 1),
+            };
+        }
     }
 }
index 2b18223..46d836f 100755 (executable)
@@ -14,6 +14,7 @@
  *
  */
 using System;
+using Tizen.NUI;
 using Tizen.NUI.BaseComponents;
 using System.Collections.Generic;
 using System.ComponentModel;
@@ -576,7 +577,7 @@ namespace Tizen.NUI.Components
             //Show vertical shadow on the top (or bottom) of the scrollable when panning down (or up).
             verticalTopShadowView = new View
             {
-                BackgroundImage = StyleManager.GetFrameworkResourcePath("nui_component_default_scroll_over_shooting_top.png"),
+                BackgroundImage = Tizen.NUI.StyleManager.FrameworkResourcePath + "nui_component_default_scroll_over_shooting_top.png",
                 Opacity = 1.0f,
                 SizeHeight = 0.0f,
                 PositionUsesPivotPoint = true,
@@ -585,7 +586,7 @@ namespace Tizen.NUI.Components
             };
             verticalBottomShadowView = new View
             {
-                BackgroundImage = StyleManager.GetFrameworkResourcePath("nui_component_default_scroll_over_shooting_bottom.png"),
+                BackgroundImage = Tizen.NUI.StyleManager.FrameworkResourcePath + "nui_component_default_scroll_over_shooting_bottom.png",
                 Opacity = 1.0f,
                 SizeHeight = 0.0f,
                 PositionUsesPivotPoint = true,
index 6a01a63..1765fd9 100755 (executable)
@@ -122,7 +122,7 @@ namespace Tizen.NUI.Components
         /// <summary>
         /// Create an empty Scrollbar.
         /// </summary>
-        public Scrollbar() : base(new ScrollbarStyle())
+        public Scrollbar() : base()
         {
         }
 
@@ -134,7 +134,7 @@ namespace Tizen.NUI.Components
         /// <param name="currentPosition">The current position of the viewport in scrollable content area. This is the viewport's top position if the scroller is vertical, otherwise, left.</param>
         /// <param name="isHorizontal">Whether the direction of scrolling is horizontal or not. It is vertical by default.</param>
         [EditorBrowsable(EditorBrowsableState.Never)]
-        public Scrollbar(float contentLength, float viewportLength, float currentPosition, bool isHorizontal = false) : base(new ScrollbarStyle())
+        public Scrollbar(float contentLength, float viewportLength, float currentPosition, bool isHorizontal = false) : this()
         {
             Initialize(contentLength, viewportLength, currentPosition, isHorizontal);
         }
@@ -402,6 +402,25 @@ namespace Tizen.NUI.Components
 
         /// <inheritdoc/>
         [EditorBrowsable(EditorBrowsableState.Never)]
+        public override void ApplyStyle(ViewStyle viewStyle)
+        {
+            base.ApplyStyle(viewStyle);
+
+            if (viewStyle is ScrollbarStyle scrollbarStyle)
+            {
+                // Apply essential look.
+                if (scrollbarStyle.TrackThickness == null) scrollbarStyle.TrackThickness = 6.0f;
+                if (scrollbarStyle.ThumbThickness == null) scrollbarStyle.ThumbThickness = 6.0f;
+                if (scrollbarStyle.TrackColor == null) scrollbarStyle.TrackColor = new Color(1.0f, 1.0f, 1.0f, 0.15f);
+                if (scrollbarStyle.ThumbColor == null) scrollbarStyle.ThumbColor = new Color(0.6f, 0.6f, 0.6f, 1.0f);
+                if (scrollbarStyle.TrackPadding == null) scrollbarStyle.TrackPadding = 4;
+                if (scrollbarStyle.WidthResizePolicy == null) scrollbarStyle.WidthResizePolicy = ResizePolicyType.FillToParent;
+                if (scrollbarStyle.HeightResizePolicy == null) scrollbarStyle.HeightResizePolicy = ResizePolicyType.FillToParent;
+            }
+        }
+
+        /// <inheritdoc/>
+        [EditorBrowsable(EditorBrowsableState.Never)]
         protected override ViewStyle CreateViewStyle()
         {
             return new ScrollbarStyle();
@@ -615,12 +634,12 @@ namespace Tizen.NUI.Components
 
             public override Size CalculateTrackSize(float thickness, Size containerSize, Extents trackPadding)
             {
-                return new Size(containerSize.Width - trackPadding.Start - trackPadding.End, thickness);
+                return new Size(containerSize.Width - trackPadding?.Start??0 - trackPadding?.End??0, thickness);
             }
 
             public override Vector2 CalculateTrackPosition(Extents trackPadding)
             {
-                return new Vector2(0, -trackPadding.Bottom);
+                return new Vector2(0, -trackPadding?.Bottom??0);
             }
 
             public override Size CalculateThumbSize(float thickness, Size trackSize)
@@ -630,21 +649,21 @@ namespace Tizen.NUI.Components
 
             public override Vector2 CalculateThumbPosition(Size trackSize, Size thumbSize, Extents trackPadding)
             {
-                float padding = ((trackSize.Height - thumbSize.Height) / 2.0f) + trackPadding.Bottom;
+                float padding = ((trackSize.Height - thumbSize.Height) / 2.0f) + trackPadding?.Bottom??0;
                 float pos = Math.Min(Math.Max(currentPosition, 0.0f), contentLength - visibleLength);
-                return new Vector2(trackPadding.Start + trackSize.Width * pos / contentLength, -padding);
+                return new Vector2(trackPadding?.Start??0 + trackSize.Width * pos / contentLength, -padding);
             }
 
             public override Vector2 CalculateThumbPaddingPosition(Size trackSize, Size thumbSize, Vector2 thumbCurrentPosition, Extents trackPadding)
             {
-                float padding = ((trackSize.Height - thumbSize.Height) / 2.0f) + trackPadding.Bottom;
+                float padding = ((trackSize.Height - thumbSize.Height) / 2.0f) + trackPadding?.Bottom??0;
                 return new Vector2(thumbCurrentPosition.X, -padding);
             }
 
             public override Vector2 CalculateThumbScrollPosition(Size trackSize, Vector2 thumbCurrentPosition, Extents trackPadding)
             {
                 float pos = Math.Min(Math.Max(currentPosition, 0.0f), contentLength - visibleLength);
-                return new Vector2(trackPadding.Start + trackSize.Width * pos / contentLength, thumbCurrentPosition.Y);
+                return new Vector2(trackPadding?.Start??0 + trackSize.Width * pos / contentLength, thumbCurrentPosition.Y);
             }
         }
 
@@ -666,12 +685,12 @@ namespace Tizen.NUI.Components
 
             public override Size CalculateTrackSize(float thickness, Size containerSize, Extents trackPadding)
             {
-                return new Size(thickness, containerSize.Height - trackPadding.Top - trackPadding.Bottom);
+                return new Size(thickness, containerSize.Height - trackPadding?.Top??0 - trackPadding?.Bottom??0);
             }
 
             public override Vector2 CalculateTrackPosition(Extents trackPadding)
             {
-                return new Vector2(-trackPadding.End, 0);
+                return new Vector2(-trackPadding?.End??0, 0);
             }
 
             public override Size CalculateThumbSize(float thickness, Size trackSize)
@@ -681,21 +700,21 @@ namespace Tizen.NUI.Components
 
             public override Vector2 CalculateThumbPosition(Size trackSize, Size thumbSize, Extents trackPadding)
             {
-                float padding = ((trackSize.Width - thumbSize.Width) / 2.0f) + trackPadding.End;
+                float padding = ((trackSize.Width - thumbSize.Width) / 2.0f) + trackPadding?.End??0;
                 float pos = Math.Min(Math.Max(currentPosition, 0.0f), contentLength - visibleLength);
-                return new Vector2(-padding, trackPadding.Top + trackSize.Height * pos / contentLength);
+                return new Vector2(-padding, trackPadding?.Top??0 + trackSize.Height * pos / contentLength);
             }
 
             public override Vector2 CalculateThumbPaddingPosition(Size trackSize, Size thumbSize, Vector2 thumbCurrentPosition, Extents trackPadding)
             {
-                float padding = ((trackSize.Width - thumbSize.Width) / 2.0f) + trackPadding.End;
+                float padding = ((trackSize.Width - thumbSize.Width) / 2.0f) + trackPadding?.End??0;
                 return new Vector2(-padding, thumbCurrentPosition.Y);
             }
 
             public override Vector2 CalculateThumbScrollPosition(Size trackSize, Vector2 thumbPosition, Extents trackPadding)
             {
                 float pos = Math.Min(Math.Max(currentPosition, 0.0f), contentLength - visibleLength);
-                return new Vector2(thumbPosition.X, trackPadding.Top + trackSize.Height * pos / contentLength);
+                return new Vector2(thumbPosition.X, trackPadding?.Top??0 + trackSize.Height * pos / contentLength);
             }
         }
 
index cc5e3c3..a144d3d 100755 (executable)
@@ -904,22 +904,6 @@ namespace Tizen.NUI.Components
             UpdateValue();
         }
 
-        /// <summary>
-        /// Theme change callback when theme is changed, this callback will be trigger.
-        /// </summary>
-        /// <param name="sender">The sender</param>
-        /// <param name="e">The event data</param>
-        [EditorBrowsable(EditorBrowsableState.Never)]
-        protected override void OnThemeChangedEvent(object sender, StyleManager.ThemeChangeEventArgs e)
-        {
-            SliderStyle sliderStyle = StyleManager.Instance.GetViewStyle(StyleName) as SliderStyle;
-            if (sliderStyle != null)
-            {
-                ApplyStyle(sliderStyle);
-                RelayoutRequest();
-            }
-        }
-
         private void CalculateCurrentValueByGesture(float offset)
         {
             currentSlidedOffset += offset;
index ed88c4f..616617a 100755 (executable)
@@ -317,21 +317,6 @@ namespace Tizen.NUI.Components
             IsSelectable = true;
         }
 
-        /// <summary>
-        /// Theme change callback when theme is changed, this callback will be trigger.
-        /// </summary>
-        /// <param name="sender">The sender</param>
-        /// <param name="e">The event data</param>
-        [EditorBrowsable(EditorBrowsableState.Never)]
-        protected override void OnThemeChangedEvent(object sender, StyleManager.ThemeChangeEventArgs e)
-        {
-            SwitchStyle switchStyle = StyleManager.Instance.GetViewStyle(StyleName) as SwitchStyle;
-            if (null != switchStyle)
-            {
-                ApplyStyle(switchStyle);
-            }
-        }
-
         private void OnSelect()
         {
             ((SwitchExtension)Extension)?.OnSelectedChanged(this);
index b569788..df33271 100755 (executable)
@@ -498,21 +498,6 @@ namespace Tizen.NUI.Components
         }
 
         /// <summary>
-        /// Theme change callback when theme is changed, this callback will be trigger.
-        /// </summary>
-        /// <param name="sender">The sender</param>
-        /// <param name="e">The event data</param>
-        [EditorBrowsable(EditorBrowsableState.Never)]
-        protected override void OnThemeChangedEvent(object sender, StyleManager.ThemeChangeEventArgs e)
-        {
-            TabStyle tabStyle = StyleManager.Instance.GetViewStyle(StyleName) as TabStyle;
-            if (tabStyle != null)
-            {
-                ApplyStyle(tabStyle);
-            }
-        }
-
-        /// <summary>
         /// Layout child in Tab and it can be override by user.
         /// </summary>
         /// <since_tizen> 6 </since_tizen>
index c8cafad..e861c49 100755 (executable)
@@ -318,6 +318,9 @@ namespace Tizen.NUI.Components
         [EditorBrowsable(EditorBrowsableState.Never)]
         public override void ApplyStyle(ViewStyle viewStyle)
         {
+            WidthResizePolicy = ResizePolicyType.FitToChildren;
+            HeightResizePolicy = ResizePolicyType.FitToChildren;
+
             base.ApplyStyle(viewStyle);
 
             ToastStyle toastStyle = viewStyle as ToastStyle;
@@ -326,7 +329,17 @@ namespace Tizen.NUI.Components
             {
                 if (null == textLabel)
                 {
-                    textLabel = new TextLabel();
+                    textLabel = new TextLabel()
+                    {
+                        PositionUsesPivotPoint = true,
+                        ParentOrigin = Tizen.NUI.ParentOrigin.Center,
+                        PivotPoint = Tizen.NUI.PivotPoint.Center,
+                        WidthResizePolicy = ResizePolicyType.UseNaturalSize,
+                        HeightResizePolicy = ResizePolicyType.UseNaturalSize,
+                        HorizontalAlignment = HorizontalAlignment.Center,
+                        VerticalAlignment = VerticalAlignment.Center,
+                        TextColor = Color.White,
+                    };
                     this.Add(textLabel);
                 }
                 textLabel.ApplyStyle(toastStyle.Text);
@@ -379,7 +392,17 @@ namespace Tizen.NUI.Components
         {
             if (null == textLabel)
             {
-                textLabel = new TextLabel();
+                textLabel = new TextLabel()
+                {
+                    PositionUsesPivotPoint = true,
+                    ParentOrigin = Tizen.NUI.ParentOrigin.Center,
+                    PivotPoint = Tizen.NUI.PivotPoint.Center,
+                    WidthResizePolicy = ResizePolicyType.UseNaturalSize,
+                    HeightResizePolicy = ResizePolicyType.UseNaturalSize,
+                    HorizontalAlignment = HorizontalAlignment.Center,
+                    VerticalAlignment = VerticalAlignment.Center,
+                    TextColor = Color.White,
+                };
                 this.Add(textLabel);
             }
 
diff --git a/src/Tizen.NUI.Components/PreloadStyle/DefaultTheme.cs b/src/Tizen.NUI.Components/PreloadStyle/DefaultTheme.cs
deleted file mode 100755 (executable)
index 8ebd6fb..0000000
+++ /dev/null
@@ -1,445 +0,0 @@
-/*
- * Copyright(c) 2020 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.BaseComponents;
-
-namespace Tizen.NUI.Components
-{
-    /// <summary>
-    /// Interface that includes styles for all components for a default theme
-    /// </summary>
-    [EditorBrowsable(EditorBrowsableState.Never)]
-    internal class DefaultTheme : Theme
-    {
-        internal static Theme Instance { get; } = new DefaultTheme();
-
-        protected DefaultTheme() : base()
-        {
-        }
-
-        protected override ButtonStyle GetButtonStyle()
-        {
-            return new ButtonStyle
-            {
-                Size = new Size(100, 45),
-                BackgroundColor = new Selector<Color>
-                {
-                    Normal = new Color(0.88f, 0.88f, 0.88f, 1),
-                    Pressed = new Color(0.77f, 0.77f, 0.77f, 1),
-                    Disabled = new Color(0.88f, 0.88f, 0.88f, 1)
-                },
-                Text = new TextLabelStyle
-                {
-                    PointSize = new Selector<float?> { All = StyleManager.PointSizeNormal },
-                    WidthResizePolicy = ResizePolicyType.FillToParent,
-                    HeightResizePolicy = ResizePolicyType.FillToParent,
-                    HorizontalAlignment = HorizontalAlignment.Center,
-                    VerticalAlignment = VerticalAlignment.Center,
-                    TextColor = new Selector<Color>
-                    {
-                        Normal = new Color(0.22f, 0.22f, 0.22f, 1),
-                        Pressed = new Color(0.11f, 0.11f, 0.11f, 1),
-                        Disabled = new Color(0.66f, 0.66f, 0.66f, 1)
-                    },
-                    Text = "Button",
-                }
-            };
-        }
-
-        protected override ButtonStyle GetCheckBoxStyle()
-        {
-            return new ButtonStyle
-            {
-                Size = new Size(30, 30),
-                Icon = new ImageViewStyle
-                {
-                    WidthResizePolicy = ResizePolicyType.DimensionDependency,
-                    HeightResizePolicy = ResizePolicyType.SizeRelativeToParent,
-                    SizeModeFactor = new Vector3(1, 1, 1),
-                    Opacity = new Selector<float?>
-                    {
-                        Normal = 1.0f,
-                        Selected = 1.0f,
-                        Disabled = 0.4f,
-                        DisabledSelected = 0.4f
-                    },
-                    BackgroundImage = new Selector<string>
-                    {
-                        Normal = StyleManager.GetFrameworkResourcePath("nui_component_default_checkbox_bg_n.png"),
-                        Pressed = StyleManager.GetFrameworkResourcePath("nui_component_default_checkbox_bg_p.png"),
-                        Selected = StyleManager.GetFrameworkResourcePath("nui_component_default_checkbox_bg_p.png"),
-                        Disabled = StyleManager.GetFrameworkResourcePath("nui_component_default_checkbox_bg_n.png"),
-                        DisabledSelected = StyleManager.GetFrameworkResourcePath("nui_component_default_checkbox_bg_p.png"),
-                    },
-                    ResourceUrl = new Selector<string>
-                    {
-                        Normal = "",
-                        Pressed = "",
-                        Selected = StyleManager.GetFrameworkResourcePath("nui_component_default_checkbox_s.png"),
-                        Disabled = "",
-                        DisabledSelected = StyleManager.GetFrameworkResourcePath("nui_component_default_checkbox_s.png"),
-                    }
-                },
-                Text = new TextLabelStyle
-                {
-                    PointSize = new Selector<float?> { All = StyleManager.PointSizeNormal },
-                    WidthResizePolicy = ResizePolicyType.FillToParent,
-                    HeightResizePolicy = ResizePolicyType.FillToParent,
-                    HorizontalAlignment = HorizontalAlignment.Center,
-                    VerticalAlignment = VerticalAlignment.Center,
-                    TextColor = new Selector<Color>
-                    {
-                        Normal = new Color(0.22f, 0.22f, 0.22f, 1),
-                        Pressed = new Color(0.11f, 0.11f, 0.11f, 1),
-                        Disabled = new Color(0.66f, 0.66f, 0.66f, 1)
-                    }
-                }
-            };
-        }
-
-        protected override DropDownStyle GetDropDownStyle()
-        {
-            return new DropDownStyle
-            {
-                Position = new Position(50, 50),
-                Button = new ButtonStyle
-                {
-                    ParentOrigin = ParentOrigin.TopLeft,
-                    PivotPoint = PivotPoint.TopLeft,
-                    BackgroundImage = new Selector<string>
-                    {
-                        Normal = StyleManager.GetFrameworkResourcePath("nui_component_default_checkbox_bg_n.png"),
-                        Pressed = StyleManager.GetFrameworkResourcePath("nui_component_default_checkbox_bg_p.png")
-                    },
-                    BackgroundImageBorder = (Rectangle)6,
-                    Text = new TextLabelStyle
-                    {
-                        Text = "Select an item",
-                        PointSize = StyleManager.PointSizeNormal,
-                        TextColor = Color.Black,
-                    },
-                    Icon = new ImageViewStyle
-                    {
-                        Size = new Size(28, 28),
-                        ResourceUrl = StyleManager.GetFrameworkResourcePath("nui_component_default_dropdown_button_icon.png"),
-                    },
-                    IconRelativeOrientation = Button.IconOrientation.Right,
-                    IconPadding = 6,
-                },
-                ListBackgroundImage = new ImageViewStyle
-                {
-                    ResourceUrl = StyleManager.GetFrameworkResourcePath("nui_component_default_dropdown_list_bg.png"),
-                    Border = (Rectangle)6,
-                    Size = new Size(280, 360),
-                },
-                SpaceBetweenButtonTextAndIcon = 10,
-                ListPadding = 5,
-            };
-        }
-
-        protected override DropDownItemStyle GetDropDownItemStyle()
-        {
-            return new DropDownItemStyle
-            {
-                Size = new Size(360, 50),
-                BackgroundColor = new Selector<Color>
-                {
-                    Pressed = new Color(0.05f, 0.63f, 0.9f, 1),
-                    Selected = new Color(0.8f, 0.8f, 0.8f, 1),
-                    Normal = new Color(1, 1, 1, 1),
-                },
-                Text = new TextLabelStyle
-                {
-                    PointSize = StyleManager.PointSizeNormal,
-                    Position = new Position(28, 0),
-                    Text = "List item",
-                },
-            };
-        }
-
-        protected override PopupStyle GetPopupStyle()
-        {
-            return new PopupStyle
-            {
-                Size = new Size(500, 280),
-                BackgroundColor = new Color(0.9f, 0.9f, 0.9f, 1),
-                ImageShadow = new ImageShadow
-                {
-                    Url = StyleManager.GetFrameworkResourcePath("nui_component_default_popup_shadow.png"),
-                    Border = new Rectangle(24, 24, 24, 24),
-                    Extents = new Vector2(48, 48),
-                },
-                Title = new TextLabelStyle
-                {
-                    PointSize = 16,
-                    TextColor = Color.Black,
-                    PositionUsesPivotPoint = true,
-                    ParentOrigin = Tizen.NUI.ParentOrigin.TopLeft,
-                    PivotPoint = Tizen.NUI.PivotPoint.TopLeft,
-                    HorizontalAlignment = HorizontalAlignment.Begin,
-                    VerticalAlignment = VerticalAlignment.Bottom,
-                    Padding = 20,
-                    Text = "Title",
-                },
-                Buttons = new ButtonStyle
-                {
-                    Size = new Size(0, 80),
-                    PositionUsesPivotPoint = true,
-                    ParentOrigin = Tizen.NUI.ParentOrigin.BottomLeft,
-                    PivotPoint = Tizen.NUI.PivotPoint.BottomLeft,
-                    BackgroundColor = new Selector<Color>
-                    {
-                        Normal = new Color(1, 1, 1, 1),
-                        Pressed = new Color(1, 1, 1, 0.5f),
-                    },
-                    Overlay = new ImageViewStyle
-                    {
-                        PositionUsesPivotPoint = true,
-                        ParentOrigin = Tizen.NUI.ParentOrigin.Center,
-                        PivotPoint = Tizen.NUI.PivotPoint.Center,
-                        WidthResizePolicy = ResizePolicyType.FillToParent,
-                        HeightResizePolicy = ResizePolicyType.FillToParent,
-                        BackgroundColor = new Selector<Color>
-                        {
-                            Normal = new Color(1.0f, 1.0f, 1.0f, 1.0f),
-                            Pressed = new Color(0.0f, 0.0f, 0.0f, 0.1f),
-                            Selected = new Color(1.0f, 1.0f, 1.0f, 1.0f),
-                        }
-                    },
-                    Text = new TextLabelStyle
-                    {
-                        PositionUsesPivotPoint = true,
-                        ParentOrigin = Tizen.NUI.ParentOrigin.Center,
-                        PivotPoint = Tizen.NUI.PivotPoint.Center,
-                        HorizontalAlignment = HorizontalAlignment.Center,
-                        VerticalAlignment = VerticalAlignment.Center,
-                        TextColor = new Color(0.05f, 0.63f, 0.9f, 1)
-                    },
-                },
-            };
-        }
-
-        protected override ProgressStyle GetProgressStyle()
-        {
-            return new ProgressStyle
-            {
-                Size = new Size(200, 5),
-                Track = new ImageViewStyle
-                {
-                    BackgroundColor = new Color(0, 0, 0, 0.1f),
-                },
-                Buffer = new ImageViewStyle
-                {
-                    BackgroundColor = new Color(0.05f, 0.63f, 0.9f, 0.3f)
-                },
-                Progress = new ImageViewStyle
-                {
-                    BackgroundColor = new Color(0.05f, 0.63f, 0.9f, 1)
-                },
-            };
-        }
-
-        protected override ButtonStyle GetRadioButtonStyle()
-        {
-            return new ButtonStyle
-            {
-                Size = new Size(30, 30),
-                Icon = new ImageViewStyle
-                {
-                    WidthResizePolicy = ResizePolicyType.DimensionDependency,
-                    HeightResizePolicy = ResizePolicyType.SizeRelativeToParent,
-                    SizeModeFactor = new Vector3(1, 1, 1),
-                    Opacity = new Selector<float?>
-                    {
-                        Normal = 1.0f,
-                        Selected = 1.0f,
-                        Disabled = 0.4f,
-                        DisabledSelected = 0.4f
-                    },
-                    BackgroundImage = new Selector<string>
-                    {
-                        Normal = StyleManager.GetFrameworkResourcePath("nui_component_default_radiobutton_n.png"),
-                        Pressed = StyleManager.GetFrameworkResourcePath("nui_component_default_radiobutton_p.png"),
-                        Selected = StyleManager.GetFrameworkResourcePath("nui_component_default_radiobutton_s.png"),
-                        Disabled = StyleManager.GetFrameworkResourcePath("nui_component_default_radiobutton_n.png"),
-                        DisabledSelected = StyleManager.GetFrameworkResourcePath("nui_component_default_radiobutton_s.png"),
-                    }
-                },
-                Text = new TextLabelStyle
-                {
-                    PointSize = new Selector<float?> { All = StyleManager.PointSizeNormal },
-                    WidthResizePolicy = ResizePolicyType.FillToParent,
-                    HeightResizePolicy = ResizePolicyType.FillToParent,
-                    HorizontalAlignment = HorizontalAlignment.Center,
-                    VerticalAlignment = VerticalAlignment.Center,
-                    TextColor = new Selector<Color>
-                    {
-                        Normal = new Color(0.22f, 0.22f, 0.22f, 1),
-                        Pressed = new Color(0.11f, 0.11f, 0.11f, 1),
-                        Disabled = new Color(0.66f, 0.66f, 0.66f, 1)
-                    }
-                }
-            };
-        }
-
-        protected override SliderStyle GetSliderStyle()
-        {
-            return new SliderStyle
-            {
-                Size = new Size(200, 50),
-                TrackThickness = 5,
-                Track = new ImageViewStyle
-                {
-                    BackgroundColor = new Color(0, 0, 0, 0.1f),
-                },
-
-                Progress = new ImageViewStyle
-                {
-                    BackgroundColor = new Color(0.05f, 0.63f, 0.9f, 1),
-                },
-
-                Thumb = new ImageViewStyle
-                {
-                    Size = new Size(50, 50),
-                    Color = new Color("0ea1e6"),
-                    ResourceUrl = StyleManager.GetFrameworkResourcePath("nui_component_default_slider_thumb_n.png"),
-                    BackgroundImage = new Selector<string>
-                    {
-                        Normal = "",
-                        Pressed = StyleManager.GetFrameworkResourcePath("nui_component_default_slider_thumb_bg_p.png"),
-                    }
-                },
-
-            };
-        }
-
-        protected override SwitchStyle GetSwitchStyle()
-        {
-            return new SwitchStyle
-            {
-                Size = new Size(96, 60),
-                Track = new ImageViewStyle
-                {
-                    Size = new Size(96, 60),
-                    WidthResizePolicy = ResizePolicyType.Fixed,
-                    HeightResizePolicy = ResizePolicyType.Fixed,
-                    ResourceUrl = new Selector<string>
-                    {
-                        Normal = StyleManager.GetFrameworkResourcePath("nui_component_default_switch_track_n.png"),
-                        Selected = StyleManager.GetFrameworkResourcePath("nui_component_default_switch_track_s.png"),
-                        Disabled = StyleManager.GetFrameworkResourcePath("nui_component_default_switch_track_d.png"),
-                        DisabledSelected = StyleManager.GetFrameworkResourcePath("nui_component_default_switch_track_ds.png"),
-                    },
-                    Border = new Rectangle(30, 30, 30, 30),
-                },
-                Thumb = new ImageViewStyle
-                {
-                    Size = new Size(60, 60),
-                    ResourceUrl = new Selector<string>
-                    {
-                        Normal = StyleManager.GetFrameworkResourcePath("nui_component_default_switch_thumb_n.png"),
-                        Selected = StyleManager.GetFrameworkResourcePath("nui_component_default_switch_thumb_n.png"),
-                        Disabled = StyleManager.GetFrameworkResourcePath("nui_component_default_switch_thumb_d.png"),
-                        DisabledSelected = StyleManager.GetFrameworkResourcePath("nui_component_default_switch_thumb_d.png"),
-                    },
-                },
-                Text = new TextLabelStyle
-                {
-                    PointSize = new Selector<float?> { All = StyleManager.PointSizeNormal },
-                    WidthResizePolicy = ResizePolicyType.FillToParent,
-                    HeightResizePolicy = ResizePolicyType.FillToParent,
-                    HorizontalAlignment = HorizontalAlignment.Center,
-                    VerticalAlignment = VerticalAlignment.Center,
-                    TextColor = new Selector<Color>
-                    {
-                        Normal = new Color(0.22f, 0.22f, 0.22f, 1),
-                        Pressed = new Color(0.11f, 0.11f, 0.11f, 1),
-                        Disabled = new Color(0.66f, 0.66f, 0.66f, 1)
-                    }
-                },
-            };
-        }
-
-        protected override TabStyle GetTabStyle()
-        {
-            return new TabStyle
-            {
-                BackgroundColor = Color.Yellow,
-                Size = new Size(480, 80),
-                UnderLine = new ViewStyle
-                {
-                    Size = new Size(0, 6),
-                    PositionUsesPivotPoint = true,
-                    ParentOrigin = Tizen.NUI.ParentOrigin.BottomLeft,
-                    PivotPoint = Tizen.NUI.PivotPoint.BottomLeft,
-                    BackgroundColor = new Color(0.05f, 0.63f, 0.9f, 1),
-                },
-                Text = new TextLabelStyle
-                {
-                    PointSize = StyleManager.PointSizeTitle,
-                    TextColor = new Selector<Color>
-                    {
-                        Normal = Color.Black,
-                        Selected = new Color(0.05f, 0.63f, 0.9f, 1),
-                    },
-                },
-            };
-        }
-
-        protected override ToastStyle GetToastStyle()
-        {
-            return new ToastStyle
-            {
-                WidthResizePolicy = ResizePolicyType.FitToChildren,
-                HeightResizePolicy = ResizePolicyType.FitToChildren,
-                BackgroundColor = new Color(0, 0, 0, 0.8f),
-                Text = new TextLabelStyle()
-                {
-                    PositionUsesPivotPoint = true,
-                    ParentOrigin = Tizen.NUI.ParentOrigin.Center,
-                    PivotPoint = Tizen.NUI.PivotPoint.Center,
-                    WidthResizePolicy = ResizePolicyType.UseNaturalSize,
-                    HeightResizePolicy = ResizePolicyType.UseNaturalSize,
-                    HorizontalAlignment = HorizontalAlignment.Center,
-                    VerticalAlignment = VerticalAlignment.Center,
-                    TextColor = Color.White,
-                    Padding = new Extents(12, 12, 8, 8),
-                }
-            };
-        }
-
-        protected override LoadingStyle GetLoadingStyle()
-        {
-            return new LoadingStyle
-            {
-                LoadingSize = new Size(100, 100)
-            };
-        }
-
-        protected override PaginationStyle GetPaginationStyle()
-        {
-            return new PaginationStyle
-            {
-                IndicatorImageUrl = new Selector<string>()
-                {
-                    Normal = StyleManager.GetFrameworkResourcePath("nui_component_default_pagination_normal_dot.png"),
-                    Selected = StyleManager.GetFrameworkResourcePath("nui_component_default_pagination_focus_dot.png"),
-                },
-            };
-        }
-    }
-}
index 9961a77..eb634dc 100644 (file)
@@ -109,7 +109,7 @@ namespace Tizen.NUI.Components
                 return;
             }
 
-            var overlayImage = button.GetCurrentOverlayImage(this);
+            var overlayImage = button.OverlayImage;
 
             if (overlayImage == null)
             {
diff --git a/src/Tizen.NUI.Components/PreloadStyle/WearableTheme.cs b/src/Tizen.NUI.Components/PreloadStyle/WearableTheme.cs
deleted file mode 100644 (file)
index 35ffe80..0000000
+++ /dev/null
@@ -1,146 +0,0 @@
-/*
- * Copyright(c) 2020 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.BaseComponents;
-using Tizen.NUI.Components.Extension;
-
-namespace Tizen.NUI.Components
-{
-    /// <summary>
-    /// Interface that includes styles for all components for a wearable theme
-    /// </summary>
-    [EditorBrowsable(EditorBrowsableState.Never)]
-    internal class WearableTheme : DefaultTheme
-    {
-        internal static new Theme Instance { get; } = new WearableTheme();
-
-        private WearableTheme() : base()
-        {
-        }
-
-        protected override ButtonStyle GetButtonStyle()
-        {
-            return new ButtonStyle
-            {
-                Size = new Size(210, 72),
-                CornerRadius = 36,
-                BackgroundColor = new Selector<Color>
-                {
-                    Normal = new Color(0, 42f/255f, 77f/255f, 0.85f),
-                    Pressed = new Color(0, 70f/255f, 128f/255f, 0.85f),
-                    Disabled = new Color(61f/255f, 61f/255f, 61f/255f, 0.85f),
-                },
-                Text = new TextLabelStyle
-                {
-                    FontFamily = "SamsungOne 700",
-                    PixelSize = 28,
-                    TextColor = new Selector<Color>
-                    {
-                        Normal = new Color(56f/255f, 164f/255f, 252f/255f, 1),
-                        Pressed = new Color(56f/255f, 164f/255f, 252f/255f, 1),
-                        Disabled = new Color(1, 1, 1, 0.35f),
-                    },
-                    Padding = new Extents(20, 20, 0, 0),
-                    VerticalAlignment = VerticalAlignment.Center,
-                    HorizontalAlignment = HorizontalAlignment.Center,
-                },
-                Opacity = new Selector<float?>
-                {
-                    Other = 1.0f,
-                    Disabled = 0.3f,
-                }
-            };
-        }
-
-        protected override ButtonStyle GetCheckBoxStyle()
-        {
-            return new LottieButtonStyle
-            {
-                LottieUrl = StyleManager.GetFrameworkResourcePath("nui_wearable_checkbox_icon.json"),
-                PlayRange = new Selector<LottieFrameInfo>
-                {
-                    Selected = (0, 18),
-                    Normal = (19, 36)
-                },
-                Opacity = new Selector<float?>
-                {
-                    Other = 1.0f,
-                    Pressed = 0.6f,
-                    Disabled = 0.3f,
-                },
-            };
-        }
-
-        protected override ButtonStyle GetRadioButtonStyle()
-        {
-            return new LottieButtonStyle
-            {
-                LottieUrl = StyleManager.GetFrameworkResourcePath("nui_wearable_radiobutton_icon.json"),
-                PlayRange = new Selector<LottieFrameInfo>
-                {
-                    Selected = (0, 12),
-                    Normal = (13, 25)
-                },
-                Opacity = new Selector<float?>
-                {
-                    Other = 1.0f,
-                    Pressed = 0.6f,
-                    Disabled = 0.3f,
-                },
-            };
-        }
-
-        protected override SwitchStyle GetSwitchStyle()
-        {
-            return new LottieSwitchStyle
-            {
-                LottieUrl = StyleManager.GetFrameworkResourcePath("nui_wearable_switch_icon.json"),
-                PlayRange = new Selector<LottieFrameInfo>
-                {
-                    Selected = (0, 18),
-                    Normal = (19, 36)
-                },
-                Opacity = new Selector<float?>
-                {
-                    Other = 1.0f,
-                    Pressed = 0.6f,
-                    Disabled = 0.3f,
-                },
-            };
-        }
-
-        protected override LoadingStyle GetLoadingStyle()
-        {
-            return new LoadingStyle
-            {
-                LoadingSize = new Size(360, 360)
-            };
-        }
-
-        protected override PaginationStyle GetPaginationStyle()
-        {
-            return new PaginationStyle
-            {
-                IndicatorImageUrl = new Selector<string>()
-                {
-                    Normal = StyleManager.GetFrameworkResourcePath("nui_component_default_pagination_normal_dot.png"),
-                    Selected = StyleManager.GetFrameworkResourcePath("nui_component_default_pagination_focus_dot.png"),
-                },
-            };
-        }
-    }
-}
index 21fb114..eb9c444 100755 (executable)
@@ -79,9 +79,7 @@ namespace Tizen.NUI.Components
         [EditorBrowsable(EditorBrowsableState.Never)]
         public static readonly BindableProperty IconPaddingProperty = BindableProperty.Create(nameof(IconPadding), typeof(Extents), typeof(ButtonStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
         {
-            var buttonStyle = (ButtonStyle)bindable;
-            if (null == buttonStyle.iconPadding) buttonStyle.iconPadding = new Extents(buttonStyle.OnIconPaddingChanged, 0, 0, 0, 0);
-            buttonStyle.iconPadding.CopyFrom(null == newValue ? new Extents() : (Extents)newValue);
+            ((ButtonStyle)bindable).iconPadding = null == newValue ? null : new Extents((Extents)newValue);
         },
         defaultValueCreator: (bindable) =>
         {
@@ -92,9 +90,7 @@ namespace Tizen.NUI.Components
         [EditorBrowsable(EditorBrowsableState.Never)]
         public static readonly BindableProperty TextPaddingProperty = BindableProperty.Create(nameof(TextPadding), typeof(Extents), typeof(ButtonStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
         {
-            var buttonStyle = (ButtonStyle)bindable;
-            if (null == buttonStyle.textPadding) buttonStyle.textPadding = new Extents(buttonStyle.OnTextPaddingChanged, 0, 0, 0, 0);
-            buttonStyle.textPadding.CopyFrom(null == newValue ? new Extents() : (Extents)newValue);
+            ((ButtonStyle)bindable).textPadding = null == newValue ? null : new Extents((Extents)newValue);
         },
         defaultValueCreator: (bindable) =>
         {
@@ -117,7 +113,6 @@ namespace Tizen.NUI.Components
         /// <since_tizen> 8 </since_tizen>
         public ButtonStyle() : base()
         {
-            InitSubStyle();
         }
 
         /// <summary>
@@ -127,32 +122,25 @@ namespace Tizen.NUI.Components
         /// <since_tizen> 8 </since_tizen>
         public ButtonStyle(ButtonStyle style) : base(style)
         {
-            if(style == null)
-            {
-                return;
-            }
-
-            InitSubStyle();
-
-            this.CopyFrom(style);
         }
+
         /// <summary>
         /// Overlay image's Style.
         /// </summary>
         /// <since_tizen> 8 </since_tizen>
-        public ImageViewStyle Overlay { get; set; }
+        public ImageViewStyle Overlay { get; set; } = new ImageViewStyle();
 
         /// <summary>
         /// Text's Style.
         /// </summary>
         /// <since_tizen> 8 </since_tizen>
-        public TextLabelStyle Text { get; set; }
+        public TextLabelStyle Text { get; set; } = new TextLabelStyle();
 
         /// <summary>
         /// Icon's Style.
         /// </summary>
         /// <since_tizen> 8 </since_tizen>
-        public ImageViewStyle Icon { get; set; }
+        public ImageViewStyle Icon { get; set; } = new ImageViewStyle();
 
         /// <summary>
         /// Flag to decide Button can be selected or not.
@@ -200,11 +188,7 @@ namespace Tizen.NUI.Components
         /// <since_tizen> 8 </since_tizen>
         public Extents IconPadding
         {
-            get
-            {
-                Extents padding = (Extents)GetValue(IconPaddingProperty);
-                return (null != padding) ? padding : iconPadding = new Extents(OnIconPaddingChanged, 0, 0, 0, 0);
-            }
+            get => ((Extents)GetValue(IconPaddingProperty)) ?? (iconPadding = new Extents());
             set => SetValue(IconPaddingProperty, value);
         }
 
@@ -214,11 +198,7 @@ namespace Tizen.NUI.Components
         /// <since_tizen> 8 </since_tizen>
         public Extents TextPadding
         {
-            get
-            {
-                Extents padding = (Extents)GetValue(TextPaddingProperty);
-                return (null != padding) ? padding : textPadding = new Extents(OnTextPaddingChanged, 0, 0, 0, 0);
-            }
+            get  => ((Extents)GetValue(TextPaddingProperty)) ?? (textPadding = new Extents());
             set => SetValue(TextPaddingProperty, value);
         }
 
@@ -231,24 +211,11 @@ namespace Tizen.NUI.Components
         {
             base.CopyFrom(bindableObject);
 
-            ButtonStyle buttonStyle = bindableObject as ButtonStyle;
-
-            if (null != buttonStyle)
+            if (bindableObject is ButtonStyle buttonStyle)
             {
-                if (null != buttonStyle.Overlay)
-                {
-                    Overlay?.CopyFrom(buttonStyle.Overlay);
-                }
-
-                if (null != buttonStyle.Text)
-                {
-                    Text?.CopyFrom(buttonStyle.Text);
-                }
-
-                if (null != buttonStyle.Icon)
-                {
-                    Icon?.CopyFrom(buttonStyle.Icon);
-                }
+                Overlay.CopyFrom(buttonStyle.Overlay);
+                Text.CopyFrom(buttonStyle.Text);
+                Icon.CopyFrom(buttonStyle.Icon);
             }
         }
 
@@ -284,47 +251,5 @@ namespace Tizen.NUI.Components
 
             base.Dispose(type);
         }
-
-        private void InitSubStyle()
-        {
-            Overlay = new ImageViewStyle()
-            {
-                PositionUsesPivotPoint = true,
-                ParentOrigin = Tizen.NUI.ParentOrigin.Center,
-                PivotPoint = Tizen.NUI.PivotPoint.Center,
-                WidthResizePolicy = ResizePolicyType.FillToParent,
-                HeightResizePolicy = ResizePolicyType.FillToParent
-            };
-
-            Text = new TextLabelStyle()
-            {
-                PositionUsesPivotPoint = true,
-                ParentOrigin = Tizen.NUI.ParentOrigin.Center,
-                PivotPoint = Tizen.NUI.PivotPoint.Center,
-                WidthResizePolicy = ResizePolicyType.FillToParent,
-                HeightResizePolicy = ResizePolicyType.FillToParent,
-                HorizontalAlignment = HorizontalAlignment.Center,
-                VerticalAlignment = VerticalAlignment.Center
-            };
-
-            Icon = new ImageViewStyle()
-            {
-                PositionUsesPivotPoint = true,
-                ParentOrigin = Tizen.NUI.ParentOrigin.Center,
-                PivotPoint = Tizen.NUI.PivotPoint.Center,
-            };
-
-            IconRelativeOrientation = Button.IconOrientation.Left;
-        }
-
-        private void OnIconPaddingChanged(ushort start, ushort end, ushort top, ushort bottom)
-        {
-            IconPadding = new Extents(start, end, top, bottom);
-        }
-
-        private void OnTextPaddingChanged(ushort start, ushort end, ushort top, ushort bottom)
-        {
-            TextPadding = new Extents(start, end, top, bottom);
-        }
     }
 }
index 7674a4a..44cc34e 100755 (executable)
@@ -47,7 +47,6 @@ namespace Tizen.NUI.Components
         [EditorBrowsable(EditorBrowsableState.Never)]
         public ControlStyle() : base()
         {
-            InitSubstyle();
         }
 
 
@@ -60,9 +59,6 @@ namespace Tizen.NUI.Components
         [EditorBrowsable(EditorBrowsableState.Never)]
         public ControlStyle(ControlStyle style) : base(style)
         {
-            if(null == style) return;
-
-            this.CopyFrom(style);
         }
 
         /// <summary>
@@ -122,10 +118,6 @@ namespace Tizen.NUI.Components
             disposed = true;
         }
 
-        private void InitSubstyle()
-        {
-        }
-
         private void SubStyleCalledEvent(object sender, global::System.EventArgs e)
         {
             OnPropertyChanged();
index 19ac02b..92ffdff 100755 (executable)
@@ -57,9 +57,7 @@ namespace Tizen.NUI.Components
         [EditorBrowsable(EditorBrowsableState.Never)]
         public static readonly BindableProperty ListMarginProperty = BindableProperty.Create(nameof(ListMargin), typeof(Extents), typeof(DropDownStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
         {
-            var dropDownStyle = (DropDownStyle)bindable;
-            if (null == dropDownStyle.listMargin) dropDownStyle.listMargin = new Extents(dropDownStyle.OnListMarginChanged, 0, 0, 0, 0);
-            dropDownStyle.listMargin.CopyFrom(null == newValue ? new Extents() : (Extents)newValue);
+            ((DropDownStyle)bindable).listMargin = newValue == null ? null : new Extents((Extents)newValue);
         },
         defaultValueCreator: (bindable) =>
         {
@@ -82,12 +80,7 @@ namespace Tizen.NUI.Components
         [EditorBrowsable(EditorBrowsableState.Never)]
         public static readonly BindableProperty ListPaddingProperty = BindableProperty.Create(nameof(ListPadding), typeof(Extents), typeof(DropDownStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
         {
-            var dropDownStyle = (DropDownStyle)bindable;
-            if (null != newValue)
-            {
-                if (null == dropDownStyle.listPadding) dropDownStyle.listPadding = new Extents(dropDownStyle.OnListPaddingChanged, 0, 0, 0, 0);
-                dropDownStyle.listPadding.CopyFrom(null == newValue ? new Extents() : (Extents)newValue);
-            }
+            ((DropDownStyle)bindable).listPadding = newValue == null ? null : new Extents((Extents)newValue);
         },
         defaultValueCreator: (bindable) =>
         {
@@ -120,9 +113,6 @@ namespace Tizen.NUI.Components
         [EditorBrowsable(EditorBrowsableState.Never)]
         public DropDownStyle(DropDownStyle style) : base(style)
         {
-            if(null == style) return;
-
-            this.CopyFrom(style);
         }
 
         /// <summary>
@@ -181,11 +171,7 @@ namespace Tizen.NUI.Components
         [EditorBrowsable(EditorBrowsableState.Never)]
         public Extents ListMargin
         {
-            get
-            {
-                Extents tmp = (Extents)GetValue(ListMarginProperty);
-                return (null != tmp) ? tmp : listMargin = new Extents(OnListMarginChanged, 0, 0, 0, 0);
-            }
+            get => ((Extents)GetValue(ListMarginProperty)) ?? (listMargin = new Extents(0, 0, 0, 0));
             set => SetValue(ListMarginProperty, value);
         }
 
@@ -205,44 +191,23 @@ namespace Tizen.NUI.Components
         [EditorBrowsable(EditorBrowsableState.Never)]
         public Extents ListPadding
         {
-            get
-            {
-                Extents tmp = (Extents)GetValue(ListPaddingProperty);
-                return (null != tmp) ? tmp : listPadding = new Extents(OnListPaddingChanged, 0, 0, 0, 0);
-            }
+            get => ((Extents)GetValue(ListPaddingProperty)) ?? (listPadding = new Extents(0, 0, 0, 0));
             set => SetValue(ListPaddingProperty, value);
         }
 
-        /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+        /// <inheritdoc/>
         [EditorBrowsable(EditorBrowsableState.Never)]
         public override void CopyFrom(BindableObject bindableObject)
         {
             base.CopyFrom(bindableObject);
 
-            DropDownStyle dropDownStyle = bindableObject as DropDownStyle;
-
-            if (null != dropDownStyle)
+            if (bindableObject is DropDownStyle dropDownStyle)
             {
-                Button?.CopyFrom(dropDownStyle.Button);
-                HeaderText?.CopyFrom(dropDownStyle.HeaderText);
-                ListBackgroundImage?.CopyFrom(dropDownStyle.ListBackgroundImage);
-                SpaceBetweenButtonTextAndIcon = dropDownStyle.SpaceBetweenButtonTextAndIcon;
-                ListRelativeOrientation = dropDownStyle.ListRelativeOrientation;
-                ListMargin?.CopyFrom(dropDownStyle.ListMargin);
-                SelectedItemIndex = dropDownStyle.SelectedItemIndex;
-                ListPadding?.CopyFrom(dropDownStyle.ListPadding);
+                Button.CopyFrom(dropDownStyle.Button);
+                HeaderText.CopyFrom(dropDownStyle.HeaderText);
+                ListBackgroundImage.CopyFrom(dropDownStyle.ListBackgroundImage);
             }
         }
-
-        private void OnListMarginChanged(ushort start, ushort end, ushort top, ushort bottom)
-        {
-            ListMargin = new Extents(start, end, top, bottom);
-        }
-
-        private void OnListPaddingChanged(ushort start, ushort end, ushort top, ushort bottom)
-        {
-            ListPadding = new Extents(start, end, top, bottom);
-        }
     }
 
     /// <summary>
@@ -270,9 +235,6 @@ namespace Tizen.NUI.Components
         [EditorBrowsable(EditorBrowsableState.Never)]
         public DropDownItemStyle(DropDownItemStyle style) : base(style)
         {
-            if(null == style) return;
-
-            this.CopyFrom(style);
         }
 
         /// <summary>
@@ -315,19 +277,17 @@ namespace Tizen.NUI.Components
         [EditorBrowsable(EditorBrowsableState.Never)]
         public bool IsSelected { get; set; }
 
-        /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+        /// <inheritdoc/>
         [EditorBrowsable(EditorBrowsableState.Never)]
         public override void CopyFrom(BindableObject bindableObject)
         {
             base.CopyFrom(bindableObject);
 
-            DropDownItemStyle dropDownItemStyle = bindableObject as DropDownItemStyle;
-
-            if (null != dropDownItemStyle)
+            if (bindableObject is DropDownItemStyle dropDownItemStyle)
             {
-                Text?.CopyFrom(dropDownItemStyle.Text);
-                Icon?.CopyFrom(dropDownItemStyle.Icon);
-                CheckImage?.CopyFrom(dropDownItemStyle.CheckImage);
+                Text.CopyFrom(dropDownItemStyle.Text);
+                Icon.CopyFrom(dropDownItemStyle.Icon);
+                CheckImage.CopyFrom(dropDownItemStyle.CheckImage);
                 CheckImageGapToBoundary = dropDownItemStyle.CheckImageGapToBoundary;
                 IsSelected = dropDownItemStyle.IsSelected;
             }
index 9b08f1f..9fd3e97 100755 (executable)
@@ -26,6 +26,42 @@ namespace Tizen.NUI.Components
     /// <since_tizen> 8 </since_tizen>
     public class LoadingStyle : ControlStyle
     {
+        /// <summary>The FrameRateSelector bindable property.</summary>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public static readonly BindableProperty FrameRateSelectorProperty = BindableProperty.Create("FrameRateSelector", typeof(Selector<int?>), typeof(LoadingStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
+        {
+            ((LoadingStyle)bindable).frameRate = ((Selector<int?>)newValue)?.Clone();
+        },
+        defaultValueCreator: (bindable) =>
+        {
+            return ((LoadingStyle)bindable).frameRate;
+        });
+
+        /// <summary>The LoadingSize bindable property.</summary>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public static readonly BindableProperty LoadingSizeProperty = BindableProperty.Create(nameof(LoadingSize), typeof(Size), typeof(LoadingStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
+        {
+            ((LoadingStyle)bindable).Size = (Size)newValue;
+        },
+        defaultValueCreator: (bindable) =>
+        {
+            return ((LoadingStyle)bindable).Size;
+        });
+
+        /// <summary>The Images bindable property.</summary>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public static readonly BindableProperty ImagesProperty = BindableProperty.Create(nameof(Images), typeof(string[]), typeof(LoadingStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
+        {
+            ((LoadingStyle)bindable).images = (string[])((string[])newValue)?.Clone();
+        },
+        defaultValueCreator: (bindable) =>
+        {
+            return ((LoadingStyle)bindable).images;
+        });
+
+        private Selector<int?> frameRate;
+        private string[] images;
+
         static LoadingStyle() { }
 
         /// <summary>
@@ -41,18 +77,17 @@ namespace Tizen.NUI.Components
         /// <since_tizen> 8 </since_tizen>
         public LoadingStyle(LoadingStyle style) : base(style)
         {
-            if(null == style)
-            {
-                return;
-            }
-            this.CopyFrom(style);
         }
 
         /// <summary>
         /// Gets or sets loading image resources.
         /// </summary>
         /// <since_tizen> 8 </since_tizen>
-        public string[] Images { get; set; }
+        public string[] Images
+        {
+            get => (string[])GetValue(ImagesProperty);
+            set => SetValue(ImagesProperty, value);
+        }
 
         /// <summary>
         /// Gets or sets loading image size.
@@ -60,21 +95,19 @@ namespace Tizen.NUI.Components
         /// <since_tizen> 8 </since_tizen>
         public Size LoadingSize
         {
-            get
-            {
-                return this.Size;
-            }
-            set
-            {
-                this.Size = value;
-            }
+            get => (Size)GetValue(LoadingSizeProperty);
+            set => SetValue(LoadingSizeProperty, value);
         }
 
         /// <summary>
         /// Gets or sets loading frame per second.
         /// </summary>
         /// <since_tizen> 8 </since_tizen>
-        public Selector<int?> FrameRate { get; set; } = new Selector<int?>();
+        public Selector<int?> FrameRate
+        {
+            get => (Selector<int?>)GetValue(FrameRateSelectorProperty);
+            set => SetValue(FrameRateSelectorProperty, value);
+        }
 
         /// <summary>
         /// Style's clone function.
@@ -84,24 +117,6 @@ namespace Tizen.NUI.Components
         public override void CopyFrom(BindableObject bindableObject)
         {
             base.CopyFrom(bindableObject);
-
-            LoadingStyle loadingStyle = bindableObject as LoadingStyle;
-
-            if (null != loadingStyle)
-            {
-                if (null != loadingStyle.FrameRate)
-                {
-                    FrameRate?.Clone(loadingStyle.FrameRate);
-                }
-                if (null != loadingStyle.LoadingSize)
-                {
-                    LoadingSize = loadingStyle.LoadingSize;
-                }
-                if (null != loadingStyle.Images)
-                {
-                    Images = loadingStyle.Images;
-                }
-            }
         }
     }
 }
index e081291..403daab 100755 (executable)
@@ -26,6 +26,43 @@ namespace Tizen.NUI.Components
     /// <since_tizen> 8 </since_tizen>
     public class PaginationStyle : ControlStyle
     {
+        /// <summary>The IndicatorSize bindable property.</summary>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public static readonly BindableProperty IndicatorSizeProperty = BindableProperty.Create(nameof(IndicatorSize), typeof(Size), typeof(PaginationStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
+        {
+            ((PaginationStyle)bindable).indicatorSize = newValue == null ? null : new Size((Size)newValue);
+        },
+        defaultValueCreator: (bindable) =>
+        {
+            return ((PaginationStyle)bindable).indicatorSize;
+        });
+
+        /// <summary>The IndicatorImageUrlSelector bindable property.</summary>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public static readonly BindableProperty IndicatorImageUrlSelectorProperty = BindableProperty.Create("IndicatorImageUrlSelector", typeof(Selector<string>), typeof(PaginationStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
+        {
+            ((PaginationStyle)bindable).indicatorImageUrl = ((Selector<string>)newValue)?.Clone();
+        },
+        defaultValueCreator: (bindable) =>
+        {
+            return ((PaginationStyle)bindable).indicatorImageUrl;
+        });
+
+        /// <summary>The IndicatorSpacing bindable property.</summary>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public static readonly BindableProperty IndicatorSpacingProperty = BindableProperty.Create(nameof(IndicatorSpacing), typeof(int?), typeof(PaginationStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
+        {
+            ((PaginationStyle)bindable).indicatorSpacing = (int?)newValue;
+        },
+        defaultValueCreator: (bindable) =>
+        {
+            return ((PaginationStyle)bindable).indicatorSpacing;
+        });
+
+        private Size indicatorSize;
+        private Selector<string> indicatorImageUrl;
+        private int? indicatorSpacing;
+
         static PaginationStyle() { }
 
         /// <summary>
@@ -41,28 +78,37 @@ namespace Tizen.NUI.Components
         /// <since_tizen> 8 </since_tizen>
         public PaginationStyle(PaginationStyle style) : base(style)
         {
-            if (null == style) return;            
-
-            this.CopyFrom(style);
         }
 
         /// <summary>
         /// Gets or sets the size of the indicator.
         /// </summary>
         /// <since_tizen> 8 </since_tizen>
-        public Size IndicatorSize { get; set; }
+        public Size IndicatorSize
+        {
+            get => (Size)GetValue(IndicatorSizeProperty);
+            set => SetValue(IndicatorSizeProperty, value);
+        }
 
         /// <summary>
         /// Gets or sets the resource of indicator.
         /// </summary>
         /// <since_tizen> 8 </since_tizen>
-        public Selector<string> IndicatorImageUrl { get; set; } = new Selector<string>();
+        public Selector<string> IndicatorImageUrl
+        {
+            get => (Selector<string>)GetValue(IndicatorImageUrlSelectorProperty);
+            set => SetValue(IndicatorImageUrlSelectorProperty, value);
+        }
 
         /// <summary>
         /// Gets or sets the space of the indicator.
         /// </summary>
         /// <since_tizen> 8 </since_tizen>
-        public int IndicatorSpacing { get; set; }
+        public int IndicatorSpacing
+        {
+            get => ((int?)GetValue(IndicatorSpacingProperty)) ?? 0;
+            set => SetValue(IndicatorSpacingProperty, value);
+        }
 
         /// <summary>
         /// Retrieves a copy of PaginationStyle.
@@ -72,20 +118,6 @@ namespace Tizen.NUI.Components
         public override void CopyFrom(BindableObject bindableObject)
         {
             base.CopyFrom(bindableObject);
-
-            PaginationStyle paginationStyle = bindableObject as PaginationStyle;
-            if (null != paginationStyle)
-            {
-                if (null != paginationStyle.IndicatorSize)
-                {
-                    IndicatorSize = new Size(paginationStyle.IndicatorSize.Width, paginationStyle.IndicatorSize.Height);
-                }
-                if (null != paginationStyle.IndicatorImageUrl)
-                {
-                    IndicatorImageUrl?.Clone(paginationStyle.IndicatorImageUrl);
-                }
-                IndicatorSpacing = paginationStyle.IndicatorSpacing;
-            }
         }
     }
 }
index fe4f36a..acf3a0e 100755 (executable)
@@ -34,7 +34,6 @@ namespace Tizen.NUI.Components
         [EditorBrowsable(EditorBrowsableState.Never)]
         public PopupStyle() : base()
         {
-            InitSubStyle();
         }
 
         /// <summary>
@@ -44,91 +43,31 @@ namespace Tizen.NUI.Components
         [EditorBrowsable(EditorBrowsableState.Never)]
         public PopupStyle(PopupStyle style) : base(style)
         {
-            Title = new TextLabelStyle();
-            Buttons = new ButtonStyle();
-            this.CopyFrom(style);
         }
 
         /// <summary>
         /// Title Text's style.
         /// </summary>
         [EditorBrowsable(EditorBrowsableState.Never)]
-        public TextLabelStyle Title { get; set; }
+        public TextLabelStyle Title { get; set; } = new TextLabelStyle();
 
         /// <summary>
         /// Popup button's style.
         /// </summary>
         [EditorBrowsable(EditorBrowsableState.Never)]
-        public ButtonStyle Buttons { get; set; }
+        public ButtonStyle Buttons { get; set; } = new ButtonStyle();
 
-        /// <summary>
-        /// Style's clone function.
-        /// </summary>
-        /// <param name="bindableObject">The style that need to copy.</param>
+        /// <inheritdoc/>
         [EditorBrowsable(EditorBrowsableState.Never)]
         public override void CopyFrom(BindableObject bindableObject)
         {
             base.CopyFrom(bindableObject);
 
-            PopupStyle popupStyle = bindableObject as PopupStyle;
-            if (popupStyle != null)
+            if (bindableObject is PopupStyle popupStyle)
             {
-                if (popupStyle.Title != null)
-                {
-                    Title?.CopyFrom(popupStyle.Title);
-                }
-
-                if (popupStyle.Buttons != null)
-                {
-                    Buttons?.CopyFrom(popupStyle.Buttons);
-                }
+                Title.CopyFrom(popupStyle.Title);
+                Buttons.CopyFrom(popupStyle.Buttons);
             }
         }
-
-        private void InitSubStyle()
-        {
-            // TODO Apply proper shadow as a default for a Popup
-            BoxShadow = new Shadow()
-            {
-                BlurRadius = 5,
-                Offset = new Vector2(5, 5),
-            };
-
-            Title = new TextLabelStyle()
-            {
-                PositionUsesPivotPoint = true,
-                ParentOrigin = Tizen.NUI.ParentOrigin.TopLeft,
-                PivotPoint = Tizen.NUI.PivotPoint.TopLeft,
-                HorizontalAlignment = HorizontalAlignment.Begin,
-                VerticalAlignment = VerticalAlignment.Bottom
-            };
-
-            Buttons = new ButtonStyle()
-            {
-                Size = new Size(0, 0),
-                PositionUsesPivotPoint = true,
-                ParentOrigin = Tizen.NUI.ParentOrigin.BottomLeft,
-                PivotPoint = Tizen.NUI.PivotPoint.BottomLeft,
-                Overlay = new ImageViewStyle()
-                {
-                    PositionUsesPivotPoint = true,
-                    ParentOrigin = Tizen.NUI.ParentOrigin.Center,
-                    PivotPoint = Tizen.NUI.PivotPoint.Center,
-                    WidthResizePolicy = ResizePolicyType.FillToParent,
-                    HeightResizePolicy = ResizePolicyType.FillToParent
-                },
-
-                Text = new TextLabelStyle()
-                {
-                    PositionUsesPivotPoint = true,
-                    ParentOrigin = Tizen.NUI.ParentOrigin.Center,
-                    PivotPoint = Tizen.NUI.PivotPoint.Center,
-                    WidthResizePolicy = ResizePolicyType.FillToParent,
-                    HeightResizePolicy = ResizePolicyType.FillToParent,
-                    HorizontalAlignment = HorizontalAlignment.Center,
-                    VerticalAlignment = VerticalAlignment.Center
-                }
-            };
-        }
     }
 }
index 0731b7e..f2d6b3f 100755 (executable)
@@ -34,7 +34,6 @@ namespace Tizen.NUI.Components
         /// <since_tizen> 8 </since_tizen>
         public ProgressStyle() : base()
         {
-            InitSubStyle();
         }
 
         /// <summary>
@@ -44,30 +43,25 @@ namespace Tizen.NUI.Components
         /// <since_tizen> 8 </since_tizen>
         public ProgressStyle(ProgressStyle style) : base(style)
         {
-            if (null == style) return;
-
-            InitSubStyle();
-
-            this.CopyFrom(style);
         }
 
         /// <summary>
         /// Get or set track image.
         /// </summary>
         /// <since_tizen> 8 </since_tizen>
-        public ImageViewStyle Track { get; set; }
+        public ImageViewStyle Track { get; set; } = new ImageViewStyle();
 
         /// <summary>
         /// Get or set progress image.
         /// </summary>
         /// <since_tizen> 8 </since_tizen>
-        public ImageViewStyle Progress { get; set; }
+        public ImageViewStyle Progress { get; set; } = new ImageViewStyle();
 
         /// <summary>
         /// Get or set buffer image.
         /// </summary>
         /// <since_tizen> 8 </since_tizen>
-        public ImageViewStyle Buffer { get; set; }
+        public ImageViewStyle Buffer { get; set; } = new ImageViewStyle();
 
         /// <summary>
         /// Style's clone function.
@@ -78,55 +72,12 @@ namespace Tizen.NUI.Components
         {
             base.CopyFrom(bindableObject);
 
-            ProgressStyle progressStyle = bindableObject as ProgressStyle;
-
-            if (null != progressStyle)
+            if (bindableObject is ProgressStyle progressStyle)
             {
-                if (null != progressStyle.Track)
-                {
-                    Track?.CopyFrom(progressStyle.Track);
-                }
-
-                if (null != progressStyle.Progress)
-                {
-                    Progress?.CopyFrom(progressStyle.Progress);
-                }
-
-                if (null != progressStyle.Buffer)
-                {
-                    Buffer?.CopyFrom(progressStyle.Buffer);
-                }
+                Track.CopyFrom(progressStyle.Track);
+                Progress.CopyFrom(progressStyle.Progress);
+                Buffer.CopyFrom(progressStyle.Buffer);
             }
         }
-
-        private void InitSubStyle()
-        {
-            Track = new ImageViewStyle()
-            {
-                WidthResizePolicy = ResizePolicyType.FillToParent,
-                HeightResizePolicy = ResizePolicyType.FillToParent,
-                PositionUsesPivotPoint = true,
-                ParentOrigin = NUI.ParentOrigin.TopLeft,
-                PivotPoint = NUI.PivotPoint.TopLeft
-            };
-
-            Progress = new ImageViewStyle()
-            {
-                WidthResizePolicy = ResizePolicyType.FillToParent,
-                HeightResizePolicy = ResizePolicyType.FillToParent,
-                PositionUsesPivotPoint = true,
-                ParentOrigin = Tizen.NUI.ParentOrigin.TopLeft,
-                PivotPoint = Tizen.NUI.PivotPoint.TopLeft
-            };
-
-            Buffer = new ImageViewStyle()
-            {
-                WidthResizePolicy = ResizePolicyType.FillToParent,
-                HeightResizePolicy = ResizePolicyType.FillToParent,
-                PositionUsesPivotPoint = true,
-                ParentOrigin = Tizen.NUI.ParentOrigin.TopLeft,
-                PivotPoint = Tizen.NUI.PivotPoint.TopLeft
-            };
-        }
     }
 }
index 1aea6d3..0e04010 100644 (file)
@@ -54,7 +54,7 @@ namespace Tizen.NUI.Components
         [EditorBrowsable(EditorBrowsableState.Never)]
         public static readonly BindableProperty TrackColorProperty = BindableProperty.Create(nameof(TrackColor), typeof(Color), typeof(ScrollbarStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
         {
-            ((ScrollbarStyle)bindable).trackColor = (Color)newValue;
+            ((ScrollbarStyle)bindable).trackColor = new Color((Color)newValue);
         },
         defaultValueCreator: (bindable) =>
         {
@@ -65,7 +65,7 @@ namespace Tizen.NUI.Components
         [EditorBrowsable(EditorBrowsableState.Never)]
         public static readonly BindableProperty ThumbColorProperty = BindableProperty.Create(nameof(ThumbColor), typeof(Color), typeof(ScrollbarStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
         {
-            ((ScrollbarStyle)bindable).thumbColor = (Color)newValue;
+            ((ScrollbarStyle)bindable).thumbColor = new Color((Color)newValue);
         },
         defaultValueCreator: (bindable) =>
         {
@@ -76,7 +76,7 @@ namespace Tizen.NUI.Components
         [EditorBrowsable(EditorBrowsableState.Never)]
         public static readonly BindableProperty TrackPaddingProperty = BindableProperty.Create(nameof(TrackPadding), typeof(Extents), typeof(ScrollbarStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
         {
-            ((ScrollbarStyle)bindable).trackPadding = (Extents)newValue;
+            ((ScrollbarStyle)bindable).trackPadding = new Extents((Extents)newValue);
         },
         defaultValueCreator: (bindable) =>
         {
@@ -100,7 +100,6 @@ namespace Tizen.NUI.Components
         [EditorBrowsable(EditorBrowsableState.Never)]
         public ScrollbarStyle() : base()
         {
-            Initialize();
         }
 
         /// <summary>
@@ -110,7 +109,6 @@ namespace Tizen.NUI.Components
         [EditorBrowsable(EditorBrowsableState.Never)]
         public ScrollbarStyle(ScrollbarStyle style) : base(style)
         {
-            this.CopyFrom(style);
         }
 
         /// <summary>
@@ -176,39 +174,5 @@ namespace Tizen.NUI.Components
         }
 
         #endregion Properties
-
-
-        #region Methods
-
-        /// <inheritdoc/>
-        [EditorBrowsable(EditorBrowsableState.Never)]
-        public override void CopyFrom(BindableObject bindableObject)
-        {
-            base.CopyFrom(bindableObject);
-
-            var style = bindableObject as ScrollbarStyle;
-
-            if (null != style)
-            {
-                TrackThickness = style.TrackThickness;
-                ThumbThickness = style.ThumbThickness;
-                TrackColor = style.TrackColor;
-                ThumbColor = style.ThumbColor;
-                TrackPadding = style.TrackPadding;
-            }
-        }
-
-        private void Initialize()
-        {
-            TrackThickness = 6.0f;
-            ThumbThickness = 6.0f;
-            TrackColor = new Color(1.0f, 1.0f, 1.0f, 0.15f);
-            ThumbColor = new Color(0.6f, 0.6f, 0.6f, 1.0f);
-            TrackPadding = 4;
-            WidthResizePolicy = ResizePolicyType.FillToParent;
-            HeightResizePolicy = ResizePolicyType.FillToParent;
-        }
-
-        #endregion Methods
     }
 }
index d7c578f..c97f84a 100755 (executable)
@@ -76,12 +76,7 @@ namespace Tizen.NUI.Components
         [EditorBrowsable(EditorBrowsableState.Never)]
         public static readonly BindableProperty TrackPaddingProperty = BindableProperty.Create(nameof(TrackPadding), typeof(Extents), typeof(SliderStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
         {
-            var instance = (SliderStyle)bindable;
-            if (newValue != null)
-            {
-                if (null == instance.trackPadding) instance.trackPadding = new Extents(instance.OnTrackPaddingChanged, 0, 0, 0, 0);
-                instance.trackPadding.CopyFrom(null == newValue ? new Extents() : (Extents)newValue);
-            }
+            ((SliderStyle)bindable).trackPadding = newValue == null ? null : new Extents((Extents)newValue);
         },
         defaultValueCreator: (bindable) =>
         {
@@ -89,7 +84,7 @@ namespace Tizen.NUI.Components
             return instance.trackPadding;
         });
 
-        private IndicatorType? privateIndicatorType;
+        private IndicatorType? privateIndicatorType = Slider.IndicatorType.None;
         private uint? privateTrackThickness;
         private uint? privateSpaceBetweenTrackAndIndicator;
         private Extents trackPadding;
@@ -102,8 +97,6 @@ namespace Tizen.NUI.Components
         /// <since_tizen> 8 </since_tizen>
         public SliderStyle() : base()
         {
-            IndicatorType = Slider.IndicatorType.None;
-            InitSubStyle();
         }
 
         /// <summary>
@@ -113,59 +106,49 @@ namespace Tizen.NUI.Components
         /// <since_tizen> 8 </since_tizen>
         public SliderStyle(SliderStyle style) : base(style)
         {
-            if(style == null)
-            {
-                return;
-            }
-
-            InitSubStyle();
-
-            this.CopyFrom(style);
-
-            IndicatorType = style.IndicatorType;
         }
 
         /// <summary>
         /// Get or set background track.
         /// </summary>
         /// <since_tizen> 8 </since_tizen>
-        public ImageViewStyle Track { get; set; }
+        public ImageViewStyle Track { get; set; } = new ImageViewStyle();
 
         /// <summary>
         /// Get or set slided track.
         /// </summary>
         /// <since_tizen> 8 </since_tizen>
-        public ImageViewStyle Progress { get; set; }
+        public ImageViewStyle Progress { get; set; } = new ImageViewStyle();
 
         /// <summary>
         /// Get or set thumb.
         /// </summary>
         /// <since_tizen> 8 </since_tizen>
-        public ImageViewStyle Thumb { get; set; }
+        public ImageViewStyle Thumb { get; set; } = new ImageViewStyle();
 
         /// <summary>
         /// Get or set low indicator image.
         /// </summary>
         /// <since_tizen> 8 </since_tizen>
-        public ImageViewStyle LowIndicatorImage { get; set; }
+        public ImageViewStyle LowIndicatorImage { get; set; } = new ImageViewStyle();
 
         /// <summary>
         /// Get or set high indicator image.
         /// </summary>
         /// <since_tizen> 8 </since_tizen>
-        public ImageViewStyle HighIndicatorImage { get; set; }
+        public ImageViewStyle HighIndicatorImage { get; set; } = new ImageViewStyle();
 
         /// <summary>
         /// Get or set low indicator text.
         /// </summary>
         /// <since_tizen> 8 </since_tizen>
-        public TextLabelStyle LowIndicator { get; set; }
+        public TextLabelStyle LowIndicator { get; set; } = new TextLabelStyle();
 
         /// <summary>
         /// Get or set high indicator text.
         /// </summary>
         /// <since_tizen> 8 </since_tizen>
-        public TextLabelStyle HighIndicator { get; set; }
+        public TextLabelStyle HighIndicator { get; set; } = new TextLabelStyle();
 
         /// <summary>
         /// Get or set Indicator type
@@ -203,11 +186,7 @@ namespace Tizen.NUI.Components
         /// <since_tizen> 8 </since_tizen>
         public Extents TrackPadding
         {
-            get
-            {
-                Extents tmp = (Extents)GetValue(TrackPaddingProperty);
-                return (null != tmp) ? tmp : trackPadding = new Extents(OnTrackPaddingChanged, 0, 0, 0, 0);
-            }
+            get => ((Extents)GetValue(TrackPaddingProperty)) ?? (trackPadding = new Extents(0, 0, 0, 0));
             set => SetValue(TrackPaddingProperty, value);
         }
 
@@ -220,54 +199,15 @@ namespace Tizen.NUI.Components
         {
             base.CopyFrom(bindableObject);
 
-            SliderStyle sliderStyle = bindableObject as SliderStyle;
-
-            if (null != sliderStyle)
+            if (bindableObject is SliderStyle sliderStyle)
             {
-                if (sliderStyle.Track != null)
-                {
-                    Track?.CopyFrom(sliderStyle.Track);
-                }
-
-                if (sliderStyle.Progress != null)
-                {
-                    Progress?.CopyFrom(sliderStyle.Progress);
-                }
-
-                if (sliderStyle.Thumb != null)
-                {
-                    Thumb?.CopyFrom(sliderStyle.Thumb);
-                }
-
-                if (sliderStyle.LowIndicatorImage != null)
-                {
-                    LowIndicatorImage?.CopyFrom(sliderStyle.LowIndicatorImage);
-                }
-
-                if (sliderStyle.HighIndicatorImage != null)
-                {
-                    HighIndicatorImage?.CopyFrom(sliderStyle.HighIndicatorImage);
-                }
-
-                if (sliderStyle.LowIndicator != null)
-                {
-                    LowIndicator?.CopyFrom(sliderStyle.LowIndicator);
-                }
-
-                if (sliderStyle.HighIndicator != null)
-                {
-                    HighIndicator?.CopyFrom(sliderStyle.HighIndicator);
-                }
-
-                if (sliderStyle.TrackThickness != null)
-                {
-                    TrackThickness = sliderStyle.TrackThickness;
-                }
-
-                if (sliderStyle.TrackPadding != null)
-                {
-                    TrackPadding = sliderStyle.TrackPadding;
-                }
+                Track.CopyFrom(sliderStyle.Track);
+                Progress.CopyFrom(sliderStyle.Progress);
+                Thumb.CopyFrom(sliderStyle.Thumb);
+                LowIndicatorImage.CopyFrom(sliderStyle.LowIndicatorImage);
+                HighIndicatorImage.CopyFrom(sliderStyle.HighIndicatorImage);
+                LowIndicator.CopyFrom(sliderStyle.LowIndicator);
+                HighIndicator.CopyFrom(sliderStyle.HighIndicator);
             }
         }
 
@@ -290,21 +230,5 @@ namespace Tizen.NUI.Components
 
             base.Dispose(type);
         }
-
-        private void InitSubStyle()
-        {
-            Track = new ImageViewStyle();
-            Progress = new ImageViewStyle();
-            Thumb = new ImageViewStyle();
-            LowIndicatorImage = new ImageViewStyle();
-            HighIndicatorImage = new ImageViewStyle();
-            LowIndicator = new TextLabelStyle();
-            HighIndicator = new TextLabelStyle();
-        }
-
-        private void OnTrackPaddingChanged(ushort start, ushort end, ushort top, ushort bottom)
-        {
-            TrackPadding = new Extents(start, end, top, bottom);
-        }
     }
 }
index f3dc359..3039b99 100755 (executable)
@@ -35,7 +35,6 @@ namespace Tizen.NUI.Components
         /// <since_tizen> 8 </since_tizen>
         public SwitchStyle() : base()
         {
-            InitSubStyle();
         }
 
         /// <summary>
@@ -45,29 +44,19 @@ namespace Tizen.NUI.Components
         /// <since_tizen> 8 </since_tizen>
         public SwitchStyle(SwitchStyle style) : base(style)
         {
-            if(null == style)
-            {
-                return;
-            }
-
-            IsSelectable = true;
-            Track = new ImageViewStyle();
-            Thumb = new ImageViewStyle();
-
-            this.CopyFrom(style);
         }
 
         /// <summary>
         /// Thumb image's style.
         /// </summary>
         /// <since_tizen> 8 </since_tizen>
-        public ImageViewStyle Thumb { get; set; }
+        public ImageViewStyle Thumb { get; set; } = new ImageViewStyle();
 
         /// <summary>
         /// Track image's style.
         /// </summary>
         /// <since_tizen> 8 </since_tizen>
-        public ImageViewStyle Track { get; set; }
+        public ImageViewStyle Track { get; set; } = new ImageViewStyle();
 
         /// <summary>
         /// Style's clone function.
@@ -78,19 +67,10 @@ namespace Tizen.NUI.Components
         {
             base.CopyFrom(bindableObject);
 
-            SwitchStyle switchStyle = bindableObject as SwitchStyle;
-
-            if (null != switchStyle)
+            if (bindableObject is SwitchStyle switchStyle)
             {
-                if (null != switchStyle.Track)
-                {
-                    Track?.CopyFrom(switchStyle.Track);
-                }
-
-                if (null != switchStyle.Thumb)
-                {
-                    Thumb?.CopyFrom(switchStyle.Thumb);
-                }
+                Track.CopyFrom(switchStyle.Track);
+                Thumb.CopyFrom(switchStyle.Thumb);
             }
         }
 
@@ -100,27 +80,5 @@ namespace Tizen.NUI.Components
         {
             return new SlidingSwitchExtension();
         }
-
-        private void InitSubStyle()
-        {
-            IsSelectable = true;
-            Track = new ImageViewStyle()
-            {
-                PositionUsesPivotPoint = true,
-                ParentOrigin = Tizen.NUI.ParentOrigin.CenterLeft,
-                PivotPoint = Tizen.NUI.PivotPoint.CenterLeft,
-                WidthResizePolicy = ResizePolicyType.FillToParent,
-                HeightResizePolicy = ResizePolicyType.FillToParent
-            };
-
-            Thumb = new ImageViewStyle()
-            {
-                PositionUsesPivotPoint = true,
-                ParentOrigin = Tizen.NUI.ParentOrigin.CenterLeft,
-                PivotPoint = Tizen.NUI.PivotPoint.CenterLeft,
-                WidthResizePolicy = ResizePolicyType.Fixed,
-                HeightResizePolicy = ResizePolicyType.Fixed
-            };
-        }
     }
 }
index d07ce37..f3d2f10 100755 (executable)
@@ -37,9 +37,6 @@ namespace Tizen.NUI.Components
             ItemPadding = new Extents(0, 0, 0, 0);
             UseTextNaturalSize = false;
             ItemSpace = 0;
-
-            UnderLine = new ViewStyle();
-            Text = new TextLabelStyle();
         }
 
         /// <summary>
@@ -49,47 +46,19 @@ namespace Tizen.NUI.Components
         [EditorBrowsable(EditorBrowsableState.Never)]
         public TabStyle(TabStyle style) : base(style)
         {
-            UnderLine = new ViewStyle();
-            Text = new TextLabelStyle();
-
-            if (null == style)
-            {
-                return;
-            }
-
-            if (style.UnderLine != null)
-            {
-                UnderLine?.CopyFrom(style.UnderLine);
-            }
-
-            if (style.Text != null)
-            {
-                Text?.CopyFrom(style.Text);
-            }
-
-            if (style.ItemPadding != null)
-            {
-                ItemPadding = new Extents(style.ItemPadding.Start, style.ItemPadding.End, style.ItemPadding.Top, style.ItemPadding.Bottom);
-            }
-            else
-            {
-                ItemPadding = new Extents(0, 0, 0, 0);
-            }
-            ItemSpace = style.ItemSpace;
-            UseTextNaturalSize = style.UseTextNaturalSize;
         }
 
         /// <summary>
         /// UnderLine's style.
         /// </summary>
         [EditorBrowsable(EditorBrowsableState.Never)]
-        public ViewStyle UnderLine { get; set; }
+        public ViewStyle UnderLine { get; set; } = new ViewStyle();
 
         /// <summary>
         /// Text's style.
         /// </summary>
         [EditorBrowsable(EditorBrowsableState.Never)]
-        public TextLabelStyle Text { get; set; }
+        public TextLabelStyle Text { get; set; } = new TextLabelStyle();
 
         /// <summary>
         /// Flag to decide if item is fill with item text's natural width.
@@ -109,35 +78,19 @@ namespace Tizen.NUI.Components
         [EditorBrowsable(EditorBrowsableState.Never)]
         public Extents ItemPadding { get; set; }
 
-        /// <summary>
-        /// Style's clone function.
-        /// </summary>
-        /// <param name="bindableObject">The style that need to copy.</param>
+        /// <inheritdoc/>
         [EditorBrowsable(EditorBrowsableState.Never)]
         public override void CopyFrom(BindableObject bindableObject)
         {
             base.CopyFrom(bindableObject);
-            TabStyle tabStyle = bindableObject as TabStyle;
 
-            if (null != tabStyle)
+            if (bindableObject is TabStyle tabStyle)
             {
-                if (null != tabStyle.ItemPadding)
-                {
-                    ItemPadding?.CopyFrom(tabStyle.ItemPadding);
-                }
-
+                UnderLine.CopyFrom(tabStyle.UnderLine);
+                Text.CopyFrom(tabStyle.Text);
+                ItemPadding = tabStyle.ItemPadding == null ? null : new Extents(tabStyle.ItemPadding);
                 ItemSpace = tabStyle.ItemSpace;
                 UseTextNaturalSize = tabStyle.UseTextNaturalSize;
-
-                if (null != tabStyle.UnderLine)
-                {
-                    UnderLine?.CopyFrom(tabStyle.UnderLine);
-                }
-
-                if (null != tabStyle.Text)
-                {
-                    Text?.CopyFrom(tabStyle.Text);
-                }
             }
         }
     }
diff --git a/src/Tizen.NUI.Components/Style/Theme.cs b/src/Tizen.NUI.Components/Style/Theme.cs
deleted file mode 100755 (executable)
index 9e171cb..0000000
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * Copyright(c) 2020 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.Collections.Generic;
-using System.ComponentModel;
-using Tizen.NUI.BaseComponents;
-
-namespace Tizen.NUI.Components
-{
-    /// <summary>
-    /// Interface that includes styles for all components for a theme
-    /// </summary>
-    [EditorBrowsable(EditorBrowsableState.Never)]
-    internal abstract class Theme
-    {
-        private Dictionary<Type, ComponentStyleGetter> styleMap;
-
-        protected Theme()
-        {
-            styleMap = new Dictionary<Type, ComponentStyleGetter>();
-            styleMap.Add(typeof(Button), GetButtonStyle);
-            styleMap.Add(typeof(CheckBox), GetCheckBoxStyle);
-            styleMap.Add(typeof(DropDown), GetDropDownStyle);
-            styleMap.Add(typeof(DropDown.DropDownDataItem), GetDropDownItemStyle);
-            styleMap.Add(typeof(Popup), GetPopupStyle);
-            styleMap.Add(typeof(Progress), GetProgressStyle);
-            styleMap.Add(typeof(RadioButton), GetRadioButtonStyle);
-            styleMap.Add(typeof(Slider), GetSliderStyle);
-            styleMap.Add(typeof(Switch), GetSwitchStyle);
-            styleMap.Add(typeof(Tab), GetTabStyle);
-            styleMap.Add(typeof(Toast), GetToastStyle);
-            styleMap.Add(typeof(Loading), GetLoadingStyle);
-            styleMap.Add(typeof(Pagination), GetPaginationStyle);
-        }
-
-        internal delegate ViewStyle ComponentStyleGetter();
-
-        internal ViewStyle GetComponentStyle(Type type)
-        {
-            return styleMap.ContainsKey(type) ? styleMap[type]() : null;
-        }
-
-        internal void OverwriteComponentStyle(Type type, ComponentStyleGetter styleGetter)
-        {
-            styleMap.Add(typeof(Toast), GetToastStyle);
-        }
-
-        protected abstract ButtonStyle GetButtonStyle();
-
-        protected abstract ButtonStyle GetCheckBoxStyle();
-
-        protected abstract DropDownStyle GetDropDownStyle();
-
-        protected abstract DropDownItemStyle GetDropDownItemStyle();
-
-        protected abstract PopupStyle GetPopupStyle();
-
-        protected abstract ProgressStyle GetProgressStyle();
-
-        protected abstract ButtonStyle GetRadioButtonStyle();
-
-        protected abstract SliderStyle GetSliderStyle();
-
-        protected abstract SwitchStyle GetSwitchStyle();
-
-        protected abstract TabStyle GetTabStyle();
-
-        protected abstract ToastStyle GetToastStyle();
-
-        protected abstract LoadingStyle GetLoadingStyle();
-
-        protected abstract PaginationStyle GetPaginationStyle();
-    }
-}
index 94ddbe3..18d798d 100755 (executable)
@@ -26,6 +26,19 @@ namespace Tizen.NUI.Components
     [EditorBrowsable(EditorBrowsableState.Never)]
     public class ToastStyle : ControlStyle
     {
+        /// <summary>The Duration bindable property.</summary>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public static readonly BindableProperty DurationProperty = BindableProperty.Create(nameof(Duration), typeof(uint?), typeof(ToastStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
+        {
+            ((ToastStyle)bindable).duration = (uint?)newValue;
+        },
+        defaultValueCreator: (bindable) =>
+        {
+            return ((ToastStyle)bindable).duration;
+        });
+
+        private uint? duration;
+
         static ToastStyle() { }
 
         /// <summary>
@@ -34,7 +47,6 @@ namespace Tizen.NUI.Components
         [EditorBrowsable(EditorBrowsableState.Never)]
         public ToastStyle() : base()
         {
-            InitSubStyle();
         }
 
         /// <summary>
@@ -44,54 +56,34 @@ namespace Tizen.NUI.Components
         [EditorBrowsable(EditorBrowsableState.Never)]
         public ToastStyle(ToastStyle style) : base(style)
         {
-            InitSubStyle();
-            this.CopyFrom(style);
         }
 
         /// <summary>
         /// Gets or sets toast show duration time.
         /// </summary>
         [EditorBrowsable(EditorBrowsableState.Never)]
-        public uint? Duration { get; set; }
+        public uint? Duration
+        {
+            get => (uint?)GetValue(DurationProperty);
+            set => SetValue(DurationProperty, value);
+        }
 
         /// <summary>
         /// Text's Style.
         /// </summary>
         [EditorBrowsable(EditorBrowsableState.Never)]
-        public TextLabelStyle Text { get; set; }
+        public TextLabelStyle Text { get; set; } = new TextLabelStyle();
 
-        /// <summary>
-        /// Style's clone function.
-        /// </summary>
-        /// <param name="bindableObject">The style that need to copy.</param>
+        /// <inheritdoc/>
         [EditorBrowsable(EditorBrowsableState.Never)]
         public override void CopyFrom(BindableObject bindableObject)
         {
             base.CopyFrom(bindableObject);
-            ToastStyle toastStyle = bindableObject as ToastStyle;
-            if (toastStyle != null)
-            {
-                if (null != toastStyle.Text)
-                {
-                    Text?.CopyFrom(toastStyle.Text);
-                }
-                Duration = toastStyle.Duration;
-            }
-        }
 
-        private void InitSubStyle()
-        {
-            Text = new TextLabelStyle()
+            if (bindableObject is ToastStyle toastStyle)
             {
-                PositionUsesPivotPoint = true,
-                ParentOrigin = Tizen.NUI.ParentOrigin.Center,
-                PivotPoint = Tizen.NUI.PivotPoint.Center,
-                WidthResizePolicy = ResizePolicyType.UseNaturalSize,
-                HeightResizePolicy = ResizePolicyType.UseNaturalSize,
-                HorizontalAlignment = HorizontalAlignment.Center,
-                VerticalAlignment = VerticalAlignment.Center,
-                TextColor = Tizen.NUI.Color.White,
-            };
+                Text.CopyFrom(toastStyle.Text);
+            }
         }
     }
 }
index 5df6042..cfc5d93 100755 (executable)
@@ -12,7 +12,7 @@
   </ItemGroup>
 
   <ItemGroup>
-    <None Update="res\*.png">
+    <None Update="res\**">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
     </None>
   </ItemGroup>
index 388e765..0e77746 100755 (executable)
@@ -27,53 +27,19 @@ namespace Tizen.NUI.Components
     [EditorBrowsable(EditorBrowsableState.Never)]
     public sealed class StyleManager
     {
-        internal const float PointSizeNormal = 12;
-        internal const float PointSizeTitle = 16;
-
-        private const string defaultThemeName = "DEFAULT"; //"default";
-        private const string wearableThemeName = "WEARABLE"; //"wearable";
-        
-        private string currentThemeName = defaultThemeName;
-        private Dictionary<string, Dictionary<string, StyleBase>> themeStyleSet = new Dictionary<string, Dictionary<string, StyleBase>>();
-        private Dictionary<string, StyleBase> defaultStyleSet = new Dictionary<string, StyleBase>();
-
-        /// <summary>
-        /// (Theme name, Theme instance)
-        /// </summary>
-        private Dictionary<string, Dictionary<Type, StyleBase>> componentStyleByTheme = new Dictionary<string, Dictionary<Type, StyleBase>>();
-        
-        /// <summary>
-        /// (Theme name, Theme instance)
-        /// </summary>
-        private Dictionary<string, Theme> themeMap = new Dictionary<string, Theme>();
-
-        private EventHandler<ThemeChangeEventArgs> themeChangeHandler;
-
-        private Theme currentTheme;
-
         /// <summary>
         /// StyleManager construct.
         /// </summary>
         private StyleManager()
         {
-            SetInitialThemeByDeviceProfile();
+            ThemeManager.ThemeChanged += OnThemeChanged;
         }
 
         /// <summary>
         /// An event for the theme changed signal which can be used to subscribe or unsubscribe the event handler provided by the user.<br />
         /// </summary>
         [EditorBrowsable(EditorBrowsableState.Never)]
-        public event EventHandler<ThemeChangeEventArgs> ThemeChangedEvent
-        {
-            add
-            {
-                themeChangeHandler += value;
-            }
-            remove
-            {
-                themeChangeHandler -= value;
-            }
-        }
+        public event EventHandler<ThemeChangeEventArgs> ThemeChangedEvent;
 
         /// <summary>
         /// StyleManager static instance.
@@ -89,26 +55,41 @@ namespace Tizen.NUI.Components
         {
             get
             {
-                return currentThemeName;
+                return ThemeManager.CurrentTheme?.Id;
             }
-
             set
             {
-                if (value != null && currentThemeName != value)
-                {
-                    currentThemeName = value.ToUpperInvariant();
-                    themeChangeHandler?.Invoke(null, new ThemeChangeEventArgs { CurrentTheme = currentThemeName });
+                if (value == null) return;
+
+                var key = value.ToUpperInvariant();
 
-                    UpdateTheme();
+                // Please note that it does not check "key == Theme" here,
+                // because of the font size issue of the Tizen.NUI.StyleManager.
+                // (There are applications to use NUI.Components.StyleManager.ThemeChangedEvent to fix Tizen.NUI.StyleManager font size issue.)
+                // Please do not check equality until we fix that issue.
+
+                if (!ThemeMap.ContainsKey(key) || ThemeMap[key] == null)
+                {
+                    ThemeMap[key] = new Theme()
+                    {
+                        Id = value
+                    };
                 }
+
+                ThemeManager.CurrentTheme = ThemeMap[key];
             }
         }
 
         /// <summary>
+        /// (Theme name, Theme instance)
+        /// </summary>
+        private Dictionary<string, Theme> ThemeMap { get; } = new Dictionary<string, Theme> { ["DEFAULT"] = ThemeManager.DefaultTheme };
+
+        /// <summary>
         /// Register style in StyleManager.
         /// </summary>
         /// <param name="style">Style name.</param>
-        /// <param name="theme">Theme.</param>
+        /// <param name="theme">Theme id.</param>
         /// <param name="styleType">Style type.</param>
         /// <param name="bDefault">Flag to decide if it is default style.</param>
         [EditorBrowsable(EditorBrowsableState.Never)]
@@ -119,32 +100,35 @@ namespace Tizen.NUI.Components
                 throw new InvalidOperationException($"style can't be null");
             }
 
-            if (theme == null || bDefault == true)
+            if (Activator.CreateInstance(styleType) is StyleBase styleBase)
             {
-                if (defaultStyleSet.ContainsKey(style))
+                var key = "DEFAULT";
+
+                if (bDefault && theme != null)
                 {
-                    throw new InvalidOperationException($"{style}] already be used");
+                    ThemeMap[key].AddStyleWithoutClone(style, styleBase.GetViewStyle());
                 }
-                else
+
+                if (theme != null)
                 {
-                    defaultStyleSet.Add(style, Activator.CreateInstance(styleType) as StyleBase);
+                    key = theme.ToUpperInvariant();
                 }
-                return;
-            }
 
-            theme = theme.ToUpperInvariant();
+                if (!ThemeMap.ContainsKey(key) || ThemeMap[key] == null)
+                {
+                    ThemeMap[key] = new Theme()
+                    {
+                        Id = theme ?? key
+                    };
+                }
 
-            if (themeStyleSet.ContainsKey(style) && themeStyleSet[style].ContainsKey(theme))
-            {
-                throw new InvalidOperationException($"{style}] already be used");
-            }
+                if (ThemeMap[key].HasStyle(style))
+                {
+                    throw new InvalidOperationException($"{style} already be used");
+                }
 
-            if (!themeStyleSet.ContainsKey(style))
-            {
-                themeStyleSet.Add(style, new Dictionary<string, StyleBase>());
+                ThemeMap[key].AddStyleWithoutClone(style, styleBase.GetViewStyle());
             }
-
-            themeStyleSet[style].Add(theme, Activator.CreateInstance(styleType) as StyleBase);
         }
 
         /// <summary>
@@ -160,16 +144,7 @@ namespace Tizen.NUI.Components
                 return null;
             }
 
-            if (themeStyleSet.ContainsKey(style) && themeStyleSet[style].ContainsKey(Theme))
-            {
-                return (themeStyleSet[style][Theme])?.GetViewStyle();
-            }
-            else if (defaultStyleSet.ContainsKey(style))
-            {
-                return (defaultStyleSet[style])?.GetViewStyle();
-            }
-
-            return null;
+            return ThemeManager.GetStyle(style);
         }
 
         /// <summary>
@@ -186,25 +161,15 @@ namespace Tizen.NUI.Components
                 throw new ArgumentException("The argument targetTheme must be specified");
             }
 
-            if (!themeMap.ContainsKey(targetTheme))
+            var key = targetTheme.ToUpperInvariant();
+
+            if (!ThemeMap.ContainsKey(key) || ThemeMap[key] == null)
             {
                 Tizen.Log.Error("NUI", "The theme name should be a known one.");
                 return;
             }
 
-            if (!componentStyleByTheme.ContainsKey(targetTheme))
-            {
-                componentStyleByTheme.Add(targetTheme, new Dictionary<Type, StyleBase>());
-            }
-
-            if (componentStyleByTheme[targetTheme].ContainsKey(component))
-            {
-                componentStyleByTheme[targetTheme][component] = Activator.CreateInstance(style) as StyleBase;
-            }
-            else
-            {
-                componentStyleByTheme[targetTheme].Add(component, Activator.CreateInstance(style) as StyleBase);
-            }
+            ThemeMap[key].AddStyleWithoutClone(component.FullName, (Activator.CreateInstance(style) as StyleBase).GetViewStyle());
         }
 
         /// <summary>
@@ -215,12 +180,12 @@ namespace Tizen.NUI.Components
         [EditorBrowsable(EditorBrowsableState.Never)]
         public ViewStyle GetComponentStyle(Type component)
         {
-            if (componentStyleByTheme.ContainsKey(currentThemeName) && componentStyleByTheme[currentThemeName].ContainsKey(component))
-            {
-                return componentStyleByTheme[currentThemeName][component].GetViewStyle();
-            }
+            return ThemeManager.GetStyle(component.FullName);
+        }
 
-            return currentTheme.GetComponentStyle(component);
+        private void OnThemeChanged(object target, ThemeChangedEventArgs args)
+        {
+            ThemeChangedEvent?.Invoke(null, new ThemeChangeEventArgs { CurrentTheme = args.ThemeId });
         }
 
         /// <summary>
@@ -235,52 +200,5 @@ namespace Tizen.NUI.Components
             [EditorBrowsable(EditorBrowsableState.Never)]
             public string CurrentTheme;
         }
-
-        internal static string GetFrameworkResourcePath(string resourceFileName)
-        {
-            return "/usr/share/dotnet.tizen/framework/res/" + resourceFileName;
-        }
-
-        private void SetInitialThemeByDeviceProfile()
-        {
-            Theme wearableTheme = WearableTheme.Instance;
-            Theme defaultTheme = DefaultTheme.Instance;
-            themeMap.Add(wearableThemeName, wearableTheme);
-            themeMap.Add(defaultThemeName, defaultTheme);
-
-            currentThemeName = defaultThemeName;
-            currentTheme = defaultTheme;
-
-            string currentProfile;
-
-            try
-            {
-                System.Information.TryGetValue<string>("tizen.org/feature/profile", out currentProfile);
-                Tizen.Log.Info("NUI", "Profile for initial theme found : " + currentProfile);
-            }
-            catch
-            {
-                Tizen.Log.Error("NUI", "Unknown device profile\n");
-                return;
-            }
-
-            if (string.Equals(currentProfile, wearableThemeName))
-            {
-                currentThemeName = wearableThemeName;
-                currentTheme = wearableTheme;
-            }
-        }
-
-        private void UpdateTheme()
-        {
-            if (themeMap.ContainsKey(currentThemeName))
-            {
-                currentTheme = themeMap[currentThemeName];
-            }
-            else
-            {
-                currentTheme = DefaultTheme.Instance;
-            }
-        }
     }
 }
diff --git a/src/Tizen.NUI.Components/res/Theme/Tizen.NUI.Components_Tizen.NUI.Theme.Common.xaml b/src/Tizen.NUI.Components/res/Theme/Tizen.NUI.Components_Tizen.NUI.Theme.Common.xaml
new file mode 100644 (file)
index 0000000..afdd2ca
--- /dev/null
@@ -0,0 +1,233 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Theme
+  xmlns="http://tizen.org/Tizen.NUI/2018/XAML"
+  xmlns:c="clr-namespace:Tizen.NUI.Components;assembly=Tizen.NUI.Components"
+  xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
+  Id="Tizen.NUI.Theme.Common" >
+
+  <!--Button-->
+  <c:ButtonStyle x:Key="Tizen.NUI.Components.Button" Size="100, 45">
+    <c:ButtonStyle.BackgroundColor>
+      <Selector x:TypeArguments="Color" Normal="0.88, 0.88, 0.88, 1" Pressed="0.77, 0.77, 0.77, 1" Disabled="0.88, 0.88, 0.88, 1"/>
+    </c:ButtonStyle.BackgroundColor>
+    <c:ButtonStyle.Text>  <!--Button Text-->
+      <TextLabelStyle PointSize="12">
+        <TextLabelStyle.TextColor>
+          <Selector x:TypeArguments="Color" Normal="0.22, 0.22, 0.22, 1" Pressed="0.11, 0.11, 0.11, 1" Disabled="0.66, 0.66, 0.66, 1"/>
+        </TextLabelStyle.TextColor>
+      </TextLabelStyle>
+    </c:ButtonStyle.Text>
+  </c:ButtonStyle>
+
+  <!--CheckBox-->
+  <c:ButtonStyle x:Key="Tizen.NUI.Components.CheckBox" Size="30, 30">
+    <c:ButtonStyle.Icon> <!--CheckBox Icon-->
+      <ImageViewStyle>
+        <ImageViewStyle.Opacity>
+          <Selector x:TypeArguments="x:Single?" Normal="1.0" Selected="1.0" Disabled="0.4" DisabledSelected="0.4"/>
+        </ImageViewStyle.Opacity>
+        <ImageViewStyle.BackgroundImage>
+          <Selector x:TypeArguments="x:String" Pressed="{NUIResourcePath nui_component_default_checkbox_bg_p.png}" Selected="{NUIResourcePath nui_component_default_checkbox_bg_p.png}" Other="{NUIResourcePath nui_component_default_checkbox_bg_n.png}"/>
+        </ImageViewStyle.BackgroundImage>
+        <ImageViewStyle.ResourceUrl>
+          <Selector x:TypeArguments="x:String" Selected="{NUIResourcePath nui_component_default_checkbox_s.png}" Other=""/>
+        </ImageViewStyle.ResourceUrl>
+      </ImageViewStyle>
+    </c:ButtonStyle.Icon>
+    <c:ButtonStyle.Text>  <!--CheckBox Text-->
+      <TextLabelStyle PointSize="12">
+        <TextLabelStyle.TextColor>
+          <Selector x:TypeArguments="Color" Normal="0.22, 0.22, 0.22, 1" Pressed="0.11, 0.11, 0.11, 1" Disabled="0.66, 0.66, 0.66, 1"/>
+        </TextLabelStyle.TextColor>
+      </TextLabelStyle>
+    </c:ButtonStyle.Text>
+  </c:ButtonStyle>
+
+  <!--DropDown-->
+  <c:DropDownStyle x:Key="Tizen.NUI.Components.DropDown" SpaceBetweenButtonTextAndIcon="10" ListPadding="5">
+    <c:DropDownStyle.Button> <!--DropDown Button-->
+      <c:ButtonStyle BackgroundImageBorder="6, 6, 6, 6" IconPadding="6">
+        <c:ButtonStyle.BackgroundImage>
+          <Selector x:TypeArguments="x:String" Pressed="{NUIResourcePath nui_component_default_checkbox_bg_p.png}" Other="{NUIResourcePath nui_component_default_checkbox_bg_n.png}"/>
+        </c:ButtonStyle.BackgroundImage>
+        <c:ButtonStyle.Text>
+          <TextLabelStyle Text="Select an item" PointSize="12"/>
+        </c:ButtonStyle.Text>
+        <c:ButtonStyle.Icon>
+          <ImageViewStyle Size="28, 28" ResourceUrl="{NUIResourcePath nui_component_default_dropdown_button_icon.png}"/>
+        </c:ButtonStyle.Icon>
+      </c:ButtonStyle>
+    </c:DropDownStyle.Button>
+    <c:DropDownStyle.ListBackgroundImage> <!--DropDown ListBackgroundImage-->
+      <ImageViewStyle ResourceUrl="{NUIResourcePath nui_component_default_dropdown_list_bg.png}" Border="6, 6, 6, 6" Size="280, 360"/>
+    </c:DropDownStyle.ListBackgroundImage>
+  </c:DropDownStyle>
+
+  <!--DropDownDataItem-->
+  <c:DropDownItemStyle x:Key="Tizen.NUI.Components.DropDown.DropDownDataItem" Size="360, 50">
+    <c:DropDownItemStyle.BackgroundColor>
+      <Selector x:TypeArguments="Color" Pressed="0.05, 0.63, 0.9, 1" Selected="0.8, 0.8, 0.8, 1" Normal="1, 1, 1, 1"/>
+    </c:DropDownItemStyle.BackgroundColor>
+    <c:DropDownItemStyle.Text>
+      <TextLabelStyle PointSize="12" Position="28, 0"/>
+    </c:DropDownItemStyle.Text>
+  </c:DropDownItemStyle>
+
+  <!--DropDownDataItem (for legacy FH)-->
+  <c:DropDownItemStyle x:Key="Tizen.FH.NUI.Components.DropDownDataItem" Size="360, 50">
+    <c:DropDownItemStyle.BackgroundColor>
+      <Selector x:TypeArguments="Color" Pressed="0.05, 0.63, 0.9, 1" Selected="0.8, 0.8, 0.8, 1" Normal="1, 1, 1, 1"/>
+    </c:DropDownItemStyle.BackgroundColor>
+    <c:DropDownItemStyle.Text>
+      <TextLabelStyle PointSize="12" Position="28, 0"/>
+    </c:DropDownItemStyle.Text>
+  </c:DropDownItemStyle>
+
+  <!--DropDownDataItem (for legacy FH)-->
+  <c:DropDownItemStyle x:Key="DropDownDataItem" Size="360, 50">
+    <c:DropDownItemStyle.BackgroundColor>
+      <Selector x:TypeArguments="Color" Pressed="0.05, 0.63, 0.9, 1" Selected="0.8, 0.8, 0.8, 1" Normal="1, 1, 1, 1"/>
+    </c:DropDownItemStyle.BackgroundColor>
+    <c:DropDownItemStyle.Text>
+      <TextLabelStyle PointSize="12" Position="28, 0"/>
+    </c:DropDownItemStyle.Text>
+  </c:DropDownItemStyle>
+
+  <!--Popup-->
+  <c:PopupStyle x:Key="Tizen.NUI.Components.Popup" Size="500, 280" BackgroundColor="0.9, 0.9, 0.9, 1">
+    <c:PopupStyle.ImageShadow>
+      <ImageShadow Url="{NUIResourcePath nui_component_default_popup_shadow.png}" Border="24, 24, 24, 24" Extents="48, 48"/>
+    </c:PopupStyle.ImageShadow>
+    <c:PopupStyle.Title>
+      <TextLabelStyle PointSize="16" Padding="20" />
+    </c:PopupStyle.Title>
+    <c:PopupStyle.Buttons>
+      <c:ButtonStyle Size="0, 80">
+        <c:ButtonStyle.BackgroundColor>
+          <Selector x:TypeArguments="Color" Normal="1, 1, 1, 1" Pressed="1, 1, 1, 0.5"/>
+        </c:ButtonStyle.BackgroundColor>
+        <c:ButtonStyle.Overlay>
+          <ImageViewStyle>
+            <ImageViewStyle.BackgroundColor>
+              <Selector x:TypeArguments="Color" Normal="1, 1, 1, 1" Pressed="0, 0, 0, 0.1" Selected="1, 1, 1, 1"/>
+            </ImageViewStyle.BackgroundColor>
+          </ImageViewStyle>
+        </c:ButtonStyle.Overlay>
+        <c:ButtonStyle.Text>
+          <TextLabelStyle TextColor="0.05, 0.63, 0.9, 1" />
+        </c:ButtonStyle.Text>
+      </c:ButtonStyle>
+    </c:PopupStyle.Buttons>
+  </c:PopupStyle>
+
+  <!--Progress-->
+  <c:ProgressStyle x:Key="Tizen.NUI.Components.Progress" Size="200, 5">
+    <c:ProgressStyle.Track>
+      <ImageViewStyle BackgroundColor="0, 0, 0, 0.1" />
+    </c:ProgressStyle.Track>
+    <c:ProgressStyle.Buffer>
+      <ImageViewStyle BackgroundColor="0.05, 0.63, 0.9, 0.3" />
+    </c:ProgressStyle.Buffer>
+    <c:ProgressStyle.Progress>
+      <ImageViewStyle BackgroundColor="0.05, 0.63, 0.9, 1" />
+    </c:ProgressStyle.Progress>
+  </c:ProgressStyle>
+
+  <!--RadioButton-->
+  <c:ButtonStyle x:Key="Tizen.NUI.Components.RadioButton" Size="30, 30">
+    <c:ButtonStyle.Icon>
+      <ImageViewStyle>
+        <ImageViewStyle.Opacity>
+          <Selector x:TypeArguments="x:Single?" Normal="1" Selected="1" Disabled="0.4" DisabledSelected="0.4"/>
+        </ImageViewStyle.Opacity>
+        <ImageViewStyle.BackgroundImage>
+          <Selector x:TypeArguments="x:String" Pressed="{NUIResourcePath nui_component_default_radiobutton_p.png}" Selected="{NUIResourcePath nui_component_default_radiobutton_s.png}" Other="{NUIResourcePath nui_component_default_radiobutton_n.png}" />
+        </ImageViewStyle.BackgroundImage>
+      </ImageViewStyle>
+    </c:ButtonStyle.Icon>
+    <c:ButtonStyle.Text>
+      <TextLabelStyle PointSize="12">
+        <TextLabelStyle.TextColor>
+          <Selector x:TypeArguments="Color" Normal="0.22, 0.22, 0.22, 1" Pressed="0.11, 0.11, 0.11, 1" Disabled="0.66, 0.66, 0.66, 1" />
+        </TextLabelStyle.TextColor>
+      </TextLabelStyle>
+    </c:ButtonStyle.Text>
+  </c:ButtonStyle>
+
+  <!--Slider-->
+  <c:SliderStyle x:Key="Tizen.NUI.Components.Slider" Size="200, 50" TrackThickness="5">
+    <c:SliderStyle.Track>
+      <ImageViewStyle BackgroundColor="0, 0, 0, 0.1" />
+    </c:SliderStyle.Track>
+    <c:SliderStyle.Progress>
+      <ImageViewStyle BackgroundColor="0.5, 0.63, 0.9, 1" />
+    </c:SliderStyle.Progress>
+    <c:SliderStyle.Thumb>
+      <ImageViewStyle Size="50, 50" ResourceUrl="{NUIResourcePath nui_component_default_slider_thumb_n.png}">
+        <ImageViewStyle.BackgroundImage>
+          <Selector x:TypeArguments="x:String" Normal="" Pressed="{NUIResourcePath nui_component_default_slider_thumb_bg_p.png}" />
+        </ImageViewStyle.BackgroundImage>
+      </ImageViewStyle>
+    </c:SliderStyle.Thumb>
+  </c:SliderStyle>
+
+  <!--Switch-->
+  <c:SwitchStyle x:Key="Tizen.NUI.Components.Switch" Size="96, 60">
+    <c:Switch.Track>
+      <ImageViewStyle Size="96, 60">
+        <ImageViewStyle.ResourceUrl>
+          <Selector x:TypeArguments="x:String" Normal="{NUIResourcePath nui_component_default_switch_track_n.png}" Selected="{NUIResourcePath nui_component_default_switch_track_s.png}" Disabled="{NUIResourcePath nui_component_default_switch_track_d.png}" DisabledSelected="{NUIResourcePath nui_component_default_switch_track_ds.png}" />
+        </ImageViewStyle.ResourceUrl>
+      </ImageViewStyle>
+    </c:Switch.Track>
+    <c:Switch.Thumb>
+      <ImageViewStyle Size="60, 60">
+        <ImageViewStyle.ResourceUrl>
+          <Selector x:TypeArguments="x:String" Normal="{NUIResourcePath nui_component_default_switch_thumb_n.png}" Disabled="{NUIResourcePath nui_component_default_switch_thumb_d.png}" Selected="{NUIResourcePath nui_component_default_switch_thumb_n.png}" />
+        </ImageViewStyle.ResourceUrl>
+      </ImageViewStyle>
+    </c:Switch.Thumb>
+    <c:Switch.Text>
+      <TextLabelStyle PointSize="12">
+        <TextLabelStyle.TextColor>
+          <Selector x:TypeArguments="Color" Normal="0.22, 0.22, 0.22, 1" Pressed="0.11, 0.11, 0.11, 1" Disabled="0.66, 0.66, 0.66, 1" />
+        </TextLabelStyle.TextColor>
+      </TextLabelStyle>
+    </c:Switch.Text>
+  </c:SwitchStyle>
+
+  <!--Tab-->
+  <c:TabStyle x:Key="Tizen.NUI.Components.Tab" Size="480, 80" BackgroundColor="Yellow">
+    <c:TabStyle.UnderLine>
+      <ViewStyle Size="0, 6" BackgroundColor="0.05, 0.63, 0.9, 1.0" />
+    </c:TabStyle.UnderLine>
+    <c:TabStyle.Text>
+      <TextLabelStyle PointSize="16">
+        <TextLabelStyle.TextColor>
+          <Selector x:TypeArguments="Color" Normal="Black" Selected="0.05, 0.63, 0.9, 1" />
+        </TextLabelStyle.TextColor>
+      </TextLabelStyle>
+    </c:TabStyle.Text>
+  </c:TabStyle>
+
+  <!--Toast-->
+  <c:ToastStyle x:Key="Tizen.NUI.Components.Toast" BackgroundColor="0, 0, 0, 0.8">
+    <c:ToastStyle.Text>
+      <TextLabelStyle Padding="12, 12, 8, 8" />
+    </c:ToastStyle.Text>
+  </c:ToastStyle>
+
+  <!--Loading-->
+  <c:LoadingStyle x:Key="Tizen.NUI.Components.Loading" LoadingSize="100, 100" />
+  
+  <!--Pagination-->
+  <c:PaginationStyle x:Key="Tizen.NUI.Components.Pagination">
+    <c:PaginationStyle.IndicatorImageUrl>
+      <Selector x:TypeArguments="x:String" Normal="{NUIResourcePath nui_component_default_pagination_normal_dot.png}" Selected="{NUIResourcePath nui_component_default_pagination_focus_dot.png}" />
+    </c:PaginationStyle.IndicatorImageUrl>
+  </c:PaginationStyle>
+
+  <!--Scrollbar-->
+  <c:ScrollbarStyle x:Key="Tizen.NUI.Components.Scrollbar" TrackThickness="6" ThumbThickness="6" TrackColor="1, 1, 1, 0.15" ThumbColor="0.6, 0.6, 0.6, 1.0" TrackPadding="4" />
+
+</Theme>
\ No newline at end of file
diff --git a/src/Tizen.NUI.Components/res/Theme/Tizen.NUI.Components_Tizen.NUI.Theme.Wearable.xaml b/src/Tizen.NUI.Components/res/Theme/Tizen.NUI.Components_Tizen.NUI.Theme.Wearable.xaml
new file mode 100644 (file)
index 0000000..f4476bb
--- /dev/null
@@ -0,0 +1,59 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Theme
+  xmlns="http://tizen.org/Tizen.NUI/2018/XAML"
+  xmlns:c="clr-namespace:Tizen.NUI.Components;assembly=Tizen.NUI.Components"
+  xmlns:cx="clr-namespace:Tizen.NUI.Components.Extension;assembly=Tizen.NUI.Components"
+  xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
+  Id="Tizen.NUI.Theme.Wearable">
+
+  <!--Button-->
+  <c:ButtonStyle x:Key="Tizen.NUI.Components.Button" Size="210, 72" CornerRadius="36">
+    <c:ButtonStyle.BackgroundColor>
+      <Selector x:TypeArguments="Color" Normal="0, 0.1647, 0.3019, 0.85" Pressed="0, 0.2475, 0.5019, 0.85" Disabled="0.2392, 0.2392, 0.2392, 0.85"/>
+    </c:ButtonStyle.BackgroundColor>
+    <c:ButtonStyle.Opacity>
+      <Selector x:TypeArguments="x:Single?" Other="1.0" Disabled="0.3"/>
+    </c:ButtonStyle.Opacity>
+    <c:ButtonStyle.Text>  <!--Button Text-->
+      <TextLabelStyle FontFamily="SamsungOne 700" PixelSize="28" Padding="20, 20, 0, 0" HorizontalAlignment="Center" VerticalAlignment="Center">
+        <TextLabelStyle.TextColor>
+          <Selector x:TypeArguments="Color" Normal="0.2196, 0.6131, 0.9882, 1" Disabled="1, 1, 1, 0.35"/>
+        </TextLabelStyle.TextColor>
+      </TextLabelStyle>
+    </c:ButtonStyle.Text>
+  </c:ButtonStyle>
+
+  <!--CheckBox-->
+  <cx:LottieButtonStyle x:Key="Tizen.NUI.Components.CheckBox" LottieUrl="NUIResourcePath nui_wearable_checkbox_icon.json">
+    <cx:LottieButtonStyle.PlayRange>
+      <Selector x:TypeArguments="LottieFrameInfo" Selected="19, 36" Normal="0, 18"/>
+    </cx:LottieButtonStyle.PlayRange>
+    <cx:LottieButtonStyle.Opacity>
+      <Selector x:TypeArguments="x:Single?" Other="1" Pressed="0.6" Disabled="0.3"/>
+    </cx:LottieButtonStyle.Opacity>
+  </cx:LottieButtonStyle>
+
+  <!--RadioButton-->
+  <cx:LottieButtonStyle x:Key="Tizen.NUI.Components.RadioButton" LottieUrl="NUIResourcePath nui_wearable_radiobutton_icon.json">
+    <cx:LottieButtonStyle.PlayRange>
+      <Selector x:TypeArguments="LottieFrameInfo" Selected="0, 12" Normal="13, 25"/>
+    </cx:LottieButtonStyle.PlayRange>
+    <cx:LottieButtonStyle.Opacity>
+      <Selector x:TypeArguments="x:Single?" Other="1" Pressed="0.6" Disabled="0.3"/>
+    </cx:LottieButtonStyle.Opacity>
+  </cx:LottieButtonStyle>
+
+  <!--Switch-->
+  <cx:LottieButtonStyle x:Key="Tizen.NUI.Components.Switch" LottieUrl="NUIResourcePath nui_wearable_switch_icon.json">
+    <cx:LottieButtonStyle.PlayRange>
+      <Selector x:TypeArguments="LottieFrameInfo" Selected="0, 18" Normal="19, 36"/>
+    </cx:LottieButtonStyle.PlayRange>
+    <cx:LottieButtonStyle.Opacity>
+      <Selector x:TypeArguments="x:Single?" Other="1" Pressed="0.6" Disabled="0.3"/>
+    </cx:LottieButtonStyle.Opacity>
+  </cx:LottieButtonStyle>
+
+  <!--Loading-->
+  <c:LoadingStyle x:Key="Tizen.NUI.Components.Loading" LoadingSize="360, 360" />
+
+</Theme>
\ No newline at end of file
index 61dc58c..28d46df 100755 (executable)
   </ItemGroup>
 
   <ItemGroup>
-    <None Update="res\*.json">
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </None>
-    <None Update="res\*.png">
+    <None Update="res\**">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
     </None>
   </ItemGroup>
diff --git a/src/Tizen.NUI.Wearable/res/Theme/Tizen.NUI.Wearable_Tizen.NUI.Theme.Common.xaml b/src/Tizen.NUI.Wearable/res/Theme/Tizen.NUI.Wearable_Tizen.NUI.Theme.Common.xaml
new file mode 100644 (file)
index 0000000..bf14f12
--- /dev/null
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Theme
+  xmlns="http://tizen.org/Tizen.NUI/2018/XAML"
+  xmlns:c="clr-namespace:Tizen.NUI.Components;assembly=Tizen.NUI.Components"
+  xmlns:w="clr-namespace:Tizen.NUI.Wearable;assembly=Tizen.NUI.Wearable"
+  xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
+  Id="Tizen.NUI.Theme.Common" >
+    
+    <!--CircularPagination-->
+    <w:CircularPaginationStyle x:Key="Tizen.NUI.Wearable.CircularPagination" IndicatorSize="10, 10">
+      <w:CircularPaginationStyle.IndicatorImageURL>
+        <Selector x:TypeArguments="x:String" Normal="{NUIResourcePath nui_component_default_pagination_normal_dot.png}" Selected="{NUIResourcePath nui_component_default_pagination_focus_dot.png}" />
+      </w:CircularPaginationStyle.IndicatorImageURL>
+      <w:CircularPaginationStyle.CenterIndicatorImageURL>
+        <Selector x:TypeArguments="x:String" Normal="{NUIResourcePath nui_wearable_circular_pagination_center_normal_dot.png}" Selected="{NUIResourcePath nui_wearable_circular_pagination_center_focus_dot.png}" />
+      </w:CircularPaginationStyle.CenterIndicatorImageURL>
+    </w:CircularPaginationStyle>
+
+    <!--CircularProgress-->
+    <w:CircularProgressStyle x:Key="Tizen.NUI.Wearable.CircularProgress" Thickness="6" MaxValue="100" MinValue="0" CurrentValue="0" TrackColor="0, 0.16, 0.3, 1" ProgressColor="0, 0.55, 1, 1" />
+
+    <!--CircularScrollbar-->
+    <w:CircularScrollbarStyle x:Key="Tizen.NUI.Wearable.CircularScrollbar" Thickness="10" TrackSweepAngle="60" TrackColor="1, 1, 1, 0.15" ThumbColor="0.6, 0.6, 0.6, 1" />
+
+    <!--CircularSlider-->
+    <w:CircularSliderStyle x:Key="Tizen.NUI.Wearable.CircularSlider" Thickness="6" MaxValue="100" MinValue="0" CurrentValue="0" TrackColor="0, 0.16, 0.3, 1" ProgressColor="0, 0.55, 1, 1" ThumbSize="19, 19" ThumbColor="0, 0.55, 1, 1"/>
+
+</Theme>
\ No newline at end of file
index 8402209..61873ae 100755 (executable)
@@ -166,7 +166,7 @@ namespace Tizen.NUI.Wearable
         /// User can set its size.
         /// </summary>
         [EditorBrowsable(EditorBrowsableState.Never)]
-        public CircularProgress() : base(new CircularProgressStyle())
+        public CircularProgress() : base()
         {
             Initialize();
         }
index abb046f..6bb32a1 100644 (file)
@@ -107,7 +107,7 @@ namespace Tizen.NUI.Wearable
         /// <summary>
         /// Create an empty CircularScrollbar.
         /// </summary>
-        public CircularScrollbar() : base(new CircularScrollbarStyle())
+        public CircularScrollbar() : base()
         {
         }
 
@@ -119,7 +119,7 @@ namespace Tizen.NUI.Wearable
         /// <param name="currentPosition">The current position of the viewport in scrollable content area. This is the viewport's top position if the scroller is vertical, otherwise, left.</param>
         /// <param name="isHorizontal">Whether the direction of scrolling is horizontal or not. It is vertical by default.</param>
         [EditorBrowsable(EditorBrowsableState.Never)]
-        public CircularScrollbar(float contentLength, float viewportLength, float currentPosition, bool isHorizontal = false) : base(new CircularScrollbarStyle())
+        public CircularScrollbar(float contentLength, float viewportLength, float currentPosition, bool isHorizontal = false) : base()
         {
             Initialize(contentLength, viewportLength, currentPosition, isHorizontal);
         }
@@ -381,6 +381,17 @@ namespace Tizen.NUI.Wearable
 
         /// <inheritdoc/>
         [EditorBrowsable(EditorBrowsableState.Never)]
+        public override void ApplyStyle(ViewStyle viewStyle)
+        {
+            if (viewStyle == null) return;
+            if (viewStyle.WidthResizePolicy == null) viewStyle.WidthResizePolicy = ResizePolicyType.FillToParent;
+            if (viewStyle.HeightResizePolicy == null) viewStyle.HeightResizePolicy = ResizePolicyType.FillToParent;
+
+            base.ApplyStyle(viewStyle);
+        }
+
+        /// <inheritdoc/>
+        [EditorBrowsable(EditorBrowsableState.Never)]
         protected override ViewStyle CreateViewStyle()
         {
             return new CircularScrollbarStyle();
index 792ff52..5a1c7f1 100755 (executable)
@@ -218,7 +218,7 @@ namespace Tizen.NUI.Wearable
         /// The constructor of CircularSlider.
         /// </summary>
         [EditorBrowsable(EditorBrowsableState.Never)]
-        public CircularSlider() : base(new CircularSliderStyle())
+        public CircularSlider() : base()
         {
             Initialize();
         }
index 48ee21c..dc86666 100755 (executable)
@@ -437,7 +437,7 @@ namespace Tizen.NUI.Wearable
 
         private void initialize()
         {
-            popupStyle = Style as PopupStyle;
+            popupStyle = ViewStyle as PopupStyle;
             if (popupStyle == null)
             {
                 throw new Exception("Popup style is null.");
index 5528c92..7a3d8a5 100755 (executable)
@@ -29,6 +29,43 @@ namespace Tizen.NUI.Wearable
     [EditorBrowsable(EditorBrowsableState.Never)]
     public class CircularPaginationStyle : ControlStyle
     {
+        /// <summary>The IndicatorSize bindable property.</summary>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public static readonly BindableProperty IndicatorSizeProperty = BindableProperty.Create(nameof(IndicatorSize), typeof(Size), typeof(CircularPaginationStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
+        {
+            ((CircularPaginationStyle)bindable).indicatorSize = newValue == null ? null : new Size((Size)newValue);
+        },
+        defaultValueCreator: (bindable) =>
+        {
+            return ((CircularPaginationStyle)bindable).indicatorSize;
+        });
+
+        /// <summary>The IndicatorImageUrlSelector bindable property.</summary>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public static readonly BindableProperty IndicatorImageUrlSelectorProperty = BindableProperty.Create("IndicatorImageUrlSelector", typeof(Selector<string>), typeof(CircularPaginationStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
+        {
+            ((CircularPaginationStyle)bindable).indicatorImageUrl = ((Selector<string>)newValue)?.Clone();
+        },
+        defaultValueCreator: (bindable) =>
+        {
+            return ((CircularPaginationStyle)bindable).indicatorImageUrl;
+        });
+
+        /// <summary>The CenterIndicatorImageUrlSelector bindable property.</summary>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public static readonly BindableProperty CenterIndicatorImageUrlSelectorProperty = BindableProperty.Create("CenterIndicatorImageUrlSelector", typeof(Selector<string>), typeof(CircularPaginationStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
+        {
+            ((CircularPaginationStyle)bindable).centerIndicatorImageUrl = ((Selector<string>)newValue)?.Clone();
+        },
+        defaultValueCreator: (bindable) =>
+        {
+            return ((CircularPaginationStyle)bindable).centerIndicatorImageUrl;
+        });
+
+        private Size indicatorSize;
+        private Selector<string> indicatorImageUrl;
+        private Selector<string> centerIndicatorImageUrl;
+
         static CircularPaginationStyle() { }
 
         /// <summary>
@@ -50,9 +87,6 @@ namespace Tizen.NUI.Wearable
         [EditorBrowsable(EditorBrowsableState.Never)]
         public CircularPaginationStyle(CircularPaginationStyle style) : base(style)
         {
-            if (null == style) return;
-
-            this.CopyFrom(style);
         }
 
         /// <summary>
@@ -61,7 +95,11 @@ namespace Tizen.NUI.Wearable
         /// <since_tizen> 8 </since_tizen>
         /// 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 Size IndicatorSize { get; set; }
+        public Size IndicatorSize
+        {
+            get => (Size)GetValue(IndicatorSizeProperty);
+            set => SetValue(IndicatorSizeProperty, value);
+        }
 
         /// <summary>
         /// Gets or sets the resource of indicator.
@@ -69,7 +107,11 @@ namespace Tizen.NUI.Wearable
         /// <since_tizen> 8 </since_tizen>
         /// 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<string> IndicatorImageURL { get; set; } = new Selector<string>();
+        public Selector<string> IndicatorImageURL
+        {
+            get => (Selector<string>)GetValue(IndicatorImageUrlSelectorProperty);
+            set => SetValue(IndicatorImageUrlSelectorProperty, value);
+        }
 
         /// <summary>
         /// Gets or sets the resource of the center indicator.
@@ -77,34 +119,10 @@ namespace Tizen.NUI.Wearable
         /// <since_tizen> 8 </since_tizen>
         /// 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<string> CenterIndicatorImageURL { get; set; } = new Selector<string>();
-
-        /// <summary>
-        /// Retrieves a copy of CircularPaginationStyle.
-        /// </summary>
-        /// <since_tizen> 8 </since_tizen>
-        /// 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 override void CopyFrom(BindableObject bindableObject)
+        public Selector<string> CenterIndicatorImageURL
         {
-            base.CopyFrom(bindableObject);
-
-            CircularPaginationStyle circularPaginationStyle = bindableObject as CircularPaginationStyle;
-            if (null != circularPaginationStyle)
-            {
-                if (null != circularPaginationStyle.IndicatorSize)
-                {
-                    IndicatorSize = new Size(circularPaginationStyle.IndicatorSize.Width, circularPaginationStyle.IndicatorSize.Height);
-                }
-                if (null != circularPaginationStyle.IndicatorImageURL)
-                {
-                    IndicatorImageURL?.Clone(circularPaginationStyle.IndicatorImageURL);
-                }
-                if (null != circularPaginationStyle.CenterIndicatorImageURL)
-                {
-                    CenterIndicatorImageURL?.Clone(circularPaginationStyle.CenterIndicatorImageURL);
-                }
-            }
+            get => (Selector<string>)GetValue(CenterIndicatorImageUrlSelectorProperty);
+            set => SetValue(CenterIndicatorImageUrlSelectorProperty, value);
         }
 
         private void Initialize()
@@ -112,13 +130,13 @@ namespace Tizen.NUI.Wearable
             IndicatorSize = new Size(10, 10);
             IndicatorImageURL = new Selector<string>()
             {
-                Normal = "/usr/share/dotnet.tizen/framework/res/" + "nui_component_default_pagination_normal_dot.png",
-                Selected = "/usr/share/dotnet.tizen/framework/res/" + "nui_component_default_pagination_focus_dot.png",
+                Normal = Tizen.NUI.StyleManager.FrameworkResourcePath + "nui_component_default_pagination_normal_dot.png",
+                Selected = Tizen.NUI.StyleManager.FrameworkResourcePath + "nui_component_default_pagination_focus_dot.png",
             };
             CenterIndicatorImageURL = new Selector<string>()
             {
-                Normal = "/usr/share/dotnet.tizen/framework/res/" + "nui_wearable_circular_pagination_center_normal_dot.png",
-                Selected = "/usr/share/dotnet.tizen/framework/res/" + "nui_wearable_circular_pagination_center_focus_dot.png",
+                Normal = Tizen.NUI.StyleManager.FrameworkResourcePath + "nui_wearable_circular_pagination_center_normal_dot.png",
+                Selected = Tizen.NUI.StyleManager.FrameworkResourcePath + "nui_wearable_circular_pagination_center_focus_dot.png",
             };
         }
     }
index d89c1d0..05aef8e 100755 (executable)
@@ -75,7 +75,7 @@ namespace Tizen.NUI.Wearable
         [EditorBrowsable(EditorBrowsableState.Never)]
         public static readonly BindableProperty TrackColorProperty = BindableProperty.Create(nameof(TrackColor), typeof(Color), typeof(CircularProgressStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
         {
-            ((CircularProgressStyle)bindable).trackColor = (Color)newValue;
+            ((CircularProgressStyle)bindable).trackColor = newValue == null ? null : new Color((Color)newValue);
         },
         defaultValueCreator: (bindable) =>
         {
@@ -86,7 +86,7 @@ namespace Tizen.NUI.Wearable
         [EditorBrowsable(EditorBrowsableState.Never)]
         public static readonly BindableProperty ProgressColorProperty = BindableProperty.Create(nameof(ProgressColor), typeof(Color), typeof(CircularProgressStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
         {
-            ((CircularProgressStyle)bindable).progressColor = (Color)newValue;
+            ((CircularProgressStyle)bindable).progressColor = newValue == null ? null : new Color((Color)newValue);
         },
         defaultValueCreator: (bindable) =>
         {
@@ -130,8 +130,6 @@ namespace Tizen.NUI.Wearable
         [EditorBrowsable(EditorBrowsableState.Never)]
         public CircularProgressStyle(CircularProgressStyle style) : base(style)
         {
-            if (null == style) return;
-            this.CopyFrom(style);
         }
 
         /// <summary>
@@ -247,29 +245,6 @@ namespace Tizen.NUI.Wearable
         }
 
         /// <summary>
-        /// Style's clone function.
-        /// </summary>
-        /// <param name="bindableObject">The style that need to copy.</param>
-        [EditorBrowsable(EditorBrowsableState.Never)]
-        public override void CopyFrom(BindableObject bindableObject)
-        {
-            base.CopyFrom(bindableObject);
-
-            CircularProgressStyle progressStyle = bindableObject as CircularProgressStyle;
-
-            if (null != progressStyle)
-            {
-                isEnabled = progressStyle.isEnabled;
-                thickness = progressStyle.Thickness;
-                maxValue = progressStyle.maxValue;
-                minValue = progressStyle.minValue;
-                currentValue = progressStyle.currentValue;
-                trackColor = progressStyle.trackColor;
-                progressColor = progressStyle.progressColor;
-            }
-        }
-
-        /// <summary>
         /// Dispose CircularProgressStyle and all children on it.
         /// </summary>
         /// <param name="type">Dispose type.</param>
index 218ff48..6c63231 100644 (file)
@@ -54,7 +54,7 @@ namespace Tizen.NUI.Wearable
         [EditorBrowsable(EditorBrowsableState.Never)]
         public static readonly BindableProperty TrackColorProperty = BindableProperty.Create(nameof(TrackColor), typeof(Color), typeof(CircularScrollbarStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
         {
-            ((CircularScrollbarStyle)bindable).trackColor = (Color)newValue;
+            ((CircularScrollbarStyle)bindable).trackColor = newValue == null ? null : new Color((Color)newValue);
         },
         defaultValueCreator: (bindable) =>
         {
@@ -65,7 +65,7 @@ namespace Tizen.NUI.Wearable
         [EditorBrowsable(EditorBrowsableState.Never)]
         public static readonly BindableProperty ThumbColorProperty = BindableProperty.Create(nameof(ThumbColor), typeof(Color), typeof(CircularScrollbarStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
         {
-            ((CircularScrollbarStyle)bindable).thumbColor = (Color)newValue;
+            ((CircularScrollbarStyle)bindable).thumbColor = newValue == null ? null : new Color((Color)newValue);
         },
         defaultValueCreator: (bindable) =>
         {
@@ -88,7 +88,6 @@ namespace Tizen.NUI.Wearable
         [EditorBrowsable(EditorBrowsableState.Never)]
         public CircularScrollbarStyle() : base()
         {
-            Initialize();
         }
 
         /// <summary>
@@ -98,7 +97,6 @@ namespace Tizen.NUI.Wearable
         [EditorBrowsable(EditorBrowsableState.Never)]
         public CircularScrollbarStyle(CircularScrollbarStyle style) : base(style)
         {
-            this.CopyFrom(style);
         }
 
         /// <summary>
@@ -158,37 +156,5 @@ namespace Tizen.NUI.Wearable
         }
 
         #endregion Properties
-
-
-        #region Methods
-
-        /// <inheritdoc/>
-        [EditorBrowsable(EditorBrowsableState.Never)]
-        public override void CopyFrom(BindableObject bindableObject)
-        {
-            base.CopyFrom(bindableObject);
-
-            var style = bindableObject as CircularScrollbarStyle;
-
-            if (null != style)
-            {
-                Thickness = style.Thickness;
-                TrackSweepAngle = style.TrackSweepAngle;
-                TrackColor = style.TrackColor;
-                ThumbColor = style.ThumbColor;
-            }
-        }
-
-        private void Initialize()
-        {
-            Thickness = 10.0f;
-            TrackSweepAngle = 60.0f;
-            TrackColor = new Color(1.0f, 1.0f, 1.0f, 0.15f);
-            ThumbColor = new Color(0.6f, 0.6f, 0.6f, 1.0f);
-            WidthResizePolicy = ResizePolicyType.FillToParent;
-            HeightResizePolicy = ResizePolicyType.FillToParent;
-        }
-
-        #endregion Methods
     }
 }
index cecf80b..eae2cc6 100755 (executable)
@@ -75,7 +75,7 @@ namespace Tizen.NUI.Wearable
         [EditorBrowsable(EditorBrowsableState.Never)]
         public static readonly BindableProperty TrackColorProperty = BindableProperty.Create(nameof(TrackColor), typeof(Color), typeof(CircularSliderStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
         {
-            ((CircularSliderStyle)bindable).trackColor = (Color)newValue;
+            ((CircularSliderStyle)bindable).trackColor = newValue == null ? null : new Color((Color)newValue);
         },
         defaultValueCreator: (bindable) =>
         {
@@ -86,7 +86,7 @@ namespace Tizen.NUI.Wearable
         [EditorBrowsable(EditorBrowsableState.Never)]
         public static readonly BindableProperty ProgressColorProperty = BindableProperty.Create(nameof(ProgressColor), typeof(Color), typeof(CircularSliderStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
         {
-            ((CircularSliderStyle)bindable).progressColor = (Color)newValue;
+            ((CircularSliderStyle)bindable).progressColor = newValue == null ? null : new Color((Color)newValue);
         },
         defaultValueCreator: (bindable) =>
         {
@@ -108,7 +108,7 @@ namespace Tizen.NUI.Wearable
         [EditorBrowsable(EditorBrowsableState.Never)]
         public static readonly BindableProperty ThumbColorProperty = BindableProperty.Create(nameof(ThumbColor), typeof(Color), typeof(CircularSliderStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
         {
-            ((CircularSliderStyle)bindable).thumbColor = (Color)newValue;
+            ((CircularSliderStyle)bindable).thumbColor = newValue == null ? null : new Color((Color)newValue);
         },
         defaultValueCreator: (bindable) =>
         {
@@ -154,8 +154,6 @@ namespace Tizen.NUI.Wearable
         [EditorBrowsable(EditorBrowsableState.Never)]
         public CircularSliderStyle(CircularSliderStyle style) : base(style)
         {
-            if (null == style) return;
-            this.CopyFrom(style);
         }
 
         /// <summary>
@@ -302,31 +300,6 @@ namespace Tizen.NUI.Wearable
             }
         }
 
-        /// <summary>
-        /// Style's clone function.
-        /// </summary>
-        /// <param name="bindableObject">The style that need to copy.</param>
-        [EditorBrowsable(EditorBrowsableState.Never)]
-        public override void CopyFrom(BindableObject bindableObject)
-        {
-            base.CopyFrom(bindableObject);
-
-            CircularSliderStyle progressStyle = bindableObject as CircularSliderStyle;
-
-            if (null != progressStyle)
-            {
-                isEnabled = progressStyle.isEnabled;
-                thickness = progressStyle.Thickness;
-                maxValue = progressStyle.maxValue;
-                minValue = progressStyle.minValue;
-                currentValue = progressStyle.currentValue;
-                trackColor = progressStyle.trackColor;
-                progressColor = progressStyle.progressColor;
-                thumbSize = progressStyle.thumbSize;
-                thumbColor = progressStyle.thumbColor;
-            }
-        }
-
         private void Initialize()
         {
             isEnabled = true;
index 8f909af..90efa80 100755 (executable)
@@ -15,7 +15,6 @@
  *
  */
 using System.ComponentModel;
-using Tizen.NUI.BaseComponents;
 using Tizen.NUI.Binding;
 using Tizen.NUI.Components;
 
@@ -27,6 +26,19 @@ namespace Tizen.NUI.Wearable
     [EditorBrowsable(EditorBrowsableState.Never)]
     public class PopupStyle : ControlStyle
     {
+        /// <summary>Bindable property of WrapContent</summary>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public static readonly BindableProperty WrapContentProperty = BindableProperty.Create(nameof(WrapContent), typeof(bool?), typeof(PopupStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
+        {
+            ((PopupStyle)bindable).wrapContent = (bool?)newValue;
+        },
+        defaultValueCreator: (bindable) =>
+        {
+            return ((PopupStyle)bindable).wrapContent;
+        });
+
+        private bool? wrapContent;
+
         static PopupStyle() { }
 
         /// <summary>
@@ -44,12 +56,6 @@ namespace Tizen.NUI.Wearable
         [EditorBrowsable(EditorBrowsableState.Never)]
         public PopupStyle(PopupStyle style) : base(style)
         {
-            if (null == style)
-            {
-                return;
-            }
-            initSubStyle();
-            CopyFrom(style);
         }
 
         /// <summary>
@@ -58,26 +64,8 @@ namespace Tizen.NUI.Wearable
         [EditorBrowsable(EditorBrowsableState.Never)]
         public bool? WrapContent
         {
-            get;
-            set;
-        }
-
-        /// <summary>
-        /// Retrieves a copy of PopupStyle.
-        /// </summary>
-        [EditorBrowsable(EditorBrowsableState.Never)]
-        public override void CopyFrom(BindableObject bindableObject)
-        {
-            base.CopyFrom(bindableObject);
-
-            PopupStyle popupStyle = bindableObject as PopupStyle;
-            if (null != popupStyle)
-            {
-                if (null != popupStyle.WrapContent)
-                {
-                    WrapContent = popupStyle.WrapContent;
-                }
-            }
+            get => (bool?)GetValue(WrapContentProperty);
+            set => SetValue(WrapContentProperty, value);            
         }
 
         private void initSubStyle()
index bcffc90..212e21f 100644 (file)
     </ItemGroup>
   </Target>
 
+  <ItemGroup>
+    <None Update="res\**">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </None>
+  </ItemGroup>
+
 </Project>
\ No newline at end of file
diff --git a/src/Tizen.NUI/res/Theme/Tizen.NUI_Tizen.NUI.Theme.Common.xaml b/src/Tizen.NUI/res/Theme/Tizen.NUI_Tizen.NUI.Theme.Common.xaml
new file mode 100644 (file)
index 0000000..96c19cd
--- /dev/null
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Theme xmlns="http://tizen.org/Tizen.NUI/2018/XAML" Id="Tizen.NUI.Theme.Common" >
+</Theme>
\ No newline at end of file
diff --git a/src/Tizen.NUI/res/Theme/Tizen.NUI_Tizen.NUI.Theme.Wearable.xaml b/src/Tizen.NUI/res/Theme/Tizen.NUI_Tizen.NUI.Theme.Wearable.xaml
new file mode 100644 (file)
index 0000000..cc5dd43
--- /dev/null
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Theme
+  xmlns="http://tizen.org/Tizen.NUI/2018/XAML"
+  Id="Tizen.NUI.Theme.Wearable"
+  BasedOn="Tizen.NUI.Theme.Common">
+</Theme>
\ No newline at end of file
index 5b43fd2..15315c3 100755 (executable)
@@ -120,6 +120,17 @@ namespace Tizen.NUI.Xaml
                 //ResourceDictionary
                 if (xpe == null && TryAddToResourceDictionary(source as ResourceDictionary, value, xKey, node, out xpe))
                     return;
+                
+                // Dictionary with string key
+                if (xpe == null && xKey != null)
+                {
+                    var indexer = GetIndexer(source, typeof(string), value.GetType());
+                    if (indexer != null)
+                    {
+                        indexer.SetValue(source, value, new[] { xKey });
+                        return;
+                    }
+                }
 
                 // Collection element, implicit content, or implicit collection element.
                 if (xpe == null && typeof(IEnumerable).IsAssignableFrom(Context.Types[parentElement]) && Context.Types[parentElement].GetRuntimeMethods().Any(mi => mi.Name == "Add" && mi.GetParameters().Length == 1)) {
@@ -145,7 +156,7 @@ namespace Tizen.NUI.Xaml
 
                     SetPropertyValue(source, name, value, Context.RootElement, node, Context, node);
                     return;
-                }
+                }                
                 
                 xpe = xpe ?? new XamlParseException($"Can not set the content of {((IElementNode)parentNode).XmlType.Name} as it doesn't have a ContentPropertyAttribute", node);
                 if (Context.ExceptionHandler != null)
@@ -745,5 +756,7 @@ namespace Tizen.NUI.Xaml
             SetPropertyValue(source, new XmlName("", runTimeName.Name), value, Context.RootElement, node, Context, node);
             return true;
         }
+
+        private PropertyInfo GetIndexer(object source, Type keyType, Type valueType) => source.GetType().GetProperties(BindingFlags.Instance|BindingFlags.Public|BindingFlags.NonPublic).FirstOrDefault(p => p.Name == "Item" && p.PropertyType.IsAssignableFrom(valueType) && p.GetIndexParameters().Length != 0 && p.GetIndexParameters()[0].ParameterType == keyType);
     }
 }
index 5c26374..faae3b2 100755 (executable)
@@ -132,6 +132,14 @@ namespace Tizen.NUI.Xaml
             using (var textReader = new StringReader(xaml))
             using (var reader = XmlReader.Create(textReader))
             {
+                Load(view, reader);
+            }
+        }
+
+        public static void Load(object view, XmlReader reader)
+        {
+            if (reader != null)
+            {
                 while (reader.Read())
                 {
                     //Skip until element
@@ -171,6 +179,16 @@ namespace Tizen.NUI.Xaml
             using (var textreader = new StringReader(xaml))
             using (var reader = XmlReader.Create(textreader))
             {
+                inflatedView = Create(reader, doNotThrow);
+            }
+            return inflatedView;
+        }
+
+        public static object Create(XmlReader reader, bool doNotThrow = false)
+        {
+            object inflatedView = null;
+            if (reader != null)
+            {
                 while (reader.Read())
                 {
                     //Skip until element
index 183d61e..cc64340 100755 (executable)
@@ -407,7 +407,12 @@ namespace Tizen.NUI.Xaml
             }
 
             if (type == null)
-                exception = new XamlParseException($"Type {elementName} not found in xmlns {namespaceURI}", xmlInfo);
+            {
+                var message = $"Type {elementName} not found in xmlns {namespaceURI}\n";
+                message += "\n  - Make sure the all used assemblies (e.g. Tizen.NUI.Components) are included in the application project.";
+                message += "\n  - Make sure the type and namespace are correct.\n";
+                exception = new XamlParseException($"message", xmlInfo);
+            }
 
             return type;
         }
index 48195e6..2c465ec 100755 (executable)
@@ -21,6 +21,10 @@ namespace Tizen.NUI.Binding
                                        ushort.Parse(parts[2].Trim(), CultureInfo.InvariantCulture), 
                                        ushort.Parse(parts[3].Trim(), CultureInfo.InvariantCulture));
                 }
+                else if (parts.Length == 1)
+                {
+                    return new Extents(ushort.Parse(parts[0].Trim(), CultureInfo.InvariantCulture));
+                }
             }
 
             throw new InvalidOperationException($"Cannot convert \"{value}\" into {typeof(Extents)}");
index 1bb9623..2885ae7 100644 (file)
@@ -164,7 +164,7 @@ namespace Tizen.NUI.BaseComponents
             var imageView = (ImageView)bindable;
             if(newValue != null)
             {
-                imageView._border = (Rectangle)newValue;
+                imageView._border = new Rectangle((Rectangle)newValue);
                 imageView.UpdateImage(NpatchImageVisualProperty.Border, new PropertyValue(imageView._border));
             }
         },
@@ -346,7 +346,7 @@ namespace Tizen.NUI.BaseComponents
             }
         }
 
-        internal ImageView(global::System.IntPtr cPtr, bool cMemoryOwn, bool shown = true) : base(Interop.ImageView.ImageView_SWIGUpcast(cPtr), cMemoryOwn)
+        internal ImageView(global::System.IntPtr cPtr, bool cMemoryOwn, bool shown = true) : base(Interop.ImageView.ImageView_SWIGUpcast(cPtr), cMemoryOwn, null)
         {
             if (!shown)
             {
index 7e9ebb3..82aabb3 100755 (executable)
@@ -835,7 +835,7 @@ namespace Tizen.NUI.BaseComponents
     /// A class containing frame informations for a LottieAnimationView.
     /// </summary>
     [EditorBrowsable(EditorBrowsableState.Never)]
-    public class LottieFrameInfo
+    public class LottieFrameInfo : ICloneable
     {
         /// <summary>
         /// Creates a new instance with a playing range.
@@ -874,6 +874,31 @@ namespace Tizen.NUI.BaseComponents
         }
 
         /// <summary>
+        /// Create a new instance from string.
+        /// Possible input : "0, 10", "10"
+        /// </summary>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public static implicit operator LottieFrameInfo(string pair)
+        {
+            if (pair == null)
+            {
+                return null;
+            }
+
+            string[] parts = pair.Split(',');
+            if (parts.Length == 1)
+            {
+                return new LottieFrameInfo(Int32.Parse(parts[0].Trim()));
+            }
+            else if (parts.Length == 2)
+            {
+                return new LottieFrameInfo(Int32.Parse(parts[0].Trim()), Int32.Parse(parts[1].Trim()));
+            }
+
+            throw new InvalidCastException($"Can not convert string {pair} to LottieFrameInfo");
+        }
+
+        /// <summary>
         /// The start frame of the lottie animation.
         /// </summary>
         [EditorBrowsable(EditorBrowsableState.Never)]
@@ -940,6 +965,10 @@ namespace Tizen.NUI.BaseComponents
             }
         }
 
+        /// <inheritdoc/>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public object Clone() => new LottieFrameInfo(StartFrame, EndFrame);
+
         private bool BeReadyToShow(LottieAnimationView lottieView)
         {
             // Validate input lottieView
index d3f24ef..43c7d1e 100755 (executable)
@@ -126,7 +126,7 @@ namespace Tizen.NUI.BaseComponents
         /// Create an empty instance.
         /// </summary>
         [EditorBrowsable(EditorBrowsableState.Never)]
-        public ImageViewStyle()
+        public ImageViewStyle() : base()
         {
         }
 
index 118aa74..4d92571 100755 (executable)
@@ -25,12 +25,13 @@ namespace Tizen.NUI.BaseComponents
     /// <summary>
     /// Selector class, which is related by Control State, it is base class for other Selector.
     /// </summary>
+    /// <typeparam name="T">The property type of the selector. if it's reference type, it should be of type <see cref="ICloneable"/> that implement deep copy in <see cref="ICloneable.Clone"/>.</typeparam>
     /// <since_tizen> 6 </since_tizen>
     /// 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 class Selector<T>
     {
-        private readonly bool cloneable = typeof(T).IsAssignableFrom(typeof(ICloneable));
+        private readonly bool cloneable = typeof(ICloneable).IsAssignableFrom(typeof(T));
 
         /// <summary>
         /// The list for adding state-value pair.
@@ -80,7 +81,6 @@ namespace Tizen.NUI.BaseComponents
             Clone(value);
         }
 
-
         /// <summary>
         /// All State.
         /// </summary>
index ea27493..d969960 100755 (executable)
@@ -530,7 +530,7 @@ namespace Tizen.NUI.BaseComponents
         /// Create an empty instance.
         /// </summary>
         [EditorBrowsable(EditorBrowsableState.Never)]
-        public TextFieldStyle()
+        public TextFieldStyle() : base()
         {
         }
 
index ef3d298..b2bd019 100755 (executable)
@@ -323,7 +323,7 @@ namespace Tizen.NUI.BaseComponents
         /// Create an empty instance.
         /// </summary>
         [EditorBrowsable(EditorBrowsableState.Never)]
-        public TextLabelStyle()
+        public TextLabelStyle() : base()
         {
         }
 
index 4a48c17..97c56a6 100755 (executable)
@@ -76,6 +76,7 @@ namespace Tizen.NUI.BaseComponents
         private Extents margin;
         private float? weight;
         private bool? enableControlState;
+        private bool? themeChangeSensitive;
 
         private Selector<ImageShadow> imageShadow;
         private Selector<Shadow> boxShadow;
@@ -105,10 +106,7 @@ namespace Tizen.NUI.BaseComponents
         [EditorBrowsable(EditorBrowsableState.Never)]
         public ViewStyle(ViewStyle viewAttributes)
         {
-            if (null != viewAttributes)
-            {
-                this.CopyFrom(viewAttributes);
-            }
+            CopyFrom(viewAttributes);
         }
 
         /// <summary>
@@ -700,6 +698,27 @@ namespace Tizen.NUI.BaseComponents
         }
 
         /// <summary>
+        /// The ThemeChangeSensitive value of the View.
+        /// </summary>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public bool? ThemeChangeSensitive
+        {
+            get => (bool?)GetValue(ThemeChangeSensitiveProperty);
+            set => SetValue(ThemeChangeSensitiveProperty, value);
+        }
+
+
+        /// <summary>
+        /// Allow null properties when merging it into other Theme.
+        /// If the value is true, the null properties reset target properties of the other ViewStyle with same key when merge.
+        /// It is used in <seealso cref="Theme.Merge(string)"/>, <seealso cref="Theme.Merge(Theme)"/>.
+        /// It is also used in <seealso cref="Theme.GetStyle(string)"/> when the Theme has a parent and needs to merge.
+        /// Please note that it is false by default.
+        /// </summary>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public bool SolidNull { get; set; } = false;
+
+        /// <summary>
         /// Set style's bindable properties from the view.
         /// </summary>
         /// <param name="view">The view that includes property data.</param>
@@ -724,12 +743,9 @@ namespace Tizen.NUI.BaseComponents
             }
         }
 
-        internal ViewStyle CreateInstance()
-        {
-            return (ViewStyle)Activator.CreateInstance(GetType());
-        }
-
-        internal ViewStyle Clone()
+        /// <summary>Create a cloned ViewStyle.</summary>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public ViewStyle Clone()
         {
             var cloned = CreateInstance();
             cloned.CopyFrom(this);
@@ -737,6 +753,20 @@ namespace Tizen.NUI.BaseComponents
             return cloned;
         }
 
+        /// <summary>Create a cloned ViewStyle.</summary>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public void Merge(ViewStyle other)
+        {
+            AllowNullCopy = other?.SolidNull ?? false;
+            CopyFrom(other);
+            AllowNullCopy = false;
+        }
+
+        internal ViewStyle CreateInstance()
+        {
+            return (ViewStyle)Activator.CreateInstance(GetType());
+        }
+
         private void OnPaddingChanged(ushort start, ushort end, ushort top, ushort bottom)
         {
             Padding = new Extents(start, end, top, bottom);
index 5146ba9..861577c 100755 (executable)
@@ -326,6 +326,7 @@ namespace Tizen.NUI.BaseComponents
             {
                 if (viewStyle.size == null)
                 {
+                    if ((float)newValue == 0) return;
                     viewStyle.size = new Size();
                 }
                 viewStyle.size.Width = (float)newValue;
@@ -344,6 +345,7 @@ namespace Tizen.NUI.BaseComponents
             {
                 if (viewStyle.size == null)
                 {
+                    if ((float)newValue == 0) return;
                     viewStyle.size = new Size();
                 }
                 viewStyle.size.Height = (float)newValue;
@@ -359,6 +361,10 @@ namespace Tizen.NUI.BaseComponents
         {
             var viewStyle = (ViewStyle)bindable;
             viewStyle.position = (Position)newValue;
+            if (viewStyle.position != null && viewStyle.position.X == 0 && viewStyle.position.Y == 0)
+            {
+                viewStyle.position = null;
+            }
         },
         defaultValueCreator: (bindable) =>
         {
@@ -374,6 +380,7 @@ namespace Tizen.NUI.BaseComponents
             {
                 if (viewStyle.position == null)
                 {
+                    if ((float)newValue == 0) return;
                     viewStyle.position = new Position();
                 }
                 viewStyle.position.X = (float)newValue;
@@ -392,6 +399,7 @@ namespace Tizen.NUI.BaseComponents
             {
                 if (viewStyle.position == null)
                 {
+                    if ((float)newValue == 0) return;
                     viewStyle.position = new Position();
                 }
                 viewStyle.position.Y = (float)newValue;
@@ -410,6 +418,7 @@ namespace Tizen.NUI.BaseComponents
             {
                 if (viewStyle.position == null)
                 {
+                    if ((float)newValue == 0) return;
                     viewStyle.position = new Position();
                 }
                 viewStyle.position.Z = (float)newValue;
@@ -437,6 +446,7 @@ namespace Tizen.NUI.BaseComponents
         {
             var viewStyle = (ViewStyle)bindable;
             viewStyle.scale = (Vector3)newValue;
+            if (viewStyle.scale != null && viewStyle.scale.X == 1.0f && viewStyle.scale.Y == 1.0f && viewStyle.scale.Z == 1.0f) return;
         },
         defaultValueCreator: (bindable) =>
         {
@@ -452,6 +462,7 @@ namespace Tizen.NUI.BaseComponents
             {
                 if (viewStyle.scale == null)
                 {
+                    if ((float)newValue == 1.0f) return;
                     viewStyle.scale = new Vector3();
                 }
                 viewStyle.scale.X = (float)newValue;
@@ -470,6 +481,7 @@ namespace Tizen.NUI.BaseComponents
             {
                 if (viewStyle.scale == null)
                 {
+                    if ((float)newValue == 1.0f) return;
                     viewStyle.scale = new Vector3();
                 }
                 viewStyle.scale.Y = (float)newValue;
@@ -488,6 +500,7 @@ namespace Tizen.NUI.BaseComponents
             {
                 if (viewStyle.scale == null)
                 {
+                    if ((float)newValue == 1.0f) return;
                     viewStyle.scale = new Vector3();
                 }
                 viewStyle.scale.Z = (float)newValue;
@@ -708,6 +721,10 @@ namespace Tizen.NUI.BaseComponents
         {
             var viewStyle = (ViewStyle)bindable;
             viewStyle.size = (Size)newValue;
+            if (viewStyle.size != null && viewStyle.size.Width == 0 && viewStyle.size.Height == 0)
+            {
+                viewStyle.size = null;
+            }
         },
         defaultValueCreator: (bindable) =>
         {
@@ -816,7 +833,11 @@ namespace Tizen.NUI.BaseComponents
             var viewStyle = (ViewStyle)bindable;
 
             viewStyle.imageShadow = ((Selector<ImageShadow>)newValue)?.Clone();
-            viewStyle.boxShadow = null;
+
+            if (viewStyle.imageShadow != null)
+            {
+                viewStyle.boxShadow = null;
+            }
         },
         defaultValueCreator: (bindable) =>
         {
@@ -831,7 +852,11 @@ namespace Tizen.NUI.BaseComponents
             var viewStyle = (ViewStyle)bindable;
 
             viewStyle.boxShadow = ((Selector<Shadow>)newValue)?.Clone();
-            viewStyle.imageShadow = null;
+
+            if (viewStyle.boxShadow != null)
+            {
+                viewStyle.imageShadow = null;
+            }
         },
         defaultValueCreator: (bindable) =>
         {
@@ -863,5 +888,18 @@ namespace Tizen.NUI.BaseComponents
         {
             return ((ViewStyle)bindable).enableControlState;
         });
+
+        /// <summary>
+        /// EnableControlState property
+        /// </summary>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public static readonly BindableProperty ThemeChangeSensitiveProperty = BindableProperty.Create("ThemeChangeSensitive", typeof(bool?), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
+        {
+            ((ViewStyle)bindable).themeChangeSensitive = (bool?)newValue;
+        },
+        defaultValueCreator: (bindable) =>
+        {
+            return ((ViewStyle)bindable).themeChangeSensitive;
+        });
     }
 }
index 2eb09c6..7dd7f94 100755 (executable)
@@ -82,7 +82,7 @@ namespace Tizen.NUI.BaseComponents
             }
         }
 
-        internal TextField(global::System.IntPtr cPtr, bool cMemoryOwn, bool shown = true) : base(Interop.TextField.TextField_SWIGUpcast(cPtr), cMemoryOwn)
+        internal TextField(global::System.IntPtr cPtr, bool cMemoryOwn, bool shown = true) : base(Interop.TextField.TextField_SWIGUpcast(cPtr), cMemoryOwn, null)
         {
             if (!shown)
             {
index 207b539..00f0939 100755 (executable)
@@ -163,7 +163,7 @@ namespace Tizen.NUI.BaseComponents
             }
         }
 
-        internal TextLabel(global::System.IntPtr cPtr, bool cMemoryOwn, bool shown = true) : base(Interop.TextLabel.TextLabel_SWIGUpcast(cPtr), cMemoryOwn)
+        internal TextLabel(global::System.IntPtr cPtr, bool cMemoryOwn, bool shown = true) : base(Interop.TextLabel.TextLabel_SWIGUpcast(cPtr), cMemoryOwn, null)
         {
             if (!shown)
             {
index 1e98532..23a00b6 100755 (executable)
@@ -61,6 +61,7 @@ namespace Tizen.NUI.BaseComponents
         private string[] transitionNames;
         private bool controlStatePropagation = false;
         private ViewStyle viewStyle;
+        private bool themeChangeSensitive = false;
 
         internal Size2D sizeSetExplicitly = new Size2D(); // Store size set by API, will be used in place of NaturalSize if not set.
         internal BackgroundExtraData backgroundExtraData;
@@ -93,9 +94,8 @@ namespace Tizen.NUI.BaseComponents
 
         /// This will be public opened in next release of tizen after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI).
         [EditorBrowsable(EditorBrowsableState.Never)]
-        public View(ViewStyle viewStyle) : this(Interop.View.View_New(), true)
+        public View(ViewStyle viewStyle) : this(Interop.View.View_New(), true, viewStyle)
         {
-            ApplyStyle((viewStyle == null) ? GetViewStyle() : viewStyle.Clone());
         }
 
         /// <summary>
@@ -123,7 +123,10 @@ namespace Tizen.NUI.BaseComponents
 
         internal View(global::System.IntPtr cPtr, bool cMemoryOwn, ViewStyle viewStyle, bool shown = true) : this(cPtr, cMemoryOwn, shown)
         {
-            ApplyStyle((viewStyle == null) ? GetViewStyle() : viewStyle.Clone());
+            if (!ThemeManager.ThemeApplied) return;
+
+            if (viewStyle == null) UpdateStyle(); // Use style in the current theme
+            else ApplyStyle(viewStyle.Clone());   // Use given style
         }
 
         internal View(global::System.IntPtr cPtr, bool cMemoryOwn, bool shown = true) : base(Interop.View.View_SWIGUpcast(cPtr), cMemoryOwn)
@@ -2325,6 +2328,17 @@ namespace Tizen.NUI.BaseComponents
         }
 
         /// <summary>
+        /// If the value is true, the View will change its style as the theme changes.
+        /// It is false by default, but turned to true when setting StyleName (by setting property or using specified constructor).
+        /// </summary>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public bool ThemeChangeSensitive
+        {
+            get => (bool)GetValue(ThemeChangeSensitiveProperty);
+            set => SetValue(ThemeChangeSensitiveProperty, value);
+        }
+
+        /// <summary>
         /// Get Style, it is abstract function and must be override.
         /// </summary>
         /// <since_tizen> 6 </since_tizen>
@@ -2354,6 +2368,14 @@ namespace Tizen.NUI.BaseComponents
         {
         }
 
+        /// <summary>
+        /// </summary>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        protected virtual void OnThemeChanged(object sender, ThemeChangedEventArgs e)
+        {
+            UpdateStyle();
+        }
+
         /// 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 virtual void ApplyStyle(ViewStyle viewStyle)
@@ -2378,7 +2400,7 @@ namespace Tizen.NUI.BaseComponents
                     BindableProperty viewProperty;
                     bindablePropertyOfView.TryGetValue(keyValuePair.Key, out viewProperty);
 
-                    if (null != viewProperty)
+                    if (null != viewProperty && viewProperty != StyleNameProperty)
                     {
                         object value = viewStyle.GetValue(keyValuePair.Value);
 
index c1fda12..62ae5b0 100755 (executable)
@@ -35,12 +35,20 @@ namespace Tizen.NUI.BaseComponents
             var view = (View)bindable;
             if (newValue != null)
             {
-                Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.STYLE_NAME, new Tizen.NUI.PropertyValue((string)newValue));
+                string styleName = (string)newValue;
+                Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.STYLE_NAME, new Tizen.NUI.PropertyValue(styleName));
+
+                view.styleName = styleName;
+                view.UpdateStyle();
+                view.ThemeChangeSensitive = true;
             }
         },
         defaultValueCreator: (bindable) =>
         {
             var view = (View)bindable;
+
+            if (!string.IsNullOrEmpty(view.styleName)) return view.styleName;
+
             string temp;
             Tizen.NUI.Object.GetProperty(view.swigCPtr, View.Property.STYLE_NAME).Get(out temp);
             return temp;
@@ -1600,11 +1608,38 @@ namespace Tizen.NUI.BaseComponents
             return ((View)bindable).enableControlState;
         });
 
+        /// <summary>
+        /// ThemeChangeSensitive property
+        /// </summary>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public static readonly BindableProperty ThemeChangeSensitiveProperty = BindableProperty.Create(nameof(ThemeChangeSensitive), typeof(bool), typeof(View), false, propertyChanged: (bindable, oldValue, newValue) =>
+        {
+            var view = (View)bindable;
+
+            if (view.themeChangeSensitive == (bool)newValue) return;
+
+            view.themeChangeSensitive = (bool)newValue;
+
+            if (view.themeChangeSensitive)
+            {
+                ThemeManager.ThemeChangedInternal += view.OnThemeChanged;
+            }
+            else
+            {
+                ThemeManager.ThemeChangedInternal -= view.OnThemeChanged;
+            }
+        },
+        defaultValueCreator: (bindable) =>
+        {
+            return ((View)bindable).themeChangeSensitive;
+        });
+
         #region Selectors
         internal static readonly BindableProperty BackgroundImageSelectorProperty = BindableProperty.Create("BackgroundImageSelector", typeof(Selector<string>), typeof(View), null, propertyChanged: (bindable, oldValue, newValue) =>
         {
             var view = (View)bindable;
             view.SelectorData.BackgroundImage.Update(view, (Selector<string>)newValue, true);
+            if (newValue != null) view.SelectorData.BackgroundColor.Reset(view);
         },
         defaultValueCreator: (bindable) =>
         {
@@ -1616,6 +1651,7 @@ namespace Tizen.NUI.BaseComponents
         {
             var view = (View)bindable;
             view.SelectorData.BackgroundColor.Update(view, (Selector<Color>)newValue, true);
+            if (newValue != null) view.SelectorData.BackgroundImage.Reset(view);
         },
         defaultValueCreator: (bindable) =>
         {
@@ -1664,6 +1700,7 @@ namespace Tizen.NUI.BaseComponents
         {
             var view = (View)bindable;
             view.SelectorData.ImageShadow.Update(view, (Selector<ImageShadow>)newValue, true);
+            if (newValue != null) view.SelectorData.BoxShadow.Reset(view);
         },
         defaultValueCreator: (bindable) =>
         {
@@ -1679,6 +1716,7 @@ namespace Tizen.NUI.BaseComponents
         {
             var view = (View)bindable;
             view.SelectorData.BoxShadow.Update(view, (Selector<Shadow>)newValue, true);
+            if (newValue != null) view.SelectorData.ImageShadow.Reset(view);
         },
         defaultValueCreator: (bindable) =>
         {
index 1e9c0f7..9df4a23 100755 (executable)
@@ -33,6 +33,7 @@ namespace Tizen.NUI.BaseComponents
     {
         private MergedStyle mergedStyle = null;
         private ViewSelectorData selectorData;
+        internal string styleName;
 
         internal MergedStyle _mergedStyle
         {
@@ -1051,6 +1052,15 @@ namespace Tizen.NUI.BaseComponents
             UpdateShadowCornerRadius(value);
         }
 
+        internal void UpdateStyle()
+        {
+            ViewStyle newStyle;
+            if (styleName == null) newStyle = ThemeManager.GetStyle(GetType());
+            else newStyle = ThemeManager.GetStyle(styleName);
+
+            if (newStyle != null && (viewStyle == null || viewStyle.GetType() == newStyle.GetType())) ApplyStyle(newStyle);
+        }
+
         /// <summary>
         /// you can override it to clean-up your own resources.
         /// </summary>
@@ -1071,6 +1081,10 @@ namespace Tizen.NUI.BaseComponents
                 //Release your own managed resources here.
                 //You should release all of your own disposable objects here.
                 selectorData?.Reset(this);
+                if (themeChangeSensitive)
+                {
+                    ThemeManager.ThemeChanged -= OnThemeChanged;
+                }
             }
 
             //Release your own unmanaged resources here.
index a9caff7..55a3596 100755 (executable)
@@ -26,7 +26,7 @@ namespace Tizen.NUI
     /// The Color class.
     /// </summary>
     [Tizen.NUI.Binding.TypeConverter(typeof(ColorTypeConverter))]
-    public class Color : Disposable
+    public class Color : Disposable, ICloneable
     {
         /// <summary>
         /// Gets the black colored Color class.
@@ -426,6 +426,10 @@ namespace Tizen.NUI
             return ret;
         }
 
+        /// <inheritdoc/>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public object Clone() => new Color(this);
+
         internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Color obj)
         {
             return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
index d2d05ae..828c09d 100755 (executable)
@@ -26,7 +26,7 @@ namespace Tizen.NUI
     /// </summary>
     /// <since_tizen> 4 </since_tizen>
     [Binding.TypeConverter(typeof(ExtentsTypeConverter))]
-    public class Extents : Disposable
+    public class Extents : Disposable, ICloneable
     {
 
 
@@ -240,6 +240,10 @@ namespace Tizen.NUI
             return ret;
         }
 
+        /// <inheritdoc/>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public object Clone() => new Extents(this);
+
         internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Extents obj)
         {
             return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
index dffa303..44b00b2 100755 (executable)
@@ -27,7 +27,7 @@ namespace Tizen.NUI
     /// </summary>
     /// <since_tizen> 3 </since_tizen>
     [Tizen.NUI.Binding.TypeConverter(typeof(PositionTypeConverter))]
-    public class Position : Disposable
+    public class Position : Disposable, ICloneable
     {
 
         /// <summary>
@@ -835,6 +835,10 @@ namespace Tizen.NUI
             return ret;
         }
 
+        /// <inheritdoc/>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public object Clone() => new Position(X, Y, Z);
+
         internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Position obj)
         {
             return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
index a3984cb..767f1ab 100755 (executable)
@@ -25,7 +25,7 @@ namespace Tizen.NUI
     /// </summary>
     /// <since_tizen> 3 </since_tizen>
     [Tizen.NUI.Binding.TypeConverter(typeof(Position2DTypeConverter))]
-    public class Position2D : Disposable
+    public class Position2D : Disposable, ICloneable
     {
         private Position2DChangedCallback callback = null;
 
@@ -343,6 +343,10 @@ namespace Tizen.NUI
             return new Position2D((int)position.X, (int)position.Y);
         }
 
+        /// <inheritdoc/>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public object Clone() => new Position2D(this);
+
         internal static Position2D GetPosition2DFromPtr(global::System.IntPtr cPtr)
         {
             Position2D ret = new Position2D(cPtr, false);
index 801f895..6629da2 100755 (executable)
@@ -25,7 +25,7 @@ namespace Tizen.NUI
     /// </summary>
     /// <since_tizen> 3 </since_tizen>
     [Binding.TypeConverter(typeof(RectangleTypeConverter))]
-    public class Rectangle : Disposable
+    public class Rectangle : Disposable, ICloneable
     {
         /// <summary>
         /// The constructor.
@@ -470,6 +470,10 @@ namespace Tizen.NUI
             return ret;
         }
 
+        /// <inheritdoc/>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public object Clone() => new Rectangle(this);
+
         internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Rectangle obj)
         {
             return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
index 6c4275b..0813907 100755 (executable)
@@ -26,7 +26,7 @@ namespace Tizen.NUI
     /// </summary>
     /// <since_tizen> 5 </since_tizen>
     [Tizen.NUI.Binding.TypeConverter(typeof(SizeTypeConverter))]
-    public class Size : Disposable
+    public class Size : Disposable, ICloneable
     {
 
         /// <summary>
@@ -314,6 +314,10 @@ namespace Tizen.NUI
             return ret;
         }
 
+        /// <inheritdoc/>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public object Clone() => new Size(Width, Height, Depth);
+
         /// <summary>
         /// The type cast operator, Size to Vector3.
         /// </summary>
index c1e6b84..818a625 100755 (executable)
@@ -14,6 +14,7 @@
  * limitations under the License.
  *
  */
+using System;
 using System.ComponentModel;
 using Tizen.NUI.Binding;
 using System;
@@ -25,7 +26,7 @@ namespace Tizen.NUI
     /// </summary>
     /// <since_tizen> 3 </since_tizen>
     [Tizen.NUI.Binding.TypeConverter(typeof(Size2DTypeConverter))]
-    public class Size2D : Disposable
+    public class Size2D : Disposable, ICloneable
     {
 
         private Size2DChangedCallback callback = null;
@@ -303,6 +304,10 @@ namespace Tizen.NUI
             return ret;
         }
 
+        /// <inheritdoc/>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public object Clone() => new Size2D(Width, Height);
+
         internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Size2D obj)
         {
             return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
index 2484c1f..c045b27 100755 (executable)
@@ -37,6 +37,13 @@ namespace Tizen.NUI
         private StyleChangedCallbackDelegate _styleManagerStyleChangedCallbackDelegate;
 
         /// <summary>
+        /// Internal use only. Do not open this API.
+        /// This is to get TizenFX resource path. It needs to be fixed to use application framework API in the future.
+        /// </summary>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public readonly static string FrameworkResourcePath = "/usr/share/dotnet.tizen/framework/res/";
+
+        /// <summary>
         /// Creates a StyleManager handle.<br />
         /// This can be initialized with StyleManager::Get().<br />
         /// </summary>
diff --git a/src/Tizen.NUI/src/public/Theme/Theme.cs b/src/Tizen.NUI/src/public/Theme/Theme.cs
new file mode 100644 (file)
index 0000000..ab48b4e
--- /dev/null
@@ -0,0 +1,263 @@
+/*
+ * Copyright(c) 2020 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.Collections;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Xml;
+using Tizen.NUI.BaseComponents;
+using Tizen.NUI.Binding;
+using Tizen.NUI.Xaml;
+
+namespace Tizen.NUI
+{
+    /// <summary></summary>
+    [EditorBrowsable(EditorBrowsableState.Never)]
+    public class Theme : BindableObject
+    {
+        private readonly Dictionary<string, ViewStyle> map;
+        private string baseTheme;
+
+        /// <summary>Create an empty theme.</summary>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public Theme()
+        {
+            map = new Dictionary<string, ViewStyle>();
+        }
+
+        /// <summary>Create a new theme from the xaml file.</summary>
+        /// <param name="xamlFile">An absolute path to the xaml file.</param>
+        /// <exception cref="ArgumentNullException">Thrown when the given xamlFile is null or empty string.</exception>
+        /// <exception cref="global::System.IO.IOException">Thrown when there are file IO problems.</exception>
+        /// <exception cref="Exception">Thrown when the content of the xaml file is not valid xaml form.</exception>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public Theme(string xamlFile) : this()
+        {
+            if (string.IsNullOrEmpty(xamlFile))
+            {
+                throw new ArgumentNullException("The xaml file path cannot be null or empty string", nameof(xamlFile));
+            }
+
+            try
+            {
+                using(var reader = XmlReader.Create(xamlFile))
+                {
+                    XamlLoader.Load(this, reader);
+                }
+            }
+            catch (global::System.IO.IOException e)
+            {
+                Tizen.Log.Info("NUI", $"Could not load \"{xamlFile}\".\n");
+                throw e;
+            }
+            catch (Exception e)
+            {
+                Tizen.Log.Info("NUI", $"Could not parse \"{xamlFile}\".\n");
+                Tizen.Log.Info("NUI", "Make sure the all used assemblies (e.g. Tizen.NUI.Components) are included in the application project.\n");
+                Tizen.Log.Info("NUI", "Make sure the type and namespace are correct.\n");
+                throw e;
+            }
+        }
+
+        /// <summary></summary>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public string Id { get; set; }
+
+        /// <summary>
+        /// For Xaml use only.
+        /// The bulit-in theme id that will be used as base of this.
+        /// View styles with same key are merged.
+        /// </summary>
+        internal string BasedOn
+        {
+            get => baseTheme;
+            set
+            {
+                baseTheme = value;
+
+                if (string.IsNullOrEmpty(baseTheme)) return;
+
+                var baseThemeInstance = ThemeManager.GetBuiltinTheme(baseTheme);
+
+                if (baseThemeInstance != null)
+                {
+                    foreach (var item in baseThemeInstance)
+                    {
+                        var baseStyle = item.Value?.Clone();
+                        if (map.ContainsKey(item.Key))
+                        {
+                            baseStyle.Merge(map[item.Key]);
+                        }
+                        map[item.Key] = baseStyle;
+                    }
+                }
+            }
+        }
+
+        /// <summary>
+        /// For Xaml use only.
+        /// Note that it is not a normal indexer.
+        /// Setter will merge the new value with existing item.
+        /// </summary>
+        internal ViewStyle this[string styleName]
+        {
+            get => map[styleName];
+            set
+            {
+                if (value == null)
+                {
+                    map.Remove(styleName);
+                    return;
+                }
+
+                if (map.TryGetValue(styleName, out ViewStyle style) && style != null && style.GetType() == value.GetType())
+                {
+                    style.Merge(value);
+                }
+                else
+                {
+                    map[styleName] = value;
+                }
+            }
+        }
+
+        internal int Count => map.Count;
+
+        /// <summary>
+        /// Get an enumerator of the theme.
+        /// </summary>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public IEnumerator<KeyValuePair<string, ViewStyle>> GetEnumerator() => map.GetEnumerator();
+
+        /// <summary>
+        /// Removes all styles in the theme.
+        /// </summary>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public void Clear() => map.Clear();
+
+        /// <summary>
+        /// Determines whether the theme contains the specified style name.
+        /// </summary>
+        /// <exception cref="ArgumentNullException">The given style name is null.</exception>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public bool HasStyle(string styleName) => map.ContainsKey(styleName);
+
+        /// <summary>
+        /// Removes the style with the specified style name.
+        /// </summary>
+        /// <exception cref="ArgumentNullException">The given style name is null.</exception>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public bool RemoveStyle(string styleName) => map.Remove(styleName);
+
+        /// <summary>
+        /// Gets a style of given style name.
+        /// </summary>
+        /// <param name="styleName">The string key to find a ViewStyle.</param>
+        /// <returns>Founded style instance.</returns>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public ViewStyle GetStyle(string styleName) => map.ContainsKey(styleName) ? map[styleName] : null;
+
+        /// <summary>
+        /// Gets a style of given view type.
+        /// </summary>
+        /// <param name="viewType">The type of View.</param>
+        /// <returns>Founded style instance.</returns>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public ViewStyle GetStyle(Type viewType)
+        {
+            var currentType = viewType;
+            ViewStyle resultStyle = null;
+
+            do
+            {
+                if (currentType.Equals(typeof(View))) break;
+                resultStyle = GetStyle(currentType.FullName);
+                currentType = currentType.BaseType;
+            }
+            while (resultStyle == null && currentType != null);
+
+            return resultStyle;
+        }
+
+        /// <summary>
+        /// Adds the specified style name and value to the theme.
+        /// This replace existing value if the theme already has a style with given name.
+        /// </summary>
+        /// <param name="styleName">The style name to add.</param>
+        /// <param name="value">The style instance to add.</param>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public void AddStyle(string styleName, ViewStyle value) => map[styleName] = value?.Clone();
+
+
+        /// <inheritdoc/>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public object Clone()
+        {
+            var result = new Theme()
+            {
+                Id = this.Id,
+            };
+
+            foreach (var item in this)
+            {
+                result.AddStyle(item.Key, item.Value);
+            }
+            return result;
+        }
+
+        /// <summary>Merge other Theme into this.</summary>
+        /// <param name="xamlFile">An absolute path to the xaml file of the theme.</param>
+        /// <exception cref="ArgumentException">Thrown when the given xamlFile is null or empty string.</exception>
+        /// <exception cref="global::System.IO.IOException">Thrown when there are file IO problems.</exception>
+        /// <exception cref="XamlParseException">Thrown when the content of the xaml file is not valid xaml form.</exception>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public void Merge(string xamlFile)
+        {
+            Merge(new Theme(xamlFile));
+        }
+
+        /// <summary>Merge other Theme into this.</summary>
+        /// <param name="theme">The Theme.</param>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public void Merge(Theme theme)
+        {
+            if (theme == null)
+                throw new ArgumentNullException(nameof(theme));
+            
+            foreach (var item in theme)
+            {
+                if (item.Value == null)
+                {
+                    map[item.Key] = null;
+                }
+                else if (map.ContainsKey(item.Key) && !item.Value.SolidNull)
+                {
+                    map[item.Key].Merge(theme.GetStyle(item.Key));
+                }
+                else
+                {
+                    map[item.Key] = theme.GetStyle(item.Key).Clone();
+                }
+            }
+        }
+
+        /// <summary>
+        /// Internal use only.
+        /// </summary>
+        internal void AddStyleWithoutClone(string styleName, ViewStyle value) => map[styleName] = value;
+    }
+}
diff --git a/src/Tizen.NUI/src/public/Theme/ThemeChangedEventArgs.cs b/src/Tizen.NUI/src/public/Theme/ThemeChangedEventArgs.cs
new file mode 100644 (file)
index 0000000..5f1c00e
--- /dev/null
@@ -0,0 +1,40 @@
+/*
+ * Copyright(c) 2020 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;
+
+namespace Tizen.NUI
+{
+    /// <summary>
+    /// </summary>
+    [EditorBrowsable(EditorBrowsableState.Never)]
+    public class ThemeChangedEventArgs : EventArgs
+    {
+        /// <summary>
+        /// </summary>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public ThemeChangedEventArgs(string themeId)
+        {
+            ThemeId = themeId;
+        }
+
+        /// <summary>
+        /// </summary>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public string ThemeId { get; }
+    }
+}
diff --git a/src/Tizen.NUI/src/public/Theme/ThemeManager.cs b/src/Tizen.NUI/src/public/Theme/ThemeManager.cs
new file mode 100644 (file)
index 0000000..1192cb1
--- /dev/null
@@ -0,0 +1,330 @@
+/*
+ * Copyright(c) 2020 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.
+ *
+ */
+extern alias TizenSystemInformation;
+using TizenSystemInformation.Tizen.System;
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using Tizen.NUI.Xaml;
+using Tizen.NUI.BaseComponents;
+
+namespace Tizen.NUI
+{
+    /// <summary></summary>
+    [EditorBrowsable(EditorBrowsableState.Never)]
+    public static class ThemeManager
+    {
+        private enum Profile
+        {
+            Common = 0,
+            Mobile = 1,
+            TV = 2,
+            Wearable = 3
+        }
+
+        private static readonly string[] nuiThemeProjects =
+        {
+            "Tizen.NUI",
+            "Tizen.NUI.Components",
+            "Tizen.NUI.Wearable"
+        };
+
+        /// <summary>
+        /// Table that indicates default theme id by device profile.
+        /// Note that, the fallback of null value is Common value.
+        /// </summary>
+        private static readonly string[] profileDefaultTheme =
+        {
+            /* Common   */ "Tizen.NUI.Theme.Common",
+            /* Mobile   */ "Tizen.NUI.Theme.Common",
+            /* TV       */ null,
+            /* Wearable */ "Tizen.NUI.Theme.Wearable",
+        };
+
+        private static Theme currentTheme;
+        private static Theme defaultTheme;
+        private static bool isLoadingDefault = false;
+        private static Profile? currentProfile;
+        private static List<Theme> builtinThemes = new List<Theme>(); // Themes provided by framework.
+        internal static List<Theme> customThemes = new List<Theme>(); // Themes registered by user.
+
+        static ThemeManager() {}
+
+        /// <summary>
+        /// </summary>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public static event EventHandler<ThemeChangedEventArgs> ThemeChanged;
+
+        /// <summary>
+        /// Internal one should be called before calling public ThemeChanged
+        /// </summary>
+        internal static event EventHandler<ThemeChangedEventArgs> ThemeChangedInternal;
+
+        internal static Theme CurrentTheme
+        {
+            get
+            {
+                if (currentTheme == null)
+                {
+                    currentTheme = DefaultTheme;
+                }
+                return currentTheme;
+            }
+            set
+            {
+                currentTheme = value;
+                NotifyThemeChanged();
+            }
+        }
+
+        internal static Theme DefaultTheme
+        {
+            get
+            {
+                if (defaultTheme == null && !isLoadingDefault)
+                {
+                    isLoadingDefault = true;
+                    defaultTheme = LoadBuiltinTheme(profileDefaultTheme[(int)CurrentProfile]);
+                    isLoadingDefault = false;
+                }
+                return defaultTheme;
+            }
+            set => defaultTheme = (Theme)value?.Clone();
+        }
+
+        internal static bool ThemeApplied => (CurrentTheme.Count > 0 || DefaultTheme.Count > 0);
+
+        private static Profile CurrentProfile
+        {
+            get
+            {
+                if (currentProfile == null)
+                {
+                    currentProfile = Profile.Common;
+                    string profileString = "";
+
+                    try
+                    {
+                        Information.TryGetValue<string>("tizen.org/feature/profile", out profileString);
+                        Tizen.Log.Info("NUI", "Profile for initial theme found : " + profileString);
+                    }
+                    catch
+                    {
+                        Tizen.Log.Info("NUI", "Unknown device profile\n");
+                    }
+                    finally
+                    {
+                        if (string.Equals(profileString, "mobile"))
+                        {
+                            currentProfile = Profile.Mobile;
+                        }
+                        else if (string.Equals(profileString, "tv"))
+                        {
+                            currentProfile = Profile.TV;
+                        }
+                        else if (string.Equals(profileString, "wearable"))
+                        {
+                            currentProfile = Profile.Wearable;
+                        }
+                    }
+                }
+                return (Profile)currentProfile;
+            }
+        }
+
+        /// <summary>
+        /// Set a theme to be used as fallback.
+        /// The fallback theme is set to profile specified theme by default.
+        /// </summary>
+        /// <param name="fallbackTheme">The theme instance to be applied as a fallback.</param>
+        /// <exception cref="ArgumentNullException">The given theme is null.</exception>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public static void ApplyFallbackTheme(Theme fallbackTheme)
+        {
+            DefaultTheme = fallbackTheme ?? throw new ArgumentNullException("Invalid theme.");
+        }
+
+        /// <summary>
+        /// Apply theme to the NUI.
+        /// This will change the appreance of the existing components with property <seealso cref="View.ThemeChangeSensitive"/> on.
+        /// This also affects all components created afterwards.
+        /// </summary>
+        /// <param name="theme">The theme instance to be applied.</param>
+        /// <exception cref="ArgumentNullException">Thrown when the given theme is null.</exception>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public static void ApplyTheme(Theme theme)
+        {
+            var newTheme = (Theme)theme?.Clone() ?? throw new ArgumentNullException("Invalid theme.");
+
+            if (string.IsNullOrEmpty(newTheme.Id))
+            {
+                newTheme.Id = "NONAME";
+            }
+
+            CurrentTheme = newTheme;
+        }
+
+        /// <summary>
+        /// Note that this API is to support legacy Tizen.NUI.Components.StyleManager.
+        /// Please use <seealso cref="ApplyTheme(Theme)"/> instead.
+        ///
+        /// Apply theme to the NUI using theme id.
+        /// The id of theme should be either a registered custom theme or a built-in theme.
+        /// You can register custom theme using <seealso cref="RegisterTheme(Theme)"/>.
+        /// This will change the appreance of the existing components with property <seealso cref="View.ThemeChangeSensitive"/> on.
+        /// This also affects all components created afterwards.
+        /// </summary>
+        /// <param name="themeId">The theme Id.</param>
+        /// <exception cref="ArgumentNullException">Thrown when the given themeId is null.</exception>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public static void ApplyTheme(string themeId)
+        {
+            if (themeId == null) throw new ArgumentNullException("Invalid themeId");
+
+            int index = customThemes.FindIndex(x => x.Id.Equals(themeId, StringComparison.OrdinalIgnoreCase));
+            if (index >= 0)
+            {
+                CurrentTheme = customThemes[index];
+                return;
+            }
+            
+            index = builtinThemes.FindIndex(x => string.Equals(x.Id, themeId, StringComparison.OrdinalIgnoreCase));
+            if (index >= 0)
+            {
+                CurrentTheme = builtinThemes[index];
+            }
+            else
+            {
+                Tizen.Log.Info("NUI", $"No Theme found with given id : {themeId}");
+            }
+        }
+
+        /// <summary>
+        /// Note that this API is to support legacy Tizen.NUI.Components.StyleManager.
+        ///
+        /// Register a custom theme that can be used as an id when calling <seealso cref="ApplyTheme(string)"/>.
+        /// </summary>
+        /// <param name="theme">The theme instance.</param>
+        /// <exception cref="ArgumentException">Thrown when the given theme is null or invalid.</exception>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public static void RegisterTheme(Theme theme)
+        {
+            if (theme == null || string.IsNullOrEmpty(theme.Id)) throw new ArgumentException("Invalid theme.");
+
+            int index = customThemes.FindIndex(x => x.Id.Equals(theme.Id, StringComparison.OrdinalIgnoreCase));
+            if (index >= 0)
+            {
+                customThemes[index] = (Theme)theme.Clone();
+            }
+            else
+            {
+                customThemes.Add((Theme)theme.Clone());
+            }
+        }
+
+        /// <summary>
+        /// Load a style with style name in the current theme.
+        /// For components, the style name is a component name (e.g. Button) in normal case.
+        /// </summary>
+        /// <param name="styleName">The style name.</param>
+        /// <exception cref="ArgumentNullException">Thrown when the given styleName is null.</exception>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public static ViewStyle GetStyle(string styleName)
+        {
+            if (styleName == null) throw new ArgumentNullException("Invalid style name");
+
+            if (!ThemeApplied) return null;
+
+            return (CurrentTheme.GetStyle(styleName) ?? DefaultTheme.GetStyle(styleName))?.Clone();
+        }
+
+        /// <summary>
+        /// Load a style with View type in the current theme.
+        /// </summary>
+        /// <param name="viewType">The type of View.</param>
+        /// <exception cref="ArgumentNullException">Thrown when the given viewType is null.</exception>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public static ViewStyle GetStyle(Type viewType)
+        {
+            if (viewType == null) throw new ArgumentNullException("Invalid viewType");
+
+            if (!ThemeApplied) return null;
+
+            return (CurrentTheme.GetStyle(viewType) ?? DefaultTheme.GetStyle(viewType))?.Clone();
+        }
+
+        /// <summary>
+        /// Get a cloned built-in theme.
+        /// </summary>
+        /// <param name="themeId">The built-in theme id.</param>
+        /// <exception cref="ArgumentNullException">Thrown when the given themeId is null.</exception>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public static Theme GetBuiltinTheme(string themeId)
+        {
+            if (themeId == null) throw new ArgumentNullException("Invalid themeId");
+
+            Theme result = null;
+            int index = builtinThemes.FindIndex(x => string.Equals(x.Id, themeId, StringComparison.OrdinalIgnoreCase));
+            if (index >= 0)
+            {
+                result = builtinThemes[index];
+            }
+            else
+            {
+                var theme = LoadBuiltinTheme(themeId);
+                builtinThemes.Add(theme);
+                result = theme;
+            }
+            return (Theme)result?.Clone();
+        }
+
+        private static Theme LoadBuiltinTheme(string id)
+        {
+            var loaded = new Theme()
+            {
+                Id = id,
+            };
+
+            if (string.IsNullOrEmpty(id)) return loaded;
+
+            foreach (var project in nuiThemeProjects)
+            {
+                string path = StyleManager.FrameworkResourcePath + "/Theme/" + project + "_" + id + ".xaml";
+
+                try
+                {
+                    loaded.Merge(path);
+                    loaded.Id = id;
+                    Tizen.Log.Info("NUI", $"Done to load \"{path}\".\n");
+                }
+                catch (Exception e)
+                {
+                    Tizen.Log.Debug("NUI", $"Could not load \"{path}\"\n");
+                    Tizen.Log.Debug("NUI", "Message: " + e + "\n");
+                }
+            }
+
+            return loaded;
+        }
+
+        private static void NotifyThemeChanged()
+        {
+            ThemeChangedInternal?.Invoke(null, new ThemeChangedEventArgs(CurrentTheme?.Id));
+            ThemeChanged?.Invoke(null, new ThemeChangedEventArgs(CurrentTheme?.Id));
+        }
+    }
+}
index ff829f6..931f582 100755 (executable)
@@ -26,7 +26,7 @@ namespace Tizen.NUI
     /// </summary>
     /// <since_tizen> 3 </since_tizen>
     [Binding.TypeConverter(typeof(Vector2TypeConverter))]
-    public class Vector2 : Disposable
+    public class Vector2 : Disposable, ICloneable
     {
 
         /// <summary>
@@ -450,6 +450,10 @@ namespace Tizen.NUI
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
         }
 
+        /// <inheritdoc/>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public object Clone() => new Vector2(this);
+
         /// <summary>
         /// Clamps the vector between minimum and maximum vectors.
         /// </summary>
index 3cb3a96..379987e 100755 (executable)
@@ -26,7 +26,7 @@ namespace Tizen.NUI
     /// </summary>
     /// <since_tizen> 3 </since_tizen>
     [Binding.TypeConverter(typeof(Vector3TypeConverter))]
-    public class Vector3 : Disposable
+    public class Vector3 : Disposable, ICloneable
     {
         /// <summary>
         /// The constructor.
@@ -622,6 +622,10 @@ namespace Tizen.NUI
             return ret;
         }
 
+        /// <inheritdoc/>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public object Clone() => new Vector3(X, Y, Z);
+
         internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Vector3 obj)
         {
             return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
index d02b25b..49e0480 100755 (executable)
@@ -26,7 +26,7 @@ namespace Tizen.NUI
     /// </summary>
     /// <since_tizen> 3 </since_tizen>
     [Binding.TypeConverter(typeof(Vector4TypeConverter))]
-    public class Vector4 : Disposable
+    public class Vector4 : Disposable, ICloneable
     {
 
         /// <summary>
@@ -629,6 +629,10 @@ namespace Tizen.NUI
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
         }
 
+        /// <inheritdoc/>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public object Clone() => new Vector4(X, Y, Z, W);
+
         internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Vector4 obj)
         {
             return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
index 02b5bfe..891351b 100644 (file)
@@ -45,7 +45,7 @@ namespace Tizen.NUI
         public ImageShadow(string url, Rectangle border, Vector2 offset, Vector2 extents) : base(offset, extents)
         {
             Url = url;
-            Border = new Rectangle(border);
+            Border = border == null ? null : new Rectangle(border);
         }
 
         /// <summary>
index f66964a..680b010 100644 (file)
@@ -48,7 +48,7 @@ namespace Tizen.NUI
         public Shadow(float blurRadius, Vector2 offset, Color color, Vector2 extents) : base(offset, extents)
         {
             BlurRadius = blurRadius;
-            Color = new Color(color);
+            Color = color == null ? null : new Color(color);
         }
 
         /// <summary>
index 07d0c45..2806e60 100644 (file)
@@ -45,8 +45,8 @@ namespace Tizen.NUI
         [EditorBrowsable(EditorBrowsableState.Never)]
         protected ShadowBase(Vector2 offset, Vector2 extents)
         {
-            Offset = new Vector2(offset);
-            Extents = new Vector2(extents);
+            Offset = offset == null ? null : new Vector2(offset);
+            Extents = extents == null ? null : new Vector2(extents);
         }
 
         /// <summary></summary>
index 98d0936..1ca0921 100755 (executable)
@@ -63,7 +63,7 @@ namespace Tizen.NUI
         [EditorBrowsable(EditorBrowsableState.Never)]
         public object Clone()
         {
-            return new TextShadow(Color, Offset, BlurRadius);
+            return new TextShadow((Color)Color?.Clone(), Offset, BlurRadius);
         }
 
         /// <summary>
index 0078c8f..d7f2569 100755 (executable)
@@ -27,7 +27,7 @@ namespace Tizen.NUI
     {
         internal ViewWrapperImpl viewWrapperImpl;
 
-        internal ViewWrapper(global::System.IntPtr cPtr, bool cMemoryOwn) : base(Interop.ViewWrapper.ViewWrapper_SWIGUpcast(cPtr), cMemoryOwn)
+        internal ViewWrapper(global::System.IntPtr cPtr, bool cMemoryOwn) : base(Interop.ViewWrapper.ViewWrapper_SWIGUpcast(cPtr), cMemoryOwn, null)
         {
         }
 
diff --git a/src/Tizen.NUI/src/public/Xaml/MarkupExtensions/ApplicationResourcePathExtension.cs b/src/Tizen.NUI/src/public/Xaml/MarkupExtensions/ApplicationResourcePathExtension.cs
new file mode 100644 (file)
index 0000000..cb8345b
--- /dev/null
@@ -0,0 +1,34 @@
+using System;
+using System.ComponentModel;
+using Tizen.NUI.Binding;
+
+namespace Tizen.NUI.Xaml
+{
+    /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+    [EditorBrowsable(EditorBrowsableState.Never)]
+    [ContentProperty(nameof(FilePath))]
+    [AcceptEmptyServiceProvider]
+    public class ApplicationResourcePathExtension : IMarkupExtension<string>
+    {
+        /// <summary></summary>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public ApplicationResourcePathExtension()
+        {
+        }
+
+        /// <summary></summary>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public string FilePath { get; set; }
+
+        /// <inheritdoc/>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public string ProvideValue(IServiceProvider serviceProvider) => Tizen.Applications.Application.Current.DirectoryInfo.Resource + FilePath;
+
+        /// <inheritdoc/>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        object IMarkupExtension.ProvideValue(IServiceProvider serviceProvider)
+        {
+            return (this as IMarkupExtension<string>).ProvideValue(serviceProvider);
+        }
+    }
+}
diff --git a/src/Tizen.NUI/src/public/Xaml/MarkupExtensions/NUIResourcePathExtension.cs b/src/Tizen.NUI/src/public/Xaml/MarkupExtensions/NUIResourcePathExtension.cs
new file mode 100644 (file)
index 0000000..08e622b
--- /dev/null
@@ -0,0 +1,34 @@
+using System;
+using System.ComponentModel;
+using Tizen.NUI.Binding;
+
+namespace Tizen.NUI.Xaml
+{
+    /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+    [EditorBrowsable(EditorBrowsableState.Never)]
+    [ContentProperty(nameof(FilePath))]
+    [AcceptEmptyServiceProvider]
+    public class NUIResourcePathExtension : IMarkupExtension<string>
+    {
+        /// <summary></summary>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public NUIResourcePathExtension()
+        {
+        }
+
+        /// <summary></summary>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public string FilePath { get; set; }
+
+        /// <inheritdoc/>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public string ProvideValue(IServiceProvider serviceProvider) => StyleManager.FrameworkResourcePath + FilePath;
+
+        /// <inheritdoc/>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        object IMarkupExtension.ProvideValue(IServiceProvider serviceProvider)
+        {
+            return (this as IMarkupExtension<string>).ProvideValue(serviceProvider);
+        }
+    }
+}
index ab8b317..919aa2a 100755 (executable)
@@ -50,35 +50,36 @@ namespace Tizen.NUI.Binding
         [EditorBrowsable(EditorBrowsableState.Never)]
         public event PropertyChangedEventHandler PropertyChanged;
 
-        /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+        /// <summary>Whether to allow null value when <seealso cref="CopyFrom"/>.</summary>
         [EditorBrowsable(EditorBrowsableState.Never)]
-        public virtual void CopyFrom(BindableObject that)
+        protected static bool AllowNullCopy { get; set; } = false;
+
+        /// <summary>Copy properties of other ViewStyle to this.</summary>
+        /// <param name="other">The other BindableProperty merge to this.</param>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public virtual void CopyFrom(BindableObject other)
         {
-            if (null != that)
-            {
-                Dictionary<string, BindableProperty> nameToBindableProperty1;
-                Type type1 = this.GetType();
-                BindableProperty.GetBindablePropertysOfType(type1, out nameToBindableProperty1);
+            if (null == other) return;
+
+            Type type1 = this.GetType();
+            BindableProperty.GetBindablePropertysOfType(type1, out var nameToBindableProperty1);
 
-                Dictionary<string, BindableProperty> nameToBindableProperty2;
-                Type type2 = that.GetType();
-                BindableProperty.GetBindablePropertysOfType(type2, out nameToBindableProperty2);
+            Type type2 = other.GetType();
+            BindableProperty.GetBindablePropertysOfType(type2, out var nameToBindableProperty2);
 
-                if (null != nameToBindableProperty1)
+            if (null != nameToBindableProperty1)
+            {
+                foreach (KeyValuePair<string, BindableProperty> keyValuePair in nameToBindableProperty1)
                 {
-                    foreach (KeyValuePair<string, BindableProperty> keyValuePair in nameToBindableProperty1)
+                    nameToBindableProperty2.TryGetValue(keyValuePair.Key, out var bindableProperty);
+
+                    if (null != bindableProperty)
                     {
-                        BindableProperty bindableProperty;
-                        nameToBindableProperty2.TryGetValue(keyValuePair.Key, out bindableProperty);
+                        object value = other.GetValue(bindableProperty);
 
-                        if (null != bindableProperty)
+                        if (AllowNullCopy || null != value)
                         {
-                            object value = that.GetValue(bindableProperty);
-
-                            if (null != value)
-                            {
-                                SetValue(keyValuePair.Value, value);
-                            }
+                            SetValue(keyValuePair.Value, value);
                         }
                     }
                 }