{
get
{
- return Style.Text.Text.GetValue(ControlState);
+ return Style.Text.Text?.GetValue(ControlState);
}
set
{
{
Style.Text.TranslatableText = new Selector<string>();
}
- Style.Text.TranslatableText.All = value;
+ if (Style.Text.TranslatableText != null)
+ {
+ Style.Text.TranslatableText.All = value;
+ }
}
}
}
{
Style.Text.TextColor = new Selector<Color>();
}
- Style.Text.TextColor.All = value;
+ if (Style.Text.TextColor != null)
+ {
+ Style.Text.TextColor.All = value;
+ }
}
}
/// <summary>
{
Style.Icon.ResourceUrl = new Selector<string>();
}
- Style.Icon.ResourceUrl.All = value;
+ if (Style.Icon.ResourceUrl != null)
+ {
+ Style.Icon.ResourceUrl.All = value;
+ }
}
}
}
if (childToRemove)
{
childToRemove.TouchEvent -= ListItemTouchEvent;
- dropDownMenuFullList.Remove(childToRemove);
+ dropDownMenuFullList?.Remove(childToRemove);
dropDownMenuFullList?.Layout?.RequestLayout();
}
}
data.IsSelected = false;
}
DropDownItemView listItemView = dropDownMenuFullList.GetChildAt((uint)selectedItemIndex) as DropDownItemView;
- data.IsSelected = false;
SetListItemToSelected(listItemView);
}
itemDataStyle.BackgroundColor = new Selector<Color>();
}
- itemDataStyle.BackgroundColor.Clone(value);
+ itemDataStyle.BackgroundColor?.Clone(value);
}
}
}
}
- imageView.ApplyStyle(imageControlStyle.Image);
+ imageView.ApplyStyle(imageControlStyle?.Image);
}
/// <summary>
{
inputFieldAttrs.InputBoxAttributes.TextColor = new Selector<Color>();
}
- inputFieldAttrs.InputBoxAttributes.TextColor.All = value;
+ if (null != inputFieldAttrs.InputBoxAttributes.TextColor)
+ {
+ inputFieldAttrs.InputBoxAttributes.TextColor.All = value;
+ }
textField.TextColor = value;
}
}
{
inputFieldAttrs.InputBoxAttributes.PlaceholderTextColor = new Selector<Color>();
}
- inputFieldAttrs.InputBoxAttributes.PlaceholderTextColor.All = value;
+ if (null != inputFieldAttrs.InputBoxAttributes.PlaceholderTextColor)
+ {
+ inputFieldAttrs.InputBoxAttributes.PlaceholderTextColor.All = value;
+ }
textField.PlaceholderTextColor = value;
}
}
{
inputFieldAttrs.InputBoxAttributes.PrimaryCursorColor = new Selector<Color>();
}
- inputFieldAttrs.InputBoxAttributes.PrimaryCursorColor.All = value;
+ if (null != inputFieldAttrs.InputBoxAttributes.PrimaryCursorColor)
+ {
+ inputFieldAttrs.InputBoxAttributes.PrimaryCursorColor.All = value;
+ }
textField.PrimaryCursorColor = value;
}
}
{
inputFieldAttrs.BackgroundImageAttributes.ResourceUrl = new Selector<string>();
}
- inputFieldAttrs.BackgroundImageAttributes.ResourceUrl.All = value;
+ if (inputFieldAttrs.BackgroundImageAttributes.ResourceUrl != null)
+ {
+ inputFieldAttrs.BackgroundImageAttributes.ResourceUrl.All = value;
+ }
RelayoutRequest();
}
}
{
inputFieldAttrs.BackgroundImageAttributes.Border = new Selector<Rectangle>();
}
- inputFieldAttrs.BackgroundImageAttributes.Border.All = value;
+ if (inputFieldAttrs.BackgroundImageAttributes.Border != null)
+ {
+ inputFieldAttrs.BackgroundImageAttributes.Border.All = value;
+ }
RelayoutRequest();
}
}
{
instance.Style.Buttons.Text.PointSize = new Selector<float?>();
}
- instance.Style.Buttons.Text.PointSize.All = (float)newValue;
+ if (instance.Style.Buttons.Text.PointSize != null)
+ {
+ instance.Style.Buttons.Text.PointSize.All = (float)newValue;
+ }
instance.UpdateButton();
}
},
{
instance.Style.Buttons.Text.TextColor = new Selector<Color>();
}
- instance.Style.Buttons.Text.TextColor.All = (Color)newValue;
+ if (instance.Style.Buttons.Text.TextColor != null)
+ {
+ instance.Style.Buttons.Text.TextColor.All = (Color)newValue;
+ }
//instance.UpdateButton();
}
},
{
instance.Style.Buttons.Background.ResourceUrl = new Selector<string>();
}
- instance.Style.Buttons.Background.ResourceUrl.All = (string)newValue;
+ if (instance.Style.Buttons.Background.ResourceUrl != null)
+ {
+ instance.Style.Buttons.Background.ResourceUrl.All = (string)newValue;
+ }
instance.UpdateButton();
}
},
{
instance.Style.Buttons.Background.Border = new Selector<Rectangle>();
}
- instance.Style.Buttons.Background.Border.All = (Rectangle)newValue;
+ if (instance.Style.Buttons.Background.Border != null)
+ {
+ instance.Style.Buttons.Background.Border.All = (Rectangle)newValue;
+ }
instance.UpdateButton();
}
},
{
Style.Title.Text = new StringSelector();
}
- Style.Title.Text.All = value;
+ if (Style.Title.Text != null)
+ {
+ Style.Title.Text.All = value;
+ }
//RelayoutRequest();
}
{
Style.Title.PointSize = new FloatSelector();
}
- Style.Title.PointSize.All = value;
+ if (Style.Title.PointSize != null)
+ {
+ Style.Title.PointSize.All = value;
+ }
//RelayoutRequest();
}
}
{
Style.Title.TextColor = new ColorSelector();
}
- Style.Title.TextColor.All = value;
+ if (Style.Title.TextColor != null)
+ {
+ Style.Title.TextColor.All = value;
+ }
//RelayoutRequest();
}
}
btn.ClickEvent += ButtonClickEvent;
this.Add(btn);
- buttonList.Add(btn);
+ buttonList?.Add(btn);
}
int pos = 0;
{
Style.Track.ResourceUrl = new StringSelector();
}
- Style.Track.ResourceUrl.All = value;
+ if (Style.Track.ResourceUrl != null)
+ {
+ Style.Track.ResourceUrl.All = value;
+ }
//RelayoutRequest();
}
}
{
Style.Progress.ResourceUrl = new StringSelector();
}
- Style.Progress.ResourceUrl.All = value;
+ if (Style.Progress.ResourceUrl != null)
+ {
+ Style.Progress.ResourceUrl.All = value;
+ }
//RelayoutRequest();
}
}
{
Style.Buffer.ResourceUrl = new StringSelector();
}
+ if (Style.Buffer.ResourceUrl != null)
+ {
Style.Buffer.ResourceUrl.All = value;
+ }
RelayoutRequest();
}
}
{
Style.Track.BackgroundColor = new ColorSelector();
}
+ if (Style.Track.BackgroundColor != null)
+ {
Style.Track.BackgroundColor.All = value;
+ }
//RelayoutRequest();
}
}
{
Style.Progress.BackgroundColor = new ColorSelector();
}
- Style.Progress.BackgroundColor.All = value;
+ if (null != Style.Progress.BackgroundColor)
+ {
+ Style.Progress.BackgroundColor.All = value;
+ }
//RelayoutRequest();
}
}
{
Style.Buffer.BackgroundColor = new ColorSelector();
}
- Style.Buffer.BackgroundColor.All = value;
+ if (null != Style.Buffer.BackgroundColor)
+ {
+ Style.Buffer.BackgroundColor.All = value;
+ }
//RelayoutRequest();
}
}
{
Style.Thumb.Size = new Size();
}
- if (thumbImage != null)
+ if (Style.Thumb.Size != null && thumbImage != null)
{
Style.Thumb.Size.Width = value.Width;
Style.Thumb.Size.Height = value.Height;
{
Style.Track.ResourceUrl = new StringSelector();
}
- Style.Track.ResourceUrl.All = value;
+ if (Style.Track.ResourceUrl != null)
+ {
+ Style.Track.ResourceUrl.All = value;
+ }
}
RelayoutRequest();
}
SelectButtonStyle tempAttributes = StyleManager.Instance.GetAttributes(style) as SelectButtonStyle;
if (tempAttributes != null)
{
- Style.CopyFrom(tempAttributes);
+ Style?.CopyFrom(tempAttributes);
UpdateUIContent();
}
}
selectableImage.RaiseToTop();
}
+ if (style != null)
+ {
+ Style.SelectableImage.PositionUsesPivotPoint = true;
+ Style.SelectableImage.ParentOrigin = Tizen.NUI.ParentOrigin.TopLeft;
+ Style.SelectableImage.PivotPoint = Tizen.NUI.PivotPoint.TopLeft;
- Style.SelectableImage.PositionUsesPivotPoint = true;
- Style.SelectableImage.ParentOrigin = Tizen.NUI.ParentOrigin.TopLeft;
- Style.SelectableImage.PivotPoint = Tizen.NUI.PivotPoint.TopLeft;
-
- Style.IsSelectable = true;
+ Style.IsSelectable = true;
+ }
LayoutDirectionChanged += SelectButtonLayoutDirectionChanged;
}
private void UpdateTextAttributes()
{
- if (Style.Text != null)
+ if (Style != null && Style.Text != null && selectableImage != null)
{
Style.Text.PositionUsesPivotPoint = true;
Style.Text.ParentOrigin = Tizen.NUI.ParentOrigin.TopLeft;
int textPaddingLeft = Style.Text.Padding.Start;
int textPaddingRight = Style.Text.Padding.End;
int pos = 0;
- if (LayoutDirection == ViewLayoutDirectionType.RTL)
- {
- Style.Text.HorizontalAlignment = HorizontalAlignment.End;
- Style.Text.Position.X = textPaddingRight;
- pos = (int)(Style.Text.Size.Width) + textPaddingLeft + textPaddingRight;
- if (Style.Icon.Padding != null)
- {
- pos += Style.Icon.Padding.End;
- }
-
- }
- else if (LayoutDirection == ViewLayoutDirectionType.LTR)
+ if (Style.Text != null && Style.Text.Position != null)
{
- Style.Text.HorizontalAlignment = HorizontalAlignment.Begin;
- Style.Text.Position.X = iconWidth + textPaddingLeft;
- if (Style.Icon.Padding != null)
- {
- Style.Text.Position.X += (Style.Icon.Padding.Start + Style.Icon.Padding.End);
- pos = Style.Icon.Padding.Start;
- }
+ if (LayoutDirection == ViewLayoutDirectionType.RTL)
+ {
+ Style.Text.HorizontalAlignment = HorizontalAlignment.End;
+ Style.Text.Position.X = textPaddingRight;
+ pos = (int)(Style.Text.Size.Width) + textPaddingLeft + textPaddingRight;
+ if (Style.Icon.Padding != null)
+ {
+ pos += Style.Icon.Padding.End;
+ }
+
+ }
+ else if (LayoutDirection == ViewLayoutDirectionType.LTR)
+ {
+ Style.Text.HorizontalAlignment = HorizontalAlignment.Begin;
+ Style.Text.Position.X = iconWidth + textPaddingLeft;
+ if (Style.Icon.Padding != null)
+ {
+ Style.Text.Position.X += (Style.Icon.Padding.Start + Style.Icon.Padding.End);
+ pos = Style.Icon.Padding.Start;
+ }
+ }
}
selectableImage.Position2D.X = pos;
{
Style.Thumb.ResourceUrl = new StringSelector();
}
- Style.Thumb.ResourceUrl.All = value;
+ if (Style.Thumb.ResourceUrl != null)
+ {
+ Style.Thumb.ResourceUrl.All = value;
+ }
}
}
{
Style.Track.BackgroundColor = new ColorSelector();
}
- Style.Track.BackgroundColor.All = value;
+ if (Style.Track.BackgroundColor != null)
+ {
+ Style.Track.BackgroundColor.All = value;
+ }
}
}
{
Style.Progress.BackgroundColor = new ColorSelector();
}
- Style.Progress.BackgroundColor.All = value;
+ if (Style.Progress.BackgroundColor != null)
+ {
+ Style.Progress.BackgroundColor.All = value;
+ }
}
}
{
Style.LowIndicatorImage.ResourceUrl = new StringSelector();
}
- Style.LowIndicatorImage.ResourceUrl.All = value;
+ if (Style.LowIndicatorImage.ResourceUrl != null)
+ {
+ Style.LowIndicatorImage.ResourceUrl.All = value;
+ }
}
}
{
Style.HighIndicatorImage.ResourceUrl = new StringSelector();
}
- Style.HighIndicatorImage.ResourceUrl.All = value;
+ if (Style.HighIndicatorImage.ResourceUrl != null)
+ {
+ Style.HighIndicatorImage.ResourceUrl.All = value;
+ }
}
}
{
Style.LowIndicator.Text = new StringSelector();
}
- Style.LowIndicator.Text.All = value;
+ if (Style.LowIndicator.Text != null)
+ {
+ Style.LowIndicator.Text.All = value;
+ }
}
}
{
Style.HighIndicator.Text = new StringSelector();
}
- Style.HighIndicator.Text.All = value;
+ if (Style.HighIndicator.Text != null)
+ {
+ Style.HighIndicator.Text.All = value;
+ }
}
}
{
Style.Track.ResourceUrl = new StringSelector();
}
- Style.Track.ResourceUrl.All = value;
+ if (Style.Track.ResourceUrl != null)
+ {
+ Style.Track.ResourceUrl.All = value;
+ }
}
}
}
{
Style.Thumb.ResourceUrl = new StringSelector();
}
- Style.Thumb.ResourceUrl.All = value;
+ if (Style.Thumb.ResourceUrl != null)
+ {
+ Style.Thumb.ResourceUrl.All = value;
+ }
}
}
}
{
Style.UnderLine.BackgroundColor = new ColorSelector();
}
- Style.UnderLine.BackgroundColor.All = value;
+ if (Style.UnderLine.BackgroundColor != null)
+ {
+ Style.UnderLine.BackgroundColor.All = value;
+ }
//RelayoutRequest();
}
}
{
Style.Text.PointSize = new FloatSelector();
}
+ if (Style.Text.PointSize != null)
+ {
Style.Text.PointSize.All = value;
+ }
//RelayoutRequest();
}
}
{
Style.Text.TextColor = new ColorSelector();
}
- Style.Text.TextColor.All = value;
+ if (Style.Text.TextColor != null)
+ {
+ Style.Text.TextColor.All = value;
+ }
//RelayoutRequest();
}
}
{
Style.Text.PointSize = new FloatSelector();
}
+ if (null != Style.Text.PointSize)
+ {
Style.Text.PointSize.All = value;
+ }
}
}
{
Style.Text.TextColor = new ColorSelector();
}
- Style.Text.TextColor.All = value;
+ if (null != Style.Text.TextColor)
+ {
+ Style.Text.TextColor.All = value;
+ }
//RelayoutRequest();
}
}