From 96225d84a3b693b836e80ea738aaf9ecd8caf918 Mon Sep 17 00:00:00 2001 From: Xianbing Teng Date: Wed, 18 Dec 2019 14:33:54 +0800 Subject: [PATCH] Fix components issue 1216 (#1194) (#1203) * [NUI] Fix text field fontfamily selector and color convert issue * [NUI.Components] Fix tab item issue * [NUI] Rename attribute file name to style * [NUI.Components] Make OnUpdate of Button as hidden --- src/Tizen.NUI.Components/Controls/Button.cs | 11 ++- src/Tizen.NUI.Components/Controls/Control.cs | 27 ++----- src/Tizen.NUI.Components/Controls/DropDown.cs | 13 ++-- src/Tizen.NUI.Components/Controls/ImageControl.cs | 20 ++---- src/Tizen.NUI.Components/Controls/InputField.cs | 82 +++++++++++++++------- src/Tizen.NUI.Components/Controls/Tab.cs | 2 +- .../ButtonAttributes.cs => Style/ButtonStyle.cs} | 0 .../{Attributes => Style}/ControlStyle.cs | 0 .../DropDownStyle.cs} | 0 .../{Attributes => Style}/ImageControlStyle.cs | 0 .../InputFieldStyle.cs} | 18 +---- .../LoadingAttributes.cs => Style/LoadingStyle.cs} | 0 .../PaginationStyle.cs} | 0 .../PopupAttributes.cs => Style/PopupStyle.cs} | 0 .../ProgressStyle.cs} | 0 .../ScrollbarStyle.cs} | 0 .../SliderAttributes.cs => Style/SliderStyle.cs} | 2 +- .../SwitchAttributes.cs => Style/SwitchStyle.cs} | 0 .../TabAttributes.cs => Style/TabStyle.cs} | 0 .../ToastAttributes.cs => Style/ToastStyle.cs} | 0 .../{ImageViewAttributes.cs => ImageViewStyle.cs} | 0 .../{TextFieldAttributes.cs => TextFieldStyle.cs} | 2 +- .../{TextLabelAttributes.cs => TextLabelStyle.cs} | 0 .../Style/{ViewAttributes.cs => ViewStyle.cs} | 0 .../BaseComponents/TextFieldBindableProperty.cs | 8 ++- 25 files changed, 101 insertions(+), 84 deletions(-) rename src/Tizen.NUI.Components/{Attributes/ButtonAttributes.cs => Style/ButtonStyle.cs} (100%) rename src/Tizen.NUI.Components/{Attributes => Style}/ControlStyle.cs (100%) rename src/Tizen.NUI.Components/{Attributes/DropDownAttributes.cs => Style/DropDownStyle.cs} (100%) rename src/Tizen.NUI.Components/{Attributes => Style}/ImageControlStyle.cs (100%) rename src/Tizen.NUI.Components/{Attributes/InputFieldAttributes.cs => Style/InputFieldStyle.cs} (94%) rename src/Tizen.NUI.Components/{Attributes/LoadingAttributes.cs => Style/LoadingStyle.cs} (100%) rename src/Tizen.NUI.Components/{Attributes/PaginationAttributes.cs => Style/PaginationStyle.cs} (100%) rename src/Tizen.NUI.Components/{Attributes/PopupAttributes.cs => Style/PopupStyle.cs} (100%) rename src/Tizen.NUI.Components/{Attributes/ProgressAttributes.cs => Style/ProgressStyle.cs} (100%) rename src/Tizen.NUI.Components/{Attributes/ScrollbarAttributes.cs => Style/ScrollbarStyle.cs} (100%) rename src/Tizen.NUI.Components/{Attributes/SliderAttributes.cs => Style/SliderStyle.cs} (99%) rename src/Tizen.NUI.Components/{Attributes/SwitchAttributes.cs => Style/SwitchStyle.cs} (100%) rename src/Tizen.NUI.Components/{Attributes/TabAttributes.cs => Style/TabStyle.cs} (100%) rename src/Tizen.NUI.Components/{Attributes/ToastAttributes.cs => Style/ToastStyle.cs} (100%) rename src/Tizen.NUI/src/public/BaseComponents/Style/{ImageViewAttributes.cs => ImageViewStyle.cs} (100%) rename src/Tizen.NUI/src/public/BaseComponents/Style/{TextFieldAttributes.cs => TextFieldStyle.cs} (99%) rename src/Tizen.NUI/src/public/BaseComponents/Style/{TextLabelAttributes.cs => TextLabelStyle.cs} (100%) rename src/Tizen.NUI/src/public/BaseComponents/Style/{ViewAttributes.cs => ViewStyle.cs} (100%) diff --git a/src/Tizen.NUI.Components/Controls/Button.cs b/src/Tizen.NUI.Components/Controls/Button.cs index f2ca4ae..c9efa03 100755 --- a/src/Tizen.NUI.Components/Controls/Button.cs +++ b/src/Tizen.NUI.Components/Controls/Button.cs @@ -584,7 +584,6 @@ namespace Tizen.NUI.Components { if (buttonIcon != null) { - buttonIcon.Relayout -= OnIconRelayout; Utility.Dispose(buttonIcon); } if (buttonText != null) @@ -646,6 +645,7 @@ namespace Tizen.NUI.Components base.OnFocusGained(); UpdateState(); } + /// /// Called when the control loses key input focus. Should be overridden by derived classes if they need to customize what happens when the focus is lost. /// @@ -741,7 +741,6 @@ namespace Tizen.NUI.Components if (null == buttonIcon) { buttonIcon = new ImageControl(); - buttonIcon.Relayout += OnIconRelayout; this.Add(buttonIcon); } @@ -762,6 +761,14 @@ namespace Tizen.NUI.Components return new ButtonStyle(); } + /// 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 override void OnUpdate() + { + base.OnUpdate(); + UpdateUIContent(); + } + /// /// Update Button State. /// diff --git a/src/Tizen.NUI.Components/Controls/Control.cs b/src/Tizen.NUI.Components/Controls/Control.cs index 6a9e174..fb6c543 100755 --- a/src/Tizen.NUI.Components/Controls/Control.cs +++ b/src/Tizen.NUI.Components/Controls/Control.cs @@ -84,7 +84,7 @@ namespace Tizen.NUI.Components private TapGestureDetector tapGestureDetector = new TapGestureDetector(); private bool isFocused = false; - internal ImageView backgroundImage; + internal ImageView backgroundImage = new ImageView(); internal ImageView shadowImage; /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. @@ -356,16 +356,12 @@ namespace Tizen.NUI.Components } shadowImage.ApplyStyle(controlStyle.Shadow); - - if (null == backgroundImage) - { - backgroundImage = new ImageView() - { - WidthResizePolicy = ResizePolicyType.FillToParent, - HeightResizePolicy = ResizePolicyType.FillToParent, - }; - this.Add(backgroundImage); - } + } + if (null != controlStyle.BackgroundImage) + { + backgroundImage.WidthResizePolicy = ResizePolicyType.FillToParent; + backgroundImage.HeightResizePolicy = ResizePolicyType.FillToParent; + this.Add(backgroundImage); } } @@ -427,15 +423,6 @@ namespace Tizen.NUI.Components private void Initialize(string style) { ControlState = ControlStates.Normal; - if(null == backgroundImage) - { - backgroundImage = new ImageView() - { - WidthResizePolicy = ResizePolicyType.FillToParent, - HeightResizePolicy = ResizePolicyType.FillToParent, - }; - this.Add(backgroundImage); - } RegisterDetectionOfSubstyleChanges(); diff --git a/src/Tizen.NUI.Components/Controls/DropDown.cs b/src/Tizen.NUI.Components/Controls/DropDown.cs index 419a0c4..cbd2ebf 100755 --- a/src/Tizen.NUI.Components/Controls/DropDown.cs +++ b/src/Tizen.NUI.Components/Controls/DropDown.cs @@ -390,9 +390,9 @@ namespace Tizen.NUI.Components { SetUpListContainer(); } - button.ApplyStyle(Style.Button); - headerText.ApplyStyle(Style.HeaderText); - listBackgroundImage.ApplyStyle(Style.ListBackgroundImage); + button.ApplyStyle(dropDownStyle.Button); + headerText.ApplyStyle(dropDownStyle.HeaderText); + listBackgroundImage.ApplyStyle(dropDownStyle.ListBackgroundImage); UpdateDropDown(); } } @@ -1515,7 +1515,12 @@ namespace Tizen.NUI.Components if (listItemData.CheckImageResourceUrl != null) { listItemView.CheckResourceUrl = listItemData.CheckImageResourceUrl; - listItemView.CheckImageSize = listItemData.CheckImageSize; + + if (null != listItemData.CheckImageSize) + { + listItemView.CheckImageSize = listItemData.CheckImageSize; + } + if (listItemView.CheckImageSize != null) { listItemView.CheckPosition = new Position(listItemView.Size2D.Width - listItemData.CheckImageGapToBoundary - listItemView.CheckImageSize.Width, (listItemView.Size2D.Height - listItemView.CheckImageSize.Height) / 2); diff --git a/src/Tizen.NUI.Components/Controls/ImageControl.cs b/src/Tizen.NUI.Components/Controls/ImageControl.cs index 18a017e..e104701 100755 --- a/src/Tizen.NUI.Components/Controls/ImageControl.cs +++ b/src/Tizen.NUI.Components/Controls/ImageControl.cs @@ -59,18 +59,6 @@ namespace Tizen.NUI.Components return imageControl.BorderSelector; }); - /// - /// Control style. - /// - /// 6 - /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - private ImageControlStyle imageControlStyle; - - /// 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 new ImageControlStyle Style => imageControlStyle; - internal ImageView imageView; /// @@ -108,6 +96,10 @@ namespace Tizen.NUI.Components Initialize(style); } + /// 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 new ImageControlStyle Style => ViewStyle as ImageControlStyle; + /// /// Override view's BackgroundImage. /// @@ -176,6 +168,7 @@ namespace Tizen.NUI.Components }; this.Add(imageView); } + imageView.RaiseToTop(); } } @@ -205,8 +198,7 @@ namespace Tizen.NUI.Components [EditorBrowsable(EditorBrowsableState.Never)] protected override ViewStyle GetViewStyle() { - imageControlStyle = new ImageControlStyle(); - return imageControlStyle; + return new ImageControlStyle(); ; } private void Initialize(string style) diff --git a/src/Tizen.NUI.Components/Controls/InputField.cs b/src/Tizen.NUI.Components/Controls/InputField.cs index 4427c8d..6dfa6c5 100755 --- a/src/Tizen.NUI.Components/Controls/InputField.cs +++ b/src/Tizen.NUI.Components/Controls/InputField.cs @@ -370,6 +370,50 @@ namespace Tizen.NUI.Components } } + /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public override void ApplyStyle(ViewStyle viewStyle) + { + base.ApplyStyle(viewStyle); + + InputFieldStyle inputFieldStyle = viewStyle as InputFieldStyle; + + if (null != inputFieldStyle.BackgroundImageAttributes) + { + if (null == bgImage) + { + bgImage = new ImageView() + { + WidthResizePolicy = ResizePolicyType.FillToParent, + HeightResizePolicy = ResizePolicyType.FillToParent, + }; + + this.Add(bgImage); + } + bgImage.ApplyStyle(inputFieldStyle.BackgroundImageAttributes); + } + if (null != inputFieldStyle.InputBoxAttributes) + { + if (null == textField) + { + textField = new TextField() + { + WidthResizePolicy = ResizePolicyType.Fixed, + HeightResizePolicy = ResizePolicyType.Fixed, + ParentOrigin = Tizen.NUI.ParentOrigin.CenterLeft, + PivotPoint = Tizen.NUI.PivotPoint.CenterLeft, + PositionUsesPivotPoint = true, + }; + this.Add(textField); + textField.FocusGained += OnTextFieldFocusGained; + textField.FocusLost += OnTextFieldFocusLost; + textField.TextChanged += OnTextFieldTextChanged; + textField.KeyEvent += OnTextFieldKeyEvent; + } + textField.ApplyStyle(inputFieldStyle.InputBoxAttributes); + } + } + /// /// Get Input Field attribues. /// @@ -552,37 +596,27 @@ namespace Tizen.NUI.Components throw new Exception("Fail to get the InputField attributes."); } - bgImage = new ImageView(); if (null == bgImage) { - throw new Exception("Fail to create background image."); - } - - textField = new TextField(); - if (null == textField) - { - throw new Exception("Fail to create text field."); - } + bgImage = new ImageView() + { + WidthResizePolicy = ResizePolicyType.FillToParent, + HeightResizePolicy = ResizePolicyType.FillToParent, + }; - if (null != inputFieldAttrs.BackgroundImageAttributes) - { - bgImage.WidthResizePolicy = ResizePolicyType.FillToParent; - bgImage.HeightResizePolicy = ResizePolicyType.FillToParent; - bgImage.ParentOrigin = Tizen.NUI.ParentOrigin.Center; - bgImage.PivotPoint = Tizen.NUI.PivotPoint.Center; - bgImage.PositionUsesPivotPoint = true; this.Add(bgImage); } - - if (null != inputFieldAttrs.InputBoxAttributes) + if (null == textField) { - textField.WidthResizePolicy = ResizePolicyType.Fixed; - textField.HeightResizePolicy = ResizePolicyType.Fixed; - textField.ParentOrigin = Tizen.NUI.ParentOrigin.CenterLeft; - textField.PivotPoint = Tizen.NUI.PivotPoint.CenterLeft; - textField.PositionUsesPivotPoint = true; + textField = new TextField() + { + WidthResizePolicy = ResizePolicyType.Fixed, + HeightResizePolicy = ResizePolicyType.Fixed, + ParentOrigin = Tizen.NUI.ParentOrigin.CenterLeft, + PivotPoint = Tizen.NUI.PivotPoint.CenterLeft, + PositionUsesPivotPoint = true, + }; this.Add(textField); - textField.FocusGained += OnTextFieldFocusGained; textField.FocusLost += OnTextFieldFocusLost; textField.TextChanged += OnTextFieldTextChanged; diff --git a/src/Tizen.NUI.Components/Controls/Tab.cs b/src/Tizen.NUI.Components/Controls/Tab.cs index e8873d5..279b732 100755 --- a/src/Tizen.NUI.Components/Controls/Tab.cs +++ b/src/Tizen.NUI.Components/Controls/Tab.cs @@ -483,7 +483,7 @@ namespace Tizen.NUI.Components { for (int i = 0; i < totalNum; i++) { - preW = (itemList[i].NaturalSize2D != null ? itemList[i].NaturalSize2D.Width : 0); + preW = (itemList[i].TextItem.NaturalSize2D != null ? itemList[i].TextItem.NaturalSize2D.Width : 0); itemList[i].Position2D.X = preX; itemList[i].Size2D.Width = preW; preX = itemList[i].Position2D.X + preW + itemSpace; diff --git a/src/Tizen.NUI.Components/Attributes/ButtonAttributes.cs b/src/Tizen.NUI.Components/Style/ButtonStyle.cs similarity index 100% rename from src/Tizen.NUI.Components/Attributes/ButtonAttributes.cs rename to src/Tizen.NUI.Components/Style/ButtonStyle.cs diff --git a/src/Tizen.NUI.Components/Attributes/ControlStyle.cs b/src/Tizen.NUI.Components/Style/ControlStyle.cs similarity index 100% rename from src/Tizen.NUI.Components/Attributes/ControlStyle.cs rename to src/Tizen.NUI.Components/Style/ControlStyle.cs diff --git a/src/Tizen.NUI.Components/Attributes/DropDownAttributes.cs b/src/Tizen.NUI.Components/Style/DropDownStyle.cs similarity index 100% rename from src/Tizen.NUI.Components/Attributes/DropDownAttributes.cs rename to src/Tizen.NUI.Components/Style/DropDownStyle.cs diff --git a/src/Tizen.NUI.Components/Attributes/ImageControlStyle.cs b/src/Tizen.NUI.Components/Style/ImageControlStyle.cs similarity index 100% rename from src/Tizen.NUI.Components/Attributes/ImageControlStyle.cs rename to src/Tizen.NUI.Components/Style/ImageControlStyle.cs diff --git a/src/Tizen.NUI.Components/Attributes/InputFieldAttributes.cs b/src/Tizen.NUI.Components/Style/InputFieldStyle.cs similarity index 94% rename from src/Tizen.NUI.Components/Attributes/InputFieldAttributes.cs rename to src/Tizen.NUI.Components/Style/InputFieldStyle.cs index c5baf08..96cc498 100755 --- a/src/Tizen.NUI.Components/Attributes/InputFieldAttributes.cs +++ b/src/Tizen.NUI.Components/Style/InputFieldStyle.cs @@ -77,11 +77,7 @@ namespace Tizen.NUI.Components /// 6 /// 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 ImageViewStyle BackgroundImageAttributes - { - get; - set; - } + public ImageViewStyle BackgroundImageAttributes { get; set; } /// /// Gets or sets input box attributes of input field. @@ -89,11 +85,7 @@ namespace Tizen.NUI.Components /// 6 /// 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 TextFieldStyle InputBoxAttributes - { - get; - set; - } + public TextFieldStyle InputBoxAttributes { get; set; } /// /// Gets or sets space. @@ -101,11 +93,7 @@ namespace Tizen.NUI.Components /// 6 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public int? Space - { - get; - set; - } + public int? Space { get; set; } /// /// Attributes's clone function. diff --git a/src/Tizen.NUI.Components/Attributes/LoadingAttributes.cs b/src/Tizen.NUI.Components/Style/LoadingStyle.cs similarity index 100% rename from src/Tizen.NUI.Components/Attributes/LoadingAttributes.cs rename to src/Tizen.NUI.Components/Style/LoadingStyle.cs diff --git a/src/Tizen.NUI.Components/Attributes/PaginationAttributes.cs b/src/Tizen.NUI.Components/Style/PaginationStyle.cs similarity index 100% rename from src/Tizen.NUI.Components/Attributes/PaginationAttributes.cs rename to src/Tizen.NUI.Components/Style/PaginationStyle.cs diff --git a/src/Tizen.NUI.Components/Attributes/PopupAttributes.cs b/src/Tizen.NUI.Components/Style/PopupStyle.cs similarity index 100% rename from src/Tizen.NUI.Components/Attributes/PopupAttributes.cs rename to src/Tizen.NUI.Components/Style/PopupStyle.cs diff --git a/src/Tizen.NUI.Components/Attributes/ProgressAttributes.cs b/src/Tizen.NUI.Components/Style/ProgressStyle.cs similarity index 100% rename from src/Tizen.NUI.Components/Attributes/ProgressAttributes.cs rename to src/Tizen.NUI.Components/Style/ProgressStyle.cs diff --git a/src/Tizen.NUI.Components/Attributes/ScrollbarAttributes.cs b/src/Tizen.NUI.Components/Style/ScrollbarStyle.cs similarity index 100% rename from src/Tizen.NUI.Components/Attributes/ScrollbarAttributes.cs rename to src/Tizen.NUI.Components/Style/ScrollbarStyle.cs diff --git a/src/Tizen.NUI.Components/Attributes/SliderAttributes.cs b/src/Tizen.NUI.Components/Style/SliderStyle.cs similarity index 99% rename from src/Tizen.NUI.Components/Attributes/SliderAttributes.cs rename to src/Tizen.NUI.Components/Style/SliderStyle.cs index 7b94976..c335ec2 100755 --- a/src/Tizen.NUI.Components/Attributes/SliderAttributes.cs +++ b/src/Tizen.NUI.Components/Style/SliderStyle.cs @@ -33,7 +33,7 @@ namespace Tizen.NUI.Components [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty IndicatorTypeProperty = BindableProperty.Create("IndicatorType", typeof(IndicatorType?), typeof(SliderStyle), null, propertyChanged: (bindable, oldValue, newValue) => { - var instance = (Tizen.NUI.Components.SliderStyle)bindable; + var instance = (SliderStyle)bindable; if (newValue != null) { instance.privateIndicatorType = (IndicatorType)newValue; diff --git a/src/Tizen.NUI.Components/Attributes/SwitchAttributes.cs b/src/Tizen.NUI.Components/Style/SwitchStyle.cs similarity index 100% rename from src/Tizen.NUI.Components/Attributes/SwitchAttributes.cs rename to src/Tizen.NUI.Components/Style/SwitchStyle.cs diff --git a/src/Tizen.NUI.Components/Attributes/TabAttributes.cs b/src/Tizen.NUI.Components/Style/TabStyle.cs similarity index 100% rename from src/Tizen.NUI.Components/Attributes/TabAttributes.cs rename to src/Tizen.NUI.Components/Style/TabStyle.cs diff --git a/src/Tizen.NUI.Components/Attributes/ToastAttributes.cs b/src/Tizen.NUI.Components/Style/ToastStyle.cs similarity index 100% rename from src/Tizen.NUI.Components/Attributes/ToastAttributes.cs rename to src/Tizen.NUI.Components/Style/ToastStyle.cs diff --git a/src/Tizen.NUI/src/public/BaseComponents/Style/ImageViewAttributes.cs b/src/Tizen.NUI/src/public/BaseComponents/Style/ImageViewStyle.cs similarity index 100% rename from src/Tizen.NUI/src/public/BaseComponents/Style/ImageViewAttributes.cs rename to src/Tizen.NUI/src/public/BaseComponents/Style/ImageViewStyle.cs diff --git a/src/Tizen.NUI/src/public/BaseComponents/Style/TextFieldAttributes.cs b/src/Tizen.NUI/src/public/BaseComponents/Style/TextFieldStyle.cs similarity index 99% rename from src/Tizen.NUI/src/public/BaseComponents/Style/TextFieldAttributes.cs rename to src/Tizen.NUI/src/public/BaseComponents/Style/TextFieldStyle.cs index 3ecca12..0a13350 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/Style/TextFieldAttributes.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/Style/TextFieldStyle.cs @@ -107,7 +107,7 @@ namespace Tizen.NUI.BaseComponents }); /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty FontFamilySelectorProperty = BindableProperty.Create("FontFamily", typeof(Selector), typeof(TextFieldStyle), null, propertyChanged: (bindable, oldValue, newValue) => + public static readonly BindableProperty FontFamilySelectorProperty = BindableProperty.Create("FontFamilySelector", typeof(Selector), typeof(TextFieldStyle), null, propertyChanged: (bindable, oldValue, newValue) => { var textFieldStyle = (TextFieldStyle)bindable; if (null == textFieldStyle.fontFamilySelector) diff --git a/src/Tizen.NUI/src/public/BaseComponents/Style/TextLabelAttributes.cs b/src/Tizen.NUI/src/public/BaseComponents/Style/TextLabelStyle.cs similarity index 100% rename from src/Tizen.NUI/src/public/BaseComponents/Style/TextLabelAttributes.cs rename to src/Tizen.NUI/src/public/BaseComponents/Style/TextLabelStyle.cs diff --git a/src/Tizen.NUI/src/public/BaseComponents/Style/ViewAttributes.cs b/src/Tizen.NUI/src/public/BaseComponents/Style/ViewStyle.cs similarity index 100% rename from src/Tizen.NUI/src/public/BaseComponents/Style/ViewAttributes.cs rename to src/Tizen.NUI/src/public/BaseComponents/Style/ViewStyle.cs diff --git a/src/Tizen.NUI/src/public/BaseComponents/TextFieldBindableProperty.cs b/src/Tizen.NUI/src/public/BaseComponents/TextFieldBindableProperty.cs index f084ccb..8fad3fb 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/TextFieldBindableProperty.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/TextFieldBindableProperty.cs @@ -262,7 +262,9 @@ namespace Tizen.NUI.BaseComponents var textField = (TextField)bindable; if (newValue != null) { - Tizen.NUI.Object.SetProperty(textField.swigCPtr, TextField.Property.PLACEHOLDER_TEXT_COLOR, new Tizen.NUI.PropertyValue((Vector4)newValue)); + Color color = (Color)newValue; + Vector4 vector = new Vector4(color.R, color.G, color.B, color.A); + Tizen.NUI.Object.SetProperty(textField.swigCPtr, TextField.Property.PLACEHOLDER_TEXT_COLOR, new Tizen.NUI.PropertyValue(vector)); } }, defaultValueCreator: (bindable) => @@ -313,7 +315,9 @@ namespace Tizen.NUI.BaseComponents var textField = (TextField)bindable; if (newValue != null) { - Tizen.NUI.Object.SetProperty(textField.swigCPtr, TextField.Property.PRIMARY_CURSOR_COLOR, new Tizen.NUI.PropertyValue((Vector4)newValue)); + Color color = (Color)newValue; + Vector4 vector = new Vector4(color.R, color.G, color.B, color.A); + Tizen.NUI.Object.SetProperty(textField.swigCPtr, TextField.Property.PRIMARY_CURSOR_COLOR, new Tizen.NUI.PropertyValue(vector)); } }, defaultValueCreator: (bindable) => -- 2.7.4