private bool? isSelected;
private bool? isEnabled;
private Button.IconOrientation? iconRelativeOrientation;
+ private Extents iconPadding;
+ private Extents textPadding;
/// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
var buttonStyle = (ButtonStyle)bindable;
return buttonStyle.iconRelativeOrientation;
});
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty IconPaddingProperty = BindableProperty.Create("IconPadding", typeof(Extents), typeof(ButtonStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var buttonStyle = (ButtonStyle)bindable;
+ buttonStyle.iconPadding = (Extents)newValue;
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var buttonStyle = (ButtonStyle)bindable;
+ return buttonStyle.iconPadding;
+ });
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty TextPaddingProperty = BindableProperty.Create("TextPadding", typeof(Extents), typeof(ButtonStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var buttonStyle = (ButtonStyle)bindable;
+ buttonStyle.textPadding = (Extents)newValue;
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var buttonStyle = (ButtonStyle)bindable;
+ return buttonStyle.textPadding;
+ });
/// <summary>
/// Creates a new instance of a ButtonStyle.
[EditorBrowsable(EditorBrowsableState.Never)]
public ButtonStyle() : base()
{
- InitSubAttributes();
+ InitSubStyle();
}
+
/// <summary>
/// Creates a new instance of a ButtonStyle with style.
/// </summary>
return;
}
- IsSelectable = style.IsSelectable;
- IconRelativeOrientation = style.IconRelativeOrientation;
-
- InitSubAttributes();
+ InitSubStyle();
- Overlay.CopyFrom(style.Overlay);
- Text.CopyFrom(style.Text);
- Icon.CopyFrom(style.Icon);
+ this.CopyFrom(style);
}
/// <summary>
/// Overlay image's Style.
/// <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 ImageViewStyle Overlay
- {
- get;
- set;
- }
+ public ImageViewStyle Overlay { get; set; }
+
/// <summary>
/// Text's 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)]
- public TextLabelStyle Text
- {
- get;
- set;
- }
+ public TextLabelStyle Text { get; set; }
+
/// <summary>
/// Icon's 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)]
- public ImageViewStyle Icon
- {
- get;
- set;
- }
+ public ImageControlStyle Icon { get; set; }
/// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
public bool? IsSelectable
{
- get
- {
- bool? temp = (bool?)GetValue(IsSelectableProperty);
- return temp;
- }
- set
- {
- SetValue(IsSelectableProperty, value);
- }
+ get => (bool?)GetValue(IsSelectableProperty);
+ set => SetValue(IsSelectableProperty, value);
}
/// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
public bool? IsSelected
{
- get
- {
- bool? temp = (bool?)GetValue(IsSelectedProperty);
- return temp;
- }
- set
- {
- SetValue(IsSelectedProperty, value);
- }
+ get => (bool?)GetValue(IsSelectedProperty);
+ set => SetValue(IsSelectedProperty, value);
}
/// <summary>
[EditorBrowsable(EditorBrowsableState.Never)]
public bool? IsEnabled
{
- get
- {
- bool? temp = (bool?)GetValue(IsEnabledProperty);
- return temp;
- }
- set
- {
- SetValue(IsEnabledProperty, value);
- }
+ get => (bool?)GetValue(IsEnabledProperty);
+ set => SetValue(IsEnabledProperty, value);
}
/// <summary>
[EditorBrowsable(EditorBrowsableState.Never)]
public Button.IconOrientation? IconRelativeOrientation
{
+ get => (Button.IconOrientation?)GetValue(IconRelativeOrientationProperty);
+ set => SetValue(IconRelativeOrientationProperty, value);
+ }
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public Extents IconPadding
+ {
get
{
- Button.IconOrientation? temp = (Button.IconOrientation?)GetValue(IconRelativeOrientationProperty);
- return temp;
+ Extents padding = (Extents)GetValue(IconPaddingProperty);
+ return (null != padding) ? padding : iconPadding = new Extents((ushort start, ushort end, ushort top, ushort bottom) => { IconPadding = new Extents(start, end, top, bottom); }, 0, 0, 0, 0);
}
- set
+ set => SetValue(IconPaddingProperty, value);
+ }
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public Extents TextPadding
+ {
+ get
{
- SetValue(IconRelativeOrientationProperty, value);
+ Extents padding = (Extents)GetValue(TextPaddingProperty);
+ return (null != padding) ? padding : textPadding = new Extents((ushort start, ushort end, ushort top, ushort bottom) => { TextPadding = new Extents(start, end, top, bottom); }, 0, 0, 0, 0);
}
+ set => SetValue(TextPaddingProperty, value);
}
/// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
{
base.CopyFrom(bindableObject);
- ButtonStyle buttonAttributes = bindableObject as ButtonStyle;
+ ButtonStyle buttonStyle = bindableObject as ButtonStyle;
- if (null != buttonAttributes)
+ if (null != buttonStyle)
{
- if (null != buttonAttributes.Overlay)
+ if (null != buttonStyle.Overlay)
{
- Overlay.CopyFrom(buttonAttributes.Overlay);
+ Overlay.CopyFrom(buttonStyle.Overlay);
}
- if (null != buttonAttributes.Text)
+ if (null != buttonStyle.Text)
{
- Text.CopyFrom(buttonAttributes.Text);
+ Text.CopyFrom(buttonStyle.Text);
}
- if (null != buttonAttributes.Icon)
+ if (null != buttonStyle.Icon)
{
- Icon.CopyFrom(buttonAttributes.Icon);
+ Icon.CopyFrom(buttonStyle.Icon);
}
+
+ IsSelectable = buttonStyle.IsSelectable;
+ IconRelativeOrientation = buttonStyle.IconRelativeOrientation;
}
}
- private void InitSubAttributes()
+ private void InitSubStyle()
{
Overlay = new ImageViewStyle()
{
};
Text.PropertyChanged += SubStyleCalledEvent;
- Icon = new ImageViewStyle()
+ Icon = new ImageControlStyle()
{
PositionUsesPivotPoint = true,
ParentOrigin = Tizen.NUI.ParentOrigin.Center,
PivotPoint = Tizen.NUI.PivotPoint.Center,
- WidthResizePolicy = ResizePolicyType.UseNaturalSize,
- HeightResizePolicy = ResizePolicyType.UseNaturalSize,
+ WidthResizePolicy = ResizePolicyType.FitToChildren,
+ HeightResizePolicy = ResizePolicyType.FitToChildren,
};
Icon.PropertyChanged += SubStyleCalledEvent;
}
namespace Tizen.NUI.Components
{
/// <summary>
- /// ButtonAttributes is a class which saves Button's ux data.
+ /// ControlStyle is a base class of NUI.Components 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)]
public class ControlStyle : ViewStyle
{
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty BackgroundImageProperty = BindableProperty.Create("ControlBackgroundImage", typeof(Selector<string>), typeof(ControlStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var controlStyle = (ControlStyle)bindable;
+ if (null == controlStyle.backgroundImage) controlStyle.backgroundImage = new Selector<string>();
+ controlStyle.backgroundImage.Clone((Selector<string>)newValue);
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var controlStyle = (ControlStyle)bindable;
+ return controlStyle.backgroundImage;
+ });
+ /// 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 BackgroundColorProperty = BindableProperty.Create("ControlBackgroundColor", typeof(Selector<Color>), typeof(ControlStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var controlStyle = (ControlStyle)bindable;
+ if (null == controlStyle.backgroundColor) controlStyle.backgroundColor = new Selector<Color>();
+ controlStyle.backgroundColor.Clone((Selector<Color>)newValue);
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var controlStyle = (ControlStyle)bindable;
+ return controlStyle.backgroundColor;
+ });
+ /// 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 BackgroundImageBorderProperty = BindableProperty.Create("ControlBackgroundImageBorder", typeof(Selector<Rectangle>), typeof(ControlStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var controlStyle = (ControlStyle)bindable;
+ if (null == controlStyle.backgroundImageBorder) controlStyle.backgroundImageBorder = new Selector<Rectangle>();
+ controlStyle.backgroundImageBorder.Clone((Selector<Rectangle>)newValue);
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var controlStyle = (ControlStyle)bindable;
+ return controlStyle.backgroundImageBorder;
+ });
+ private Selector<string> backgroundImage;
+ private Selector<Rectangle> backgroundImageBorder;
+ private Selector<Color> backgroundColor;
/// <summary>
- /// Creates a new instance of a ButtonStyle.
+ /// Creates a new instance of a ControlStyle.
/// </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)]
public ControlStyle() : base()
{
- InitSubAttributes();
+ InitSubstyle();
}
+
/// <summary>
- /// Creates a new instance of a ButtonStyle with style.
+ /// Creates a new instance of a ControlStyle with style.
/// </summary>
- /// <param name="style">Create ButtonStyle by style customized by user.</param>
+ /// <param name="style">Create ControlStyle by style customized by user.</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)]
public ControlStyle(ControlStyle style) : base(style)
{
- if(style == null)
+ if(null == style) return;
+
+ InitSubstyle();
+
+ this.CopyFrom(style);
+ }
+
+ /// <summary>Background image resource.</summary>
+ /// 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 Selector<string> BackgroundImage
+ {
+ get
{
- return;
+ Selector<string> image = (Selector<string>)GetValue(BackgroundImageProperty);
+ return (null != image) ? image : backgroundImage = new Selector<string>();
}
+ set => SetValue(BackgroundImageProperty, value);
+ }
- InitSubAttributes();
-
- Shadow.CopyFrom(style.Shadow);
- Background.CopyFrom(style.Background);
+ /// <summary>Background image border.</summary>
+ /// 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 Selector<Rectangle> BackgroundImageBorder
+ {
+ get
+ {
+ Selector<Rectangle> boder = (Selector<Rectangle>)GetValue(BackgroundImageBorderProperty);
+ return (null != boder) ? boder : backgroundImageBorder = new Selector<Rectangle>();
+ }
+ set => SetValue(BackgroundImageBorderProperty, value);
}
- /// <summary>
- /// Shadow image's Style.
- /// </summary>
- /// <since_tizen> 6 </since_tizen>
+ /// <summary>Background image color. </summary>
/// 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 ImageViewStyle Shadow
+ public new Selector<Color> BackgroundColor
{
- get;
- set;
+ get
+ {
+ Selector<Color> color = (Selector<Color>)GetValue(BackgroundColorProperty);
+ return (null != color) ? color : backgroundColor = new Selector<Color>();
+ }
+ set => SetValue(BackgroundColorProperty, value);
}
+
/// <summary>
- /// Background image's Style.
+ /// Shadow image's Style.
/// </summary>
/// <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.
+ /// 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 ImageViewStyle Background
- {
- get;
- set;
- }
+ public ImageViewStyle Shadow { get; set; }
/// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
{
Shadow.CopyFrom(controlStyle.Shadow);
}
-
- if (null != controlStyle.Background)
+ if (null != controlStyle.BackgroundImage)
+ {
+ if (null == BackgroundImage) BackgroundImage = new Selector<string>();
+ BackgroundImage.Clone(controlStyle.BackgroundImage);
+ }
+ if (null != controlStyle.BackgroundImageBorder)
{
- Background.CopyFrom(controlStyle.Background);
+ if (null == BackgroundImageBorder) BackgroundImageBorder = new Selector<Rectangle>();
+ BackgroundImageBorder.Clone(controlStyle.BackgroundImageBorder);
+ }
+ if (null != controlStyle.BackgroundColor)
+ {
+ if (null == BackgroundColor) BackgroundColor = new Selector<Color>();
+ BackgroundColor.Clone(controlStyle.BackgroundColor);
}
}
}
- private void InitSubAttributes()
+ private void InitSubstyle()
{
Shadow = new ImageViewStyle()
{
HeightResizePolicy = ResizePolicyType.FillToParent
};
Shadow.PropertyChanged += SubStyleCalledEvent;
-
- Background = new ImageViewStyle()
- {
- PositionUsesPivotPoint = true,
- ParentOrigin = Tizen.NUI.ParentOrigin.Center,
- PivotPoint = Tizen.NUI.PivotPoint.Center,
- WidthResizePolicy = ResizePolicyType.FillToParent,
- HeightResizePolicy = ResizePolicyType.FillToParent
- };
- Background.PropertyChanged += SubStyleCalledEvent;
}
private void SubStyleCalledEvent(object sender, global::System.EventArgs e)
[EditorBrowsable(EditorBrowsableState.Never)]
public class ImageControlStyle : ControlStyle
{
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty ResourceUrlProperty = BindableProperty.Create("ImageControlResourceUrl", typeof(Selector<string>), typeof(ImageControlStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var imageControlStyle = (ImageControlStyle)bindable;
+ if (null == imageControlStyle.resourceUrlSelector) imageControlStyle.resourceUrlSelector = new Selector<string>();
+ imageControlStyle.resourceUrlSelector.Clone((Selector<string>)newValue);
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var imageControlStyle = (ImageControlStyle)bindable;
+ return imageControlStyle.resourceUrlSelector;
+ });
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty BorderProperty = BindableProperty.Create("ImageControlBorder", typeof(Selector<Rectangle>), typeof(ImageControlStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var imageControlStyle = (ImageControlStyle)bindable;
+ if (null == imageControlStyle.borderSelector) imageControlStyle.borderSelector = new Selector<Rectangle>();
+ imageControlStyle.borderSelector.Clone((Selector<Rectangle>)newValue);
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var imageControlStyle = (ImageControlStyle)bindable;
+ return imageControlStyle.borderSelector;
+ });
+
+ private Selector<string> resourceUrlSelector;
+ private Selector<Rectangle> borderSelector;
+
/// <summary>
/// Creates a new instance of a ImageControlStyle.
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
public ImageControlStyle() : base()
{
- InitSubStyle();
}
+
/// <summary>
/// Creates a new instance of a ImageControlStyle with style.
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
public ImageControlStyle(ImageControlStyle style) : base(style)
{
- if(style == null)
- {
- return;
- }
+ if(null == style) return;
- InitSubStyle();
+ this.CopyFrom(style);
+ }
- Image.CopyFrom(style.Image);
+ /// <summary>
+ /// Image URL.
+ /// </summary>
+ /// 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 Selector<string> ResourceUrl
+ {
+ get
+ {
+ Selector<string> url = (Selector<string>)GetValue(ResourceUrlProperty);
+ return (null != url) ? url : resourceUrlSelector = new Selector<string>();
+ }
+ set => SetValue(ResourceUrlProperty, value);
}
/// <summary>
- /// Image's Style.
+ /// Image border.
/// </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)]
- public ImageViewStyle Image
+ public Selector<Rectangle> Border
{
- get;
- set;
+ get
+ {
+ Selector<Rectangle> border = (Selector<Rectangle>)GetValue(BorderProperty);
+ return (null != border) ? border : borderSelector = new Selector<Rectangle>();
+ }
+ set => SetValue(BorderProperty, value);
}
/// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
if (null != imageControlStyle)
{
- if (null != imageControlStyle.Image)
+ if (null != imageControlStyle.ResourceUrl)
{
- Image.CopyFrom(imageControlStyle.Image);
+ if (null == ResourceUrl) ResourceUrl = new Selector<string>();
+ ResourceUrl.Clone(imageControlStyle.ResourceUrl);
+ }
+ if (null != imageControlStyle.Border)
+ {
+ if (null == Border) Border = new Selector<Rectangle>();
+ Border.Clone(imageControlStyle.Border);
}
}
}
-
- private void InitSubStyle()
- {
- Image = new ImageViewStyle();
- Image.PropertyChanged += SubStyleCalledEvent;
- }
-
- private void SubStyleCalledEvent(object sender, global::System.EventArgs e)
- {
- OnPropertyChanged();
- }
}
}
Shadow.CopyFrom(popupAttributes.Shadow);
}
- if (popupAttributes.Background != null)
- {
- Background.CopyFrom(popupAttributes.Background);
- }
-
if (popupAttributes.Title != null)
{
Title.CopyFrom(popupAttributes.Title);
PivotPoint = Tizen.NUI.PivotPoint.Center
};
- Background = new ImageViewStyle()
- {
- PositionUsesPivotPoint = true,
- ParentOrigin = Tizen.NUI.ParentOrigin.Center,
- PivotPoint = Tizen.NUI.PivotPoint.Center,
- WidthResizePolicy = ResizePolicyType.FillToParent,
- HeightResizePolicy = ResizePolicyType.FillToParent
- };
-
Title = new TextLabelStyle()
{
Size = new Size(0, 0),
+++ /dev/null
-/*
- * Copyright(c) 2019 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.Binding;
-
-namespace Tizen.NUI.Components
-{
- /// <summary>
- /// SelectButtonStyle is a class which saves SelectButton's ux data.
- /// </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)]
- public class SelectButtonStyle : ButtonStyle
- {
- /// <summary>
- /// Creates a new instance of a SelectButtonStyle.
- /// </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)]
- public SelectButtonStyle() : base()
- {
- IsSelectable = true;
- CreateSubStyles();
- }
- /// <summary>
- /// Creates a new instance of a SelectButtonStyle with style.
- /// </summary>
- /// <param name="style">Create SelectButtonStyle by style customized by user.</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)]
- public SelectButtonStyle(SelectButtonStyle style) : base(style)
- {
- if (style == null)
- {
- return;
- }
-
- CreateSubStyles();
-
- CopyFrom(style);
- }
-
- /// <summary>
- /// Selectable image's attributes.
- /// </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)]
- public ImageControlStyle SelectableImage
- {
- get;
- set;
- }
-
- /// 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)
- {
- base.CopyFrom(bindableObject);
-
- SelectButtonStyle selectButtonStyle = bindableObject as SelectButtonStyle;
-
- if (null != selectButtonStyle && null != selectButtonStyle.SelectableImage)
- {
- SelectableImage.CopyFrom(selectButtonStyle.SelectableImage);
- }
- }
-
- private void CreateSubStyles()
- {
- SelectableImage = new ImageControlStyle();
- }
- }
-}
/// <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 ImageViewStyle Track
- {
- get;
- set;
- }
+ public ImageViewStyle Track { get; set; }
/// <summary>
/// Get or set slided track.
/// <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 ImageViewStyle Progress
- {
- get;
- set;
- }
+ public ImageViewStyle Progress { get; set; }
/// <summary>
/// Get or set thumb.
/// <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 ImageViewStyle Thumb
- {
- get;
- set;
- }
-
- /// <summary>
- /// Get or set thumb background.
- /// </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)]
- public ImageViewStyle ThumbBackground
- {
- get;
- set;
- }
+ public ImageViewStyle Thumb { get; set; }
/// <summary>
/// Get or set low indicator image.
/// <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 ImageViewStyle LowIndicatorImage
- {
- get;
- set;
- }
+ public ImageViewStyle LowIndicatorImage { get; set; }
/// <summary>
/// Get or set high indicator image.
/// <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 ImageViewStyle HighIndicatorImage
- {
- get;
- set;
- }
+ public ImageViewStyle HighIndicatorImage { get; set; }
/// <summary>
/// Get or set low indicator text.
/// <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 TextLabelStyle LowIndicator
- {
- get;
- set;
- }
+ public TextLabelStyle LowIndicator { get; set; }
/// <summary>
/// Get or set high indicator text.
/// <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 TextLabelStyle HighIndicator
- {
- get;
- set;
- }
+ public TextLabelStyle HighIndicator { get; set; }
/// <summary>
/// Get or set Indicator type
[EditorBrowsable(EditorBrowsableState.Never)]
public IndicatorType? IndicatorType
{
- get
- {
- return (IndicatorType?)GetValue(IndicatorTypeProperty);
- }
- set
- {
- SetValue(IndicatorTypeProperty, value);
- }
- }
- private IndicatorType? privateIndicatorType
- {
- get;
- set;
+ get => (IndicatorType?)GetValue(IndicatorTypeProperty);
+ set => SetValue(IndicatorTypeProperty, value);
}
+ private IndicatorType? privateIndicatorType { get; set; }
+
/// <summary>
/// Get or set track thickness
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
public uint? TrackThickness
{
- get
- {
- return (uint?)GetValue(TrackThicknessProperty);
- }
- set
- {
- SetValue(TrackThicknessProperty, value);
- }
- }
- private uint? privateTrackThickness
- {
- get;
- set;
+ get => (uint?)GetValue(TrackThicknessProperty);
+ set => SetValue(TrackThicknessProperty, value);
}
+ private uint? privateTrackThickness { get; set; }
/// <summary>
/// Get or set space between track and indicator
[EditorBrowsable(EditorBrowsableState.Never)]
public uint? SpaceBetweenTrackAndIndicator
{
- get
- {
- return (uint?)GetValue(SpaceBetweenTrackAndIndicatorProperty);
- }
- set
- {
- SetValue(SpaceBetweenTrackAndIndicatorProperty, value);
- }
- }
- private uint? privateSpaceBetweenTrackAndIndicator
- {
- get;
- set;
+ get => (uint?)GetValue(SpaceBetweenTrackAndIndicatorProperty);
+ set => SetValue(SpaceBetweenTrackAndIndicatorProperty, value);
}
+ private uint? privateSpaceBetweenTrackAndIndicator { get; set; }
/// <summary>
/// Get or set space between track and indicator
[EditorBrowsable(EditorBrowsableState.Never)]
public Extents TrackPadding
{
- get
- {
- return (Extents)GetValue(TrackPaddingProperty);
- }
- set
- {
- SetValue(TrackPaddingProperty, value);
- }
+ get => (Extents)GetValue(TrackPaddingProperty);
+ set => SetValue(TrackPaddingProperty, value);
}
private Extents _trackPadding;
private Extents trackPadding
Thumb.CopyFrom(sliderAttributes.Thumb);
}
- if (sliderAttributes.ThumbBackground != null)
- {
- if (null == ThumbBackground)
- {
- ThumbBackground = new ImageViewStyle();
- }
- ThumbBackground.CopyFrom(sliderAttributes.ThumbBackground);
- }
-
if (sliderAttributes.LowIndicatorImage != null)
{
if (null == LowIndicatorImage)
Track = new ImageViewStyle();
Progress = new ImageViewStyle();
Thumb = new ImageViewStyle();
- ThumbBackground = new ImageViewStyle();
LowIndicatorImage = new ImageViewStyle();
HighIndicatorImage = new ImageViewStyle();
LowIndicator = new TextLabelStyle();
{
/// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- public static readonly BindableProperty IconRelativeOrientationProperty = BindableProperty.Create("IconRelativeOrientation", typeof(IconOrientation?), typeof(Tizen.NUI.Components.Button), null, propertyChanged: (bindable, oldValue, newValue) =>
+ public static readonly BindableProperty IconRelativeOrientationProperty = BindableProperty.Create("IconRelativeOrientation", typeof(IconOrientation?), typeof(Button), null, propertyChanged: (bindable, oldValue, newValue) =>
{
- var instance = (Tizen.NUI.Components.Button)bindable;
+ var instance = (Button)bindable;
if (newValue != null)
{
instance.privateIconRelativeOrientation = (IconOrientation?)newValue;
},
defaultValueCreator: (bindable) =>
{
- var instance = (Tizen.NUI.Components.Button)bindable;
+ var instance = (Button)bindable;
return instance.privateIconRelativeOrientation;
});
/// 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("IsEnabled", typeof(bool), typeof(Tizen.NUI.Components.Button), true, propertyChanged: (bindable, oldValue, newValue) =>
+ public static readonly BindableProperty IsEnabledProperty = BindableProperty.Create("IsEnabled", typeof(bool), typeof(Button), true, propertyChanged: (bindable, oldValue, newValue) =>
{
- var instance = (Tizen.NUI.Components.Button)bindable;
+ var instance = (Button)bindable;
if (newValue != null)
{
instance.privateIsEnabled = (bool)newValue;
},
defaultValueCreator: (bindable) =>
{
- var instance = (Tizen.NUI.Components.Button)bindable;
+ var instance = (Button)bindable;
return instance.privateIsEnabled;
});
/// 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("IsSelected", typeof(bool), typeof(Tizen.NUI.Components.Button), true, propertyChanged: (bindable, oldValue, newValue) =>
+ public static readonly BindableProperty IsSelectedProperty = BindableProperty.Create("IsSelected", typeof(bool), typeof(Button), true, propertyChanged: (bindable, oldValue, newValue) =>
{
- var instance = (Tizen.NUI.Components.Button)bindable;
+ var instance = (Button)bindable;
if (newValue != null)
{
instance.privateIsSelected = (bool)newValue;
},
defaultValueCreator: (bindable) =>
{
- var instance = (Tizen.NUI.Components.Button)bindable;
+ var instance = (Button)bindable;
return instance.privateIsSelected;
});
/// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- public static readonly BindableProperty IsSelectableProperty = BindableProperty.Create("IsSelectable", typeof(bool), typeof(Tizen.NUI.Components.Button), true, propertyChanged: (bindable, oldValue, newValue) =>
+ public static readonly BindableProperty IsSelectableProperty = BindableProperty.Create("IsSelectable", typeof(bool), typeof(Button), true, propertyChanged: (bindable, oldValue, newValue) =>
{
- var instance = (Tizen.NUI.Components.Button)bindable;
+ var instance = (Button)bindable;
if (newValue != null)
{
instance.privateIsSelectable = (bool)newValue;
},
defaultValueCreator: (bindable) =>
{
- var instance = (Tizen.NUI.Components.Button)bindable;
+ var instance = (Button)bindable;
return instance.privateIsSelectable;
});
+ /// 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("IconPadding", typeof(Extents), typeof(Button), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var instance = (Button)bindable;
+ if (null != newValue && null != instance.Style?.IconPadding)
+ {
+ instance.Style.IconPadding.CopyFrom((Extents)newValue);
+ instance.UpdateUIContent();
+ }
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var instance = (Button)bindable;
+ return instance.Style?.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("TextPadding", typeof(Extents), typeof(Button), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var instance = (Button)bindable;
+ if (null != newValue && null != instance.Style?.TextPadding)
+ {
+ instance.Style.TextPadding.CopyFrom((Extents)newValue);
+ instance.UpdateUIContent();
+ }
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var instance = (Button)bindable;
+ return instance.Style?.TextPadding;
+ });
private ImageView overlayImage;
private TextLabel buttonText;
- private ImageView buttonIcon;
+ private ImageControl buttonIcon;
private EventHandler<StateChangedEventArgs> stateChangeHander;
}
set
{
- if (value != null)
+ if (null != Style?.Text)
{
- if (Style.Text.TranslatableText == null)
- {
- Style.Text.TranslatableText = new Selector<string>();
- }
- if (Style.Text.TranslatableText != null)
- {
- Style.Text.TranslatableText.All = value;
- }
+ Style.Text.TranslatableText = value;
}
}
}
}
set
{
- if (Style.Text.PointSize == null)
- {
- Style.Text.PointSize = new Selector<float?>();
- }
- if (Style.Text.PointSize != null)
+ if (null != Style?.Text)
{
- Style.Text.PointSize.All = value;
+ Style.Text.PointSize = value;
}
}
}
}
set
{
- Style.Text.FontFamily = value;
+ if (null != Style?.Text)
+ {
+ Style.Text.FontFamily = value;
+ }
}
}
/// <summary>
}
set
{
- if (Style.Text.TextColor == null)
- {
- Style.Text.TextColor = new Selector<Color>();
- }
- if (Style.Text.TextColor != null)
+ if (null != Style?.Text)
{
- Style.Text.TextColor.All = value;
+ Style.Text.TextColor = value;
}
}
}
}
set
{
- Style.Text.HorizontalAlignment = value;
+ if (null != Style?.Text)
+ {
+ Style.Text.HorizontalAlignment = value;
+ }
}
}
/// <summary>
}
set
{
- if (value != null)
+ if (null != Style?.Icon)
{
- if (Style.Icon.ResourceUrl == null)
- {
- Style.Icon.ResourceUrl = new Selector<string>();
- }
- if (Style.Icon.ResourceUrl != null)
- {
- Style.Icon.ResourceUrl.All = value;
- }
+ Style.Icon.ResourceUrl = value;
}
}
}
+
private StringSelector textSelector = new StringSelector();
/// <summary>
/// Text string selector in Button.
}
}
-
private ColorSelector textColorSelector = new ColorSelector();
/// <summary>
/// Text color selector in Button.
}
}
-
private StringSelector iconURLSelector = new StringSelector();
/// <summary>
/// Icon image's resource url selector in Button.
}
}
-
/// <summary>
/// Flag to decide selected state in Button.
/// </summary>
/// <since_tizen> 6 </since_tizen>
public Extents IconPadding
{
- get
- {
- return Style.Icon.Padding;
- }
- set
- {
- if (null != value)
- {
- Style.Icon.Padding.CopyFrom(value);
- }
- }
+ get => (Extents)GetValue(IconPaddingProperty);
+ set => SetValue(IconPaddingProperty, value);
}
/// <summary>
/// <since_tizen> 6 </since_tizen>
public Extents TextPadding
{
- get
- {
- return Style.Text.Padding;
- }
- set
- {
- if (null != value)
- {
- Style.Text.Padding.CopyFrom(value);
- }
- }
+ get => (Extents) GetValue(TextPaddingProperty);
+ set => SetValue(TextPaddingProperty, value);
}
/// <summary>
if (null == buttonIcon)
{
- buttonIcon = new ImageView();
+ buttonIcon = new ImageControl();
buttonIcon.Relayout += OnIconRelayout;
this.Add(buttonIcon);
}
/// <since_tizen> 6 </since_tizen>
private void Initialize()
{
+ if (null == Style.IconRelativeOrientation) Style.IconRelativeOrientation = IconOrientation.Left;
UpdateState();
LayoutDirectionChanged += OnLayoutDirectionChanged;
}
}
buttonText.WidthResizePolicy = ResizePolicyType.Fixed;
buttonText.HeightResizePolicy = ResizePolicyType.Fixed;
- int textPaddingStart = Style.Text.Padding.Start;
- int textPaddingEnd = Style.Text.Padding.End;
- int textPaddingTop = Style.Text.Padding.Top;
- int textPaddingBottom = Style.Text.Padding.Bottom;
+ int textPaddingStart = Style.TextPadding.Start;
+ int textPaddingEnd = Style.TextPadding.End;
+ int textPaddingTop = Style.TextPadding.Top;
+ int textPaddingBottom = Style.TextPadding.Bottom;
- int iconPaddingStart = Style.Icon.Padding.Start;
- int iconPaddingEnd = Style.Icon.Padding.End;
- int iconPaddingTop = Style.Icon.Padding.Top;
- int iconPaddingBottom = Style.Icon.Padding.Bottom;
+ int iconPaddingStart = Style.IconPadding.Start;
+ int iconPaddingEnd = Style.IconPadding.End;
+ int iconPaddingTop = Style.IconPadding.Top;
+ int iconPaddingBottom = Style.IconPadding.Bottom;
if (IconRelativeOrientation == IconOrientation.Top || IconRelativeOrientation == IconOrientation.Bottom)
{
return;
}
- int textPaddingStart = Style.Text.Padding.Start;
- int textPaddingEnd = Style.Text.Padding.End;
- int textPaddingTop = Style.Text.Padding.Top;
- int textPaddingBottom = Style.Text.Padding.Bottom;
+ int textPaddingStart = Style.TextPadding.Start;
+ int textPaddingEnd = Style.TextPadding.End;
+ int textPaddingTop = Style.TextPadding.Top;
+ int textPaddingBottom = Style.TextPadding.Bottom;
- int iconPaddingStart = Style.Icon.Padding.Start;
- int iconPaddingEnd = Style.Icon.Padding.End;
- int iconPaddingTop = Style.Icon.Padding.Top;
- int iconPaddingBottom = Style.Icon.Padding.Bottom;
+ int iconPaddingStart = Style.IconPadding.Start;
+ int iconPaddingEnd = Style.IconPadding.End;
+ int iconPaddingTop = Style.IconPadding.Top;
+ int iconPaddingBottom = Style.IconPadding.Bottom;
switch (IconRelativeOrientation)
{
default:
break;
}
+ if ("" == buttonText.Text)
+ {
+ buttonIcon.ParentOrigin = NUI.ParentOrigin.Center;
+ buttonIcon.PivotPoint = NUI.PivotPoint.Center;
+ }
}
/// <summary>
/// Theme change callback when theme is changed, this callback will be trigger.
/// 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 CheckBox() : base() { }
+
/// <summary>
/// Creates a new instance of a CheckBox with style.
/// </summary>
/// 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 CheckBox(string style) : base(style) { }
+
/// <summary>
/// Creates a new instance of a CheckBox with attributes.
/// </summary>
/// <param name="attrs"></param>
/// 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 CheckBox(SelectButtonStyle attrs) : base(attrs) { }
+ public CheckBox(ButtonStyle attrs) : base(attrs) { }
/// <summary>
/// Get CheckBoxGroup to which this CheckBox belong.
[EditorBrowsable(EditorBrowsableState.Never)]
public CheckBoxGroup() : base()
{
-
}
/// <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)]
- public CheckBox GetItemByIndex(int index)
+ public CheckBox GetItem(int index)
{
return itemGroup[index] as CheckBox;
}
/// <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 int[] GetCheckedIndexArray()
+ public int[] GetCheckedIndices()
{
List<int> selectedItemsList = new List<int>();
for (int i = 0; i < itemGroup.Count; i++)
/// <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 CheckBox[] GetCheckedItemArray()
+ public CheckBox[] GetCheckedItems()
{
List<CheckBox> selectedList = new List<CheckBox>();
/// <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 void CheckingAll(bool state)
+ public void CheckAll(bool state)
{
foreach (CheckBox cb in itemGroup)
{
using System.Collections.Generic;
using System.ComponentModel;
using Tizen.NUI.BaseComponents;
+using Tizen.NUI.Binding;
namespace Tizen.NUI.Components
{
[EditorBrowsable(EditorBrowsableState.Never)]
public class Control : VisualView
{
- /// <summary>
- /// Control style.
- /// </summary>
+ /// <summary> BackgroundImageProperty</summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public new static readonly BindableProperty BackgroundImageProperty = BindableProperty.Create("ControlBackgroundImage", typeof(Selector<string>), typeof(Control), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var control = (Control)bindable;
+ if (null != newValue)
+ {
+ control.BackgroundImageSelector.Clone((Selector<string>)newValue);
+ }
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var control = (Control)bindable;
+ return control.BackgroundImageSelector;
+ });
+ /// <summary>BackgroundBorderProperty</summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public new static readonly BindableProperty BackgroundImageBorderProperty = BindableProperty.Create("ControlBackgroundImageBorder", typeof(Selector<Rectangle>), typeof(Control), default(Rectangle), propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var control = (Control)bindable;
+ if (null != newValue)
+ {
+ control.backgroundImageBorderSelector.Clone((Selector<Rectangle>)newValue);
+ }
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var control = (Control)bindable;
+ return control.backgroundImageBorderSelector;
+ });
+ /// <summary> BackgroundColorProperty </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public new static readonly BindableProperty BackgroundColorProperty = BindableProperty.Create("ControlBackgroundColor", typeof(Selector<Color>), typeof(Control), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var control = (Control)bindable;
+ if (null != newValue)
+ {
+ control.BackgroundColorSelector.Clone((Selector<Color>)newValue);
+ }
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var control = (Control)bindable;
+ return control.BackgroundColorSelector;
+ });
+ /// <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)]
}
/// <summary>
- /// Construct with style
+ /// Construct with styleSheet
/// </summary>
- /// <param name="style">Style to be applied</param>
+ /// <param name="styleSheet">StyleSheet to be applied</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)]
- public Control(string style) : base()
+ public Control(string styleSheet) : base()
{
+ ViewStyle viewStyle = StyleManager.Instance.GetAttributes(styleSheet);
+ if (viewStyle == null)
+ {
+ throw new InvalidOperationException($"There is no style {styleSheet}");
+ }
+
+ ApplyStyle(viewStyle);
+ this.style = styleSheet;
+
Initialize(style);
}
- public new Selector<string> BackgroundImage
+ private TriggerableSelector<string> _backgroundImageSelector;
+ private TriggerableSelector<string> BackgroundImageSelector
{
get
{
- return Style.Background.ResourceUrl;
- }
- set
- {
- Style.Background.ResourceUrl = value;
+ if (null == _backgroundImageSelector)
+ {
+ _backgroundImageSelector = new TriggerableSelector<string>(backgroundImage, ImageView.ResourceUrlProperty);
+ }
+ return _backgroundImageSelector;
}
}
-
- public Selector<Rectangle> BackgroundBorder
+ private TriggerableSelector<Rectangle> _backgroundImageBorderSelector;
+ private TriggerableSelector<Rectangle> backgroundImageBorderSelector
{
get
{
- return Style.Background.Border;
+ if (null == _backgroundImageBorderSelector)
+ {
+ _backgroundImageBorderSelector = new TriggerableSelector<Rectangle>(backgroundImage, ImageView.BorderProperty);
+ }
+ return _backgroundImageBorderSelector;
}
- set
+ }
+ private TriggerableSelector<Color> _backgroundColorSelector;
+ private TriggerableSelector<Color> BackgroundColorSelector
+ {
+ get
{
- Style.Background.Border = value;
+ if (null == _backgroundColorSelector)
+ {
+ _backgroundColorSelector = new TriggerableSelector<Color>(backgroundImage, View.BackgroundColorProperty);
+ }
+ return _backgroundColorSelector;
}
}
+ /// <summary>
+ /// Override view's BackgroundImage.
+ /// </summary>
+ /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public new Selector<string> BackgroundImage
+ {
+ get => (Selector<string>)GetValue(BackgroundImageProperty);
+ set => SetValue(BackgroundImageProperty, value);
+ }
+ /// <summary>
+ /// Override view's BackgroundImageBorder.
+ /// </summary>
+ /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public new Selector<Rectangle> BackgroundImageBorder
+ {
+ get => (Selector<Rectangle>)GetValue(BackgroundImageBorderProperty);
+ set => SetValue(BackgroundImageBorderProperty, value);
+ }
+ /// <summary>
+ /// Override view's BackgroundBorder.
+ /// </summary>
+ /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public new Selector<Color> BackgroundColor
+ {
+ get => (Selector<Color>)GetValue(BackgroundColorProperty);
+ set => SetValue(BackgroundColorProperty, value);
+ }
+
+ /// <summary>
+ /// Shadow image.
+ /// </summary>
+ /// 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 Selector<string> ShadowImage
{
get
}
}
+ /// <summary>
+ /// Shadow image border.
+ /// </summary>
+ /// 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 Selector<Rectangle> ShadowImageBorder
{
get
/// Whether focusable when touch
/// </summary>
/// <since_tizen> 6 </since_tizen>
- internal bool StateFocusableOnTouchMode
- {
- get;
- set;
- }
+ internal bool StateFocusableOnTouchMode { get; set; }
- internal bool IsFocused
- {
- get
- {
- return isFocused || HasFocus();
- }
- }
+ internal bool IsFocused => (isFocused || HasFocus());
/// <summary>
/// Dispose Control and all children on it.
{
if (null == shadowImage)
{
- shadowImage = new ImageView();
+ shadowImage = new ImageView()
+ {
+ WidthResizePolicy = ResizePolicyType.FillToParent,
+ HeightResizePolicy = ResizePolicyType.FillToParent,
+ };
this.Add(shadowImage);
+ shadowImage.LowerToBottom();
}
shadowImage.ApplyStyle(controlStyle.Shadow);
- }
- if (null != controlStyle?.Background)
- {
if (null == backgroundImage)
{
- backgroundImage = new ImageView();
+ backgroundImage = new ImageView()
+ {
+ WidthResizePolicy = ResizePolicyType.FillToParent,
+ HeightResizePolicy = ResizePolicyType.FillToParent,
+ };
this.Add(backgroundImage);
}
- backgroundImage.ApplyStyle(controlStyle.Background);
}
}
/// <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 OnTapGestureDetected(object source, TapGestureDetector.DetectedEventArgs e)
- {
- }
+ protected virtual void OnTapGestureDetected(object source, TapGestureDetector.DetectedEventArgs e) { }
+
/// <summary>
/// Called after a touch event is received by the owning view.<br />
/// CustomViewBehaviour.REQUIRES_TOUCH_EVENTS must be enabled during construction. See CustomView(ViewWrapperImpl.CustomViewBehaviour behaviour).<br />
protected virtual void OnUpdate()
{
}
+
/// <summary>
/// Theme change callback when theme is changed, this callback will be trigger.
/// </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 virtual void OnThemeChangedEvent(object sender, StyleManager.ThemeChangeEventArgs e)
- {
- }
+ protected virtual void OnThemeChangedEvent(object sender, StyleManager.ThemeChangeEventArgs e) { }
/// 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 RegisterDetectionOfSubstyleChanges()
- {
-
- }
+ protected virtual void RegisterDetectionOfSubstyleChanges() { }
/// 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 void Initialize(string style)
{
ControlState = ControlStates.Normal;
+ if(null == backgroundImage)
+ {
+ backgroundImage = new ImageView()
+ {
+ WidthResizePolicy = ResizePolicyType.FillToParent,
+ HeightResizePolicy = ResizePolicyType.FillToParent,
+ };
+ this.Add(backgroundImage);
+ }
RegisterDetectionOfSubstyleChanges();
[EditorBrowsable(EditorBrowsableState.Never)]
public void DeleteItem(int index)
{
- if(index < 0 || index >= adapter.GetItemCount())
- {
- return;
- }
+ if (index < 0 || index >= adapter?.GetItemCount()) return;
+ if (null == dropDownMenuFullList) return;
if (selectedItemIndex == index)
{
selectedItemIndex--;
}
- adapter.RemoveData(index);
+ adapter?.RemoveData(index);
- if(index < dropDownMenuFullList?.ChildCount)
+ if(index < dropDownMenuFullList.ChildCount)
{
- View childToRemove = dropDownMenuFullList?.GetChildAt((uint)index);
+ View childToRemove = dropDownMenuFullList.GetChildAt((uint)index);
if (childToRemove)
{
childToRemove.TouchEvent -= ListItemTouchEvent;
- dropDownMenuFullList?.Remove(childToRemove);
+ dropDownMenuFullList.Remove(childToRemove);
dropDownMenuFullList?.Layout?.RequestLayout();
}
}
button.ApplyStyle(Style.Button);
headerText.ApplyStyle(Style.HeaderText);
listBackgroundImage.ApplyStyle(Style.ListBackgroundImage);
+ UpdateDropDown();
}
}
}
else if (listRelativeOrientation == ListOrientation.Right)
{
- int listWidth = 0;
- if (dropDownMenuFullList.Size2D != null)
- {
- listWidth = dropDownMenuFullList.Size2D.Width;
- }
- listBackgroundImageX = Size2D.Width - listWidth - (int)listMargin.End;
+ listBackgroundImageX = -(int)listMargin.End;
listBackgroundImageY = (int)listMargin.Top;
}
listBackgroundImage.Position2D = new Position2D(listBackgroundImageX, listBackgroundImageY);
private void UpdateSelectedItem(int index)
{
+ if (null == adapter) return;
+ if (null == dropDownMenuFullList) return;
if (selectedItemIndex != -1)
{
DropDownDataItem data = adapter.GetData(selectedItemIndex);
- if(data != null)
+ if(null != data)
{
data.IsSelected = false;
}
DropDownItemView listItemView = dropDownMenuFullList.GetChildAt((uint)selectedItemIndex) as DropDownItemView;
- if(data != null)
- {
- data.IsSelected = false;
- }
+ data.IsSelected = false;
SetListItemToSelected(listItemView);
}
if (index != -1)
{
DropDownDataItem data = adapter.GetData(index);
- if (data != null)
+ if (null != data)
{
data.IsSelected = true;
DropDownItemView listItemView = dropDownMenuFullList?.GetChildAt((uint)index) as DropDownItemView;
/// <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 Selector<Color> BackgroundColorSelector
+ public Selector<Color> BackgroundColor
{
get
{
}
set
{
- if (null == itemDataStyle.BackgroundColor)
+ if (null == itemDataStyle?.BackgroundColor)
{
itemDataStyle.BackgroundColor = new Selector<Color>();
}
- if (null != itemDataStyle.BackgroundColor)
- {
- itemDataStyle.BackgroundColor.Clone(value);
- }
+ itemDataStyle.BackgroundColor.Clone(value);
}
}
{
get
{
- if(mText == null)
- {
- return null;
- }
- return mText.Text;
+ return (null == mText) ? null : mText.Text;
}
set
{
{
get
{
- if (mText == null)
- {
- return null;
- }
- return mText.FontFamily;
+ return (null == mText) ? null : mText.FontFamily;
}
set
{
{
get
{
- if (mText == null)
- {
- return 0;
- }
- return mText.PointSize;
+ return (null == mText) ? 0 : mText.PointSize;
}
set
{
{
get
{
- if (mText == null)
- {
- return null;
- }
- return mText.TextColor;
+ return (null == mText) ? null : mText.TextColor;
}
set
{
{
get
{
- if (mText == null)
- {
- return null;
- }
- return mText.Position;
+ return (null == mText) ? null : mText.Position;
}
set
{
{
get
{
- if (mIcon == null)
- {
- return null;
- }
- return mIcon.ResourceUrl;
+ return (null == mIcon) ? null : mIcon.ResourceUrl;
}
set
{
{
get
{
- if (mIcon == null)
- {
- return null;
- }
- return mIcon.Size;
+ return (null == mIcon) ? null : mIcon.Size;
}
set
{
{
get
{
- if (mIcon == null)
- {
- return null;
- }
- return mIcon.Position;
+ return (null == mIcon) ? null : mIcon.Position;
}
set
{
{
get
{
- if (mCheck == null)
- {
- return null;
- }
- return mCheck.ResourceUrl;
+ return (null == mCheck) ? null : mCheck.ResourceUrl;
}
set
{
{
get
{
- if (mCheck == null)
- {
- return null;
- }
- return mCheck.Position;
+ return (null == mCheck) ? null : mCheck.Position;
}
set
{
{
get
{
- if (mCheck == null)
- {
- return null;
- }
- return mCheck.Size;
+ return (null == mCheck) ? null : mCheck.Size;
}
set
{
{
get
{
- if (mCheck == null)
- {
- return false;
- }
- return mCheck.Visibility;
+ return (null == mCheck) ? false : mCheck.Visibility;
}
set
{
if (listItemView != null)
{
- listItemView.BackgroundColorSelector = listItemData.BackgroundColorSelector;
+ listItemView.BackgroundColorSelector = listItemData.BackgroundColor;
if (listItemData.Text != null)
{
listItemView.Text = listItemData.Text;
}
}
- /**
- * Requests that the given child of the RecyclerView be positioned onto the screen. This
- * method can be called for both unfocusable and focusable child views. For unfocusable
- * child views, focusedChildVisible is typically true in which case, layout manager
- * makes the child view visible only if the currently focused child stays in-bounds of RV.
- * @param parent The parent RecyclerView.
- * @param child The direct child making the request.
- * @param rect The rectangle in the child's coordinates the child
- * wishes to be on the screen.
- * @param immediate True to forbid animated or delayed scrolling,
- * false otherwise
- * @param focusedChildVisible Whether the currently focused view must stay visible.
- * @return Whether the group scrolled to handle the operation
- */
internal bool RequestChildRectangleOnScreen(FlexibleView parent, FlexibleView.ViewHolder child, Recycler recycler, bool immediate)
{
Vector2 scrollAmount = GetChildRectangleOnScreenScrollAmount(parent, child);
/// <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 GridLayoutManager(int spanCount, int orientation) : base(orientation)
+ public GridLayoutManager(int spanCount, Orientation orientation) : base(orientation)
{
mSpanCount = spanCount;
}
- internal override void EnsureAnchorReady(FlexibleView.Recycler recycler, AnchorInfo anchorInfo, int itemDirection)
+ internal override void EnsureAnchorReady(FlexibleView.Recycler recycler, AnchorInfo anchorInfo, LayoutState.ItemDirectionType itemDirection)
{
- bool layingOutInPrimaryDirection = (itemDirection == LayoutState.ITEM_DIRECTION_TAIL);
+ bool layingOutInPrimaryDirection = (itemDirection == LayoutState.ItemDirectionType.TAIL);
int span = anchorInfo.Position % mSpanCount;
if (layingOutInPrimaryDirection)
{
[EditorBrowsable(EditorBrowsableState.Never)]
protected override int GetNextPosition(int position, FlexibleView.LayoutManager.Direction direction)
{
- if (mOrientation == HORIZONTAL)
+ if (mOrientation == Orientation.HORIZONTAL)
{
switch (direction)
{
LayoutState layoutState, LayoutChunkResult result)
{
bool layingOutInPrimaryDirection =
- layoutState.ItemDirection == LayoutState.ITEM_DIRECTION_TAIL;
+ layoutState.ItemDirection == LayoutState.ItemDirectionType.TAIL;
int count = mSpanCount;
for (int i = 0; i < count; i++)
result.Consumed = mOrientationHelper.GetViewHolderMeasurement(holder);
float left, top, width, height;
- if (mOrientation == VERTICAL)
+ if (mOrientation == Orientation.VERTICAL)
{
width = (Width - PaddingLeft - PaddingRight) / count;
height = result.Consumed;
- if (layoutState.LayoutDirection == LayoutState.LAYOUT_END)
+ if (layoutState.LayoutDirection == LayoutState.Direction.END)
{
left = PaddingLeft + width * i;
- top = layoutState.Offset;
+ top = layoutState.PixOffset;
}
else
{
left = PaddingLeft + width * (count - 1 - i);
- top = layoutState.Offset - height;
+ top = layoutState.PixOffset - height;
}
LayoutChild(holder, left, top, width, height);
}
{
width = result.Consumed;
height = (Height - PaddingTop - PaddingBottom) / count;
- if (layoutState.LayoutDirection == LayoutState.LAYOUT_END)
+ if (layoutState.LayoutDirection == LayoutState.Direction.END)
{
top = PaddingTop + height * i;
- left = layoutState.Offset;
+ left = layoutState.PixOffset;
}
else
{
top = PaddingTop + height * (count - 1 - i);
- left = layoutState.Offset - width;
+ left = layoutState.PixOffset - width;
}
LayoutChild(holder, left, top, width, height);
}
/// <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 static readonly int HORIZONTAL = OrientationHelper.HORIZONTAL;
- /// <summary>
- /// Constant value: 1.
- /// </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)]
- public static readonly int VERTICAL = OrientationHelper.VERTICAL;
+ public enum Orientation
+ {
+ HORIZONTAL = 0,
+ VERTICAL,
+ MAX
+ }
/// <summary>
/// Constant value: -1.
/// </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 int mOrientation;
+ protected Orientation mOrientation;
internal OrientationHelper mOrientationHelper;
/// <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 LinearLayoutManager(int orientation)
+ public LinearLayoutManager(Orientation orientation)
{
mOrientation = orientation;
- mOrientationHelper = OrientationHelper.CreateOrientationHelper(this, mOrientation);
+
+ if (Orientation.HORIZONTAL == mOrientation)
+ {
+ mOrientationHelper = OrientationHelper.CreateOrientationHelper(this, OrientationHelper.Direction.HORIZONTAL);
+ }
+ else if (Orientation.VERTICAL == mOrientation)
+ {
+ mOrientationHelper = OrientationHelper.CreateOrientationHelper(this, OrientationHelper.Direction.VERTICAL);
+ }
mLayoutState = new LayoutState();
- mLayoutState.Offset = mOrientationHelper.GetStartAfterPadding();
+ mLayoutState.PixOffset = mOrientationHelper.GetStartAfterPadding();
}
/// <summary>
[EditorBrowsable(EditorBrowsableState.Never)]
public override bool CanScrollHorizontally()
{
- return mOrientation == HORIZONTAL;
+ return mOrientation == Orientation.HORIZONTAL;
}
/// <summary>
[EditorBrowsable(EditorBrowsableState.Never)]
public override bool CanScrollVertically()
{
- return mOrientation == VERTICAL;
+ return mOrientation == Orientation.VERTICAL;
}
/// <summary>
mAnchorInfo.Valid = true;
}
- int firstLayoutDirection;
+ LayoutState.ItemDirectionType firstLayoutDirection;
if (mAnchorInfo.LayoutFromEnd)
{
- firstLayoutDirection = mShouldReverseLayout ? LayoutState.ITEM_DIRECTION_TAIL
- : LayoutState.ITEM_DIRECTION_HEAD;
+ firstLayoutDirection = mShouldReverseLayout ? LayoutState.ItemDirectionType.TAIL : LayoutState.ItemDirectionType.HEAD;
}
else
{
- firstLayoutDirection = mShouldReverseLayout ? LayoutState.ITEM_DIRECTION_HEAD
- : LayoutState.ITEM_DIRECTION_TAIL;
+ firstLayoutDirection = mShouldReverseLayout ? LayoutState.ItemDirectionType.HEAD : LayoutState.ItemDirectionType.TAIL;
}
EnsureAnchorReady(recycler, mAnchorInfo, firstLayoutDirection);
ScrapAttachedViews(recycler);
Cache(recycler, mLayoutState, true);
UpdateLayoutStateToFillEnd(mAnchorInfo.Position, mAnchorInfo.Coordinate);
- mLayoutState.CurrentPosition += mLayoutState.ItemDirection;
Fill(recycler, mLayoutState, false, true);
Cache(recycler, mLayoutState, true);
}
Cache(recycler, mLayoutState, true);
UpdateLayoutStateToFillStart(mAnchorInfo.Position, mAnchorInfo.Coordinate);
- mLayoutState.CurrentPosition += mLayoutState.ItemDirection;
Fill(recycler, mLayoutState, false, true);
Cache(recycler, mLayoutState, true);
}
+ switch (mLayoutState.ItemDirection)
+ {
+ case LayoutState.ItemDirectionType.HEAD:
+ mLayoutState.CurrentPosition--;
+ break;
+
+ case LayoutState.ItemDirectionType.TAIL:
+ mLayoutState.CurrentPosition++;
+ break;
+
+ default:
+ mLayoutState.CurrentPosition -= 1000;
+ break;
+ }
+
OnLayoutCompleted();
}
[EditorBrowsable(EditorBrowsableState.Never)]
public override float ScrollHorizontallyBy(float dx, FlexibleView.Recycler recycler, bool immediate)
{
- if (mOrientation == VERTICAL)
+ if (mOrientation == Orientation.VERTICAL)
{
return 0;
}
[EditorBrowsable(EditorBrowsableState.Never)]
public override float ScrollVerticallyBy(float dy, FlexibleView.Recycler recycler, bool immediate)
{
- if (mOrientation == HORIZONTAL)
+ if (mOrientation == Orientation.HORIZONTAL)
{
return 0;
}
mAnchorInfo.Reset();
}
- internal virtual void EnsureAnchorReady(FlexibleView.Recycler recycler, AnchorInfo anchorInfo, int itemDirection)
+ internal virtual void EnsureAnchorReady(FlexibleView.Recycler recycler, AnchorInfo anchorInfo, LayoutState.ItemDirectionType itemDirection)
{
}
[EditorBrowsable(EditorBrowsableState.Never)]
protected override int GetNextPosition(int position, FlexibleView.LayoutManager.Direction direction)
{
- if (mOrientation == HORIZONTAL)
+ if (mOrientation == Orientation.HORIZONTAL)
{
switch (direction)
{
return;
}
- if (mShouldReverseLayout == (layoutState.LayoutDirection == LayoutState.LAYOUT_START))
+ if (mShouldReverseLayout == (layoutState.LayoutDirection == LayoutState.Direction.START))
AddView(holder);
else
AddView(holder, 0);
result.Consumed = mOrientationHelper.GetViewHolderMeasurement(holder);
float left, top, width, height;
- if (mOrientation == VERTICAL)
+ if (mOrientation == Orientation.VERTICAL)
{
width = Width - PaddingLeft - PaddingRight;
height = result.Consumed;
left = PaddingLeft;
- if (layoutState.LayoutDirection == LayoutState.LAYOUT_END)
+ if (layoutState.LayoutDirection == LayoutState.Direction.END)
{
- top = layoutState.Offset;
+ top = layoutState.PixOffset;
}
else
{
- top = layoutState.Offset - height;
+ top = layoutState.PixOffset - height;
}
LayoutChild(holder, left, top, width, height);
}
width = result.Consumed;
height = Height - PaddingTop - PaddingBottom;
top = PaddingTop;
- if (layoutState.LayoutDirection == LayoutState.LAYOUT_END)
+ if (layoutState.LayoutDirection == LayoutState.Direction.END)
{
- left = layoutState.Offset;
+ left = layoutState.PixOffset;
}
else
{
- left = layoutState.Offset - width;
+ left = layoutState.PixOffset - width;
}
LayoutChild(holder, left, top, width, height);
}
{
return null;
}
- int layoutDir = ConvertFocusDirectionToLayoutDirection(direction);
- if (layoutDir == LayoutState.INVALID_LAYOUT)
+
+ LayoutState.Direction layoutDir = ConvertFocusDirectionToLayoutDirection(direction);
+
+ if (layoutDir == LayoutState.Direction.MAX)
{
return null;
}
int maxScroll = (int)(MAX_SCROLL_FACTOR * mOrientationHelper.GetTotalSpace());
- UpdateLayoutState(layoutDir, maxScroll, false);
+
+ FlexibleView.ViewHolder child;
+ if (layoutDir == LayoutState.Direction.END)
+ {
+ child = GetChildClosestToEnd();
+ }
+ else
+ {
+ child = GetChildClosestToStart();
+ }
+
+ mLayoutState.UpdateState(layoutDir, mOrientationHelper, child, mShouldReverseLayout, maxScroll, false);
+
mLayoutState.ScrollingOffset = LayoutState.SCROLLING_OFFSET_NaN;
+
mLayoutState.Recycle = false;
+
Fill(recycler, mLayoutState, true, true);
FlexibleView.ViewHolder nextFocus;
- if (layoutDir == LayoutState.LAYOUT_START)
+ if (layoutDir == LayoutState.Direction.START)
{
nextFocus = GetChildAt(0);
}
// or 0 for not applicable
// @return {@link LayoutState#LAYOUT_START} or {@link LayoutState#LAYOUT_END} if focus direction
// is applicable to current state, {@link LayoutState#INVALID_LAYOUT} otherwise.
- private int ConvertFocusDirectionToLayoutDirection(FlexibleView.LayoutManager.Direction focusDirection)
+ private LayoutState.Direction ConvertFocusDirectionToLayoutDirection(FlexibleView.LayoutManager.Direction focusDirection)
{
switch (focusDirection)
{
case FlexibleView.LayoutManager.Direction.Up:
- return mOrientation == VERTICAL ? LayoutState.LAYOUT_START
- : LayoutState.INVALID_LAYOUT;
+ return mOrientation == Orientation.VERTICAL ? LayoutState.Direction.START
+ : LayoutState.Direction.MAX;
case FlexibleView.LayoutManager.Direction.Down:
- return mOrientation == VERTICAL ? LayoutState.LAYOUT_END
- : LayoutState.INVALID_LAYOUT;
+ return mOrientation == Orientation.VERTICAL ? LayoutState.Direction.END
+ : LayoutState.Direction.MAX;
case FlexibleView.LayoutManager.Direction.Left:
- return mOrientation == HORIZONTAL ? LayoutState.LAYOUT_START
- : LayoutState.INVALID_LAYOUT;
+ return mOrientation == Orientation.HORIZONTAL ? LayoutState.Direction.START
+ : LayoutState.Direction.MAX;
case FlexibleView.LayoutManager.Direction.Right:
- return mOrientation == HORIZONTAL ? LayoutState.LAYOUT_END
- : LayoutState.INVALID_LAYOUT;
+ return mOrientation == Orientation.HORIZONTAL ? LayoutState.Direction.END
+ : LayoutState.Direction.MAX;
default:
- return LayoutState.INVALID_LAYOUT;
+ return LayoutState.Direction.MAX;
}
}
{
break;
}
- layoutState.Offset += layoutChunkResult.Consumed * layoutState.LayoutDirection;
+
+ switch (mLayoutState.LayoutDirection)
+ {
+ case LayoutState.Direction.START:
+ layoutState.PixOffset -= layoutChunkResult.Consumed;
+ break;
+
+ case LayoutState.Direction.END:
+ layoutState.PixOffset += layoutChunkResult.Consumed;
+ break;
+
+ default:
+ layoutState.PixOffset += layoutChunkResult.Consumed * -1000;
+ break;
+ }
// Consume the available space if:
// layoutChunk did not request to be ignored
private void Cache(FlexibleView.Recycler recycler, LayoutState layoutState, bool immediate, float scrolled = 0)
{
- if (layoutState.LayoutDirection == LayoutState.LAYOUT_END)
+ if (layoutState.LayoutDirection == LayoutState.Direction.END)
{
// get the first child in the direction we are going
FlexibleView.ViewHolder child = GetChildClosestToEnd();
{
return;
}
- if (layoutState.LayoutDirection == LayoutState.LAYOUT_START)
+ if (layoutState.LayoutDirection == LayoutState.Direction.START)
{
RecycleViewsFromEnd(recycler, layoutState.ScrollingOffset, immediate);
}
return 0;
}
mLayoutState.Recycle = true;
- int layoutDirection = dy < 0 ? LayoutState.LAYOUT_END : LayoutState.LAYOUT_START;
+ LayoutState.Direction layoutDirection = dy < 0 ? LayoutState.Direction.END : LayoutState.Direction.START;
float absDy = Math.Abs(dy);
- UpdateLayoutState(layoutDirection, absDy, true);
+ FlexibleView.ViewHolder child;
+ if (layoutDirection == LayoutState.Direction.END)
+ {
+ child = GetChildClosestToEnd();
+ }
+ else
+ {
+ child = GetChildClosestToStart();
+ }
+
+ mLayoutState.UpdateState(layoutDirection, mOrientationHelper, child, mShouldReverseLayout, absDy, true);
float consumed = mLayoutState.ScrollingOffset
+ Fill(recycler, mLayoutState, false, immediate);
return 0;
}
- float scrolled = absDy > consumed ? -layoutDirection * consumed : dy;
+ int layoutDirectionOffset;
+ switch (layoutDirection)
+ {
+ case LayoutState.Direction.START:
+ layoutDirectionOffset = -1;
+ break;
+
+ case LayoutState.Direction.END:
+ layoutDirectionOffset = 1;
+ break;
+
+ default:
+ layoutDirectionOffset = -1000;
+ break;
+ }
+
+ float scrolled = absDy > consumed ? -layoutDirectionOffset * consumed : dy;
Cache(recycler, mLayoutState, immediate, scrolled);
mOrientationHelper.OffsetChildren(scrolled, immediate);
return scrolled;
}
- private void UpdateLayoutState(int layoutDirection, float requiredSpace, bool canUseExistingSpace)
- {
- mLayoutState.Extra = 0;
- mLayoutState.LayoutDirection = layoutDirection;
- float scrollingOffset = 0.0f;
- if (layoutDirection == LayoutState.LAYOUT_END)
- {
- mLayoutState.Extra += mOrientationHelper.GetEndPadding();
- // get the first child in the direction we are going
- FlexibleView.ViewHolder child = GetChildClosestToEnd();
- if (child != null)
- {
- // the direction in which we are traversing children
- mLayoutState.ItemDirection = mShouldReverseLayout ? LayoutState.ITEM_DIRECTION_HEAD
- : LayoutState.ITEM_DIRECTION_TAIL;
- mLayoutState.CurrentPosition = child.LayoutPosition + mLayoutState.ItemDirection;
- mLayoutState.Offset = mOrientationHelper.GetViewHolderEnd(child);
- // calculate how much we can scroll without adding new children (independent of layout)
- scrollingOffset = mOrientationHelper.GetViewHolderEnd(child)
- - mOrientationHelper.GetEndAfterPadding();
- }
-
- }
- else
- {
- mLayoutState.Extra += mOrientationHelper.GetStartAfterPadding();
- FlexibleView.ViewHolder child = GetChildClosestToStart();
- if (child != null)
- {
- mLayoutState.ItemDirection = mShouldReverseLayout ? LayoutState.ITEM_DIRECTION_TAIL
- : LayoutState.ITEM_DIRECTION_HEAD;
- mLayoutState.CurrentPosition = child.LayoutPosition + mLayoutState.ItemDirection;
- mLayoutState.Offset = mOrientationHelper.GetViewHolderStart(child);
- scrollingOffset = -mOrientationHelper.GetViewHolderStart(child)
- + mOrientationHelper.GetStartAfterPadding();
- }
- }
- mLayoutState.Available = requiredSpace;
- if (canUseExistingSpace)
- {
- mLayoutState.Available -= scrollingOffset;
- }
- mLayoutState.ScrollingOffset = scrollingOffset;
- }
-
// Convenience method to find the child closes to start. Caller should check it has enough
// children.
//
private void UpdateLayoutStateToFillEnd(int itemPosition, float offset)
{
mLayoutState.Available = mOrientationHelper.GetEndAfterPadding() - offset;
- mLayoutState.ItemDirection = mShouldReverseLayout ? LayoutState.ITEM_DIRECTION_HEAD :
- LayoutState.ITEM_DIRECTION_TAIL;
+ mLayoutState.ItemDirection = mShouldReverseLayout ? LayoutState.ItemDirectionType.HEAD : LayoutState.ItemDirectionType.TAIL;
mLayoutState.CurrentPosition = itemPosition;
- mLayoutState.LayoutDirection = LayoutState.LAYOUT_END;
- mLayoutState.Offset = offset;
+ mLayoutState.LayoutDirection = LayoutState.Direction.END;
+ mLayoutState.PixOffset = offset;
mLayoutState.ScrollingOffset = LayoutState.SCROLLING_OFFSET_NaN;
- mLayoutState.Extra = mOrientationHelper.GetEndPadding();
+ mLayoutState.Extra = mOrientationHelper.EndPadding;
}
private void UpdateLayoutStateToFillStart(int itemPosition, float offset)
{
mLayoutState.Available = offset - mOrientationHelper.GetStartAfterPadding();
mLayoutState.CurrentPosition = itemPosition;
- mLayoutState.ItemDirection = mShouldReverseLayout ? LayoutState.ITEM_DIRECTION_TAIL :
- LayoutState.ITEM_DIRECTION_HEAD;
- mLayoutState.LayoutDirection = LayoutState.LAYOUT_START;
- mLayoutState.Offset = offset;
+ mLayoutState.ItemDirection = mShouldReverseLayout ? LayoutState.ItemDirectionType.TAIL : LayoutState.ItemDirectionType.HEAD;
+ mLayoutState.LayoutDirection = LayoutState.Direction.START;
+ mLayoutState.PixOffset = offset;
mLayoutState.ScrollingOffset = LayoutState.SCROLLING_OFFSET_NaN;
mLayoutState.Extra = mOrientationHelper.GetStartAfterPadding();
}
// Helper class that keeps temporary state while {LayoutManager} is filling out the empty space.
internal class LayoutState
{
- public static readonly int LAYOUT_START = -1;
-
- public static readonly int LAYOUT_END = 1;
-
- public static readonly int INVALID_LAYOUT = -1000;
-
- public static readonly int ITEM_DIRECTION_HEAD = -1;
+ public enum Direction
+ {
+ START = 0,
+ END,
+ MAX
+ }
- public static readonly int ITEM_DIRECTION_TAIL = 1;
+ public enum ItemDirectionType
+ {
+ HEAD = 0,
+ TAIL,
+ MAX
+ }
- public static readonly int SCROLLING_OFFSET_NaN = -10000;
+ public static int SCROLLING_OFFSET_NaN = -1000;
// We may not want to recycle children in some cases (e.g. layout)
public bool Recycle = true;
// Pixel offset where layout should start
- public float Offset;
+ public float PixOffset;
// Number of pixels that we should fill, in the layout direction.
public float Available;
// Defines the direction in which the data adapter is traversed.
// Should be {@link #ITEM_DIRECTION_HEAD} or {@link #ITEM_DIRECTION_TAIL}
- public int ItemDirection;
+ public ItemDirectionType ItemDirection;
// Defines the direction in which the layout is filled.
// Should be {@link #LAYOUT_START} or {@link #LAYOUT_END}
- public int LayoutDirection;
+ public LayoutState.Direction LayoutDirection;
// Used when LayoutState is constructed in a scrolling state.
// It should be set the amount of scrolling we can make without creating a new view.
// {@link #mExtra} is not considered to avoid recycling visible children.
public float Extra = 0;
+ public void UpdateState(Direction layoutDirection, OrientationHelper helper, FlexibleView.ViewHolder child, bool canReverse, float space, bool useExistGap)
+ {
+ Extra = 0;
+
+ float scrollingOffset = 0.0f;
+
+ if (layoutDirection == LayoutState.Direction.END)
+ {
+ Extra += helper.EndPadding;
+
+ if (child != null)
+ {
+ ItemDirection = canReverse ? LayoutState.ItemDirectionType.HEAD : LayoutState.ItemDirectionType.TAIL;
+
+ PixOffset = helper.GetViewHolderEnd(child);
+
+ scrollingOffset = helper.GetViewHolderEnd(child) - helper.GetEndAfterPadding();
+ }
+ }
+ else
+ {
+ Extra += helper.GetStartAfterPadding();
+
+ if (child != null)
+ {
+ ItemDirection = canReverse ? LayoutState.ItemDirectionType.TAIL : LayoutState.ItemDirectionType.HEAD;
+
+ PixOffset = helper.GetViewHolderStart(child);
+
+ scrollingOffset = -helper.GetViewHolderStart(child) + helper.GetStartAfterPadding();
+ }
+ }
+
+ if (layoutDirection != LayoutState.Direction.MAX && null != child)
+ {
+ switch (ItemDirection)
+ {
+ case ItemDirectionType.HEAD:
+ CurrentPosition = child.LayoutPosition - 1;
+ break;
+
+ case ItemDirectionType.TAIL:
+ CurrentPosition = child.LayoutPosition + 1;
+ break;
+
+ default:
+ break;
+ }
+ }
+
+ Available = space;
+
+ if (useExistGap)
+ {
+ Available -= scrollingOffset;
+ }
+
+ ScrollingOffset = scrollingOffset;
+ }
// @return true if there are more items in the data adapter
public bool HasMore(int itemCount)
public FlexibleView.ViewHolder Next(FlexibleView.Recycler recycler)
{
FlexibleView.ViewHolder itemView = recycler.GetViewForPosition(CurrentPosition);
- CurrentPosition += ItemDirection;
+
+ switch (ItemDirection)
+ {
+ case ItemDirectionType.HEAD:
+ CurrentPosition -= 1;
+ break;
+
+ case ItemDirectionType.TAIL:
+ CurrentPosition += 1;
+ break;
+
+ default:
+ break;
+ }
return itemView;
}
}
// @see #createVerticalHelper(RecyclerView.LayoutManager)
internal abstract class OrientationHelper
{
- public static readonly int HORIZONTAL = 0;
- public static readonly int VERTICAL = 1;
+ public enum Direction
+ {
+ HORIZONTAL = 0,
+ VERTICAL
+ }
private static readonly int INVALID_SIZE = -1;
// whether the layout is RTL or not.
//
// @return The padding at the end of the layout.
- public abstract float GetEndPadding();
+ public abstract float EndPadding
+ {
+ get;
+ }
// Creates an OrientationHelper for the given LayoutManager and orientation.
//
// @param orientation Desired orientation. Should be {@link #HORIZONTAL} or {@link #VERTICAL}
// @return A new OrientationHelper
public static OrientationHelper CreateOrientationHelper(
- FlexibleView.LayoutManager layoutManager, int orientation)
+ FlexibleView.LayoutManager layoutManager, Direction orientation)
{
- if (orientation == HORIZONTAL)
+ if (orientation == Direction.HORIZONTAL)
{
return CreateHorizontalHelper(layoutManager);
}
- else if (orientation == VERTICAL)
+ else if (orientation == Direction.VERTICAL)
{
return CreateVerticalHelper(layoutManager);
}
//holder.offsetLeftAndRight(offset);
}
- public override float GetEndPadding()
+ public override float EndPadding
{
- return mLayoutManager.PaddingRight;
+ get
+ {
+ return mLayoutManager.PaddingRight;
+ }
}
}
//holder.offsetTopAndBottom(offset);
}
- public override float GetEndPadding()
+ public override float EndPadding
{
- return mLayoutManager.PaddingBottom;
+ get
+ {
+ return mLayoutManager.PaddingBottom;
+ }
}
-
}
-
}
* limitations under the License.
*
*/
-using System;
-using System.Collections.Generic;
using System.ComponentModel;
using Tizen.NUI.BaseComponents;
+using Tizen.NUI.Binding;
namespace Tizen.NUI.Components
{
[EditorBrowsable(EditorBrowsableState.Never)]
public class ImageControl : Control
{
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty ResourceUrlProperty = BindableProperty.Create("ImageControlResourceUrl", typeof(Selector<string>), typeof(ImageControl), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var imageControl = (ImageControl)bindable;
+ if (null != newValue)
+ {
+ imageControl.ResourceUrlSelector.Clone((Selector<string>)newValue);
+ }
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var imageControl = (ImageControl)bindable;
+ return imageControl.ResourceUrlSelector;
+ });
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty BorderProperty = BindableProperty.Create("ImageControlBorder", typeof(Selector<Rectangle>), typeof(ImageControl), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var imageControl = (ImageControl)bindable;
+ if (null == newValue)
+ {
+ imageControl.BorderSelector.Clone((Selector<Rectangle>)newValue);
+ }
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var imageControl = (ImageControl)bindable;
+ return imageControl.BorderSelector;
+ });
+
/// <summary>
/// Control style.
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
public ImageControl() : base()
{
+ Initialize(null);
}
/// <summary>
[EditorBrowsable(EditorBrowsableState.Never)]
public ImageControl(ImageControlStyle style) : base(style)
{
+ Initialize(null);
}
/// <summary>
[EditorBrowsable(EditorBrowsableState.Never)]
public ImageControl(string style) : base(style)
{
+ Initialize(style);
+ }
+
+ /// <summary>
+ /// Override view's BackgroundImage.
+ /// </summary>
+ /// 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 Selector<string> ResourceUrl
+ {
+ get => (Selector<string>)GetValue(ResourceUrlProperty);
+ set => SetValue(ResourceUrlProperty, value);
+ }
+
+ /// <summary>
+ /// Override view's BackgroundImageBorder.
+ /// </summary>
+ /// 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 Selector<Rectangle> Border
+ {
+ get => (Selector<Rectangle>)GetValue(BorderProperty);
+ set => SetValue(BorderProperty, value);
+ }
+
+ private TriggerableSelector<string> _resourceUrlSelector;
+ private TriggerableSelector<string> ResourceUrlSelector
+ {
+ get
+ {
+ if (null == _resourceUrlSelector)
+ {
+ _resourceUrlSelector = new TriggerableSelector<string>(imageView, ImageView.ResourceUrlProperty);
+ }
+ return _resourceUrlSelector;
+ }
+ }
+ private TriggerableSelector<Rectangle> _borderSelector;
+ private TriggerableSelector<Rectangle> BorderSelector
+ {
+ get
+ {
+ if (null == _borderSelector)
+ {
+ _borderSelector = new TriggerableSelector<Rectangle>(imageView, ImageView.BorderProperty);
+ }
+ return _borderSelector;
+ }
}
/// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
{
if (null == imageView)
{
- imageView = new ImageView();
+ imageView = new ImageView()
+ {
+ PositionUsesPivotPoint = true,
+ ParentOrigin = Tizen.NUI.ParentOrigin.Center,
+ PivotPoint = Tizen.NUI.PivotPoint.Center,
+ WidthResizePolicy = ResizePolicyType.UseNaturalSize,
+ HeightResizePolicy = ResizePolicyType.UseNaturalSize,
+ };
this.Add(imageView);
}
}
-
- imageView.ApplyStyle(imageControlStyle?.Image);
}
/// <summary>
imageControlStyle = new ImageControlStyle();
return imageControlStyle;
}
+
+ private void Initialize(string style)
+ {
+ if (null == imageView)
+ {
+ imageView = new ImageView()
+ {
+ PositionUsesPivotPoint = true,
+ ParentOrigin = Tizen.NUI.ParentOrigin.Center,
+ PivotPoint = Tizen.NUI.PivotPoint.Center,
+ WidthResizePolicy = ResizePolicyType.UseNaturalSize,
+ HeightResizePolicy = ResizePolicyType.UseNaturalSize,
+ };
+ this.Add(imageView);
+ }
+ }
}
}
{
get
{
- return textField.Text;
+ return textField?.Text;
}
set
{
- textField.Text = value;
+ if (null != textField) textField.Text = value;
}
}
{
get
{
- return textField.PlaceholderText;
+ return textField?.PlaceholderText;
}
set
{
- textField.PlaceholderText = value;
+ if (null != textField) textField.PlaceholderText = value;
}
}
{
get
{
- return textField.TextColor;
+ return textField?.TextColor;
}
set
{
CreateTextFieldAttributes();
- if (null == inputFieldAttrs.InputBoxAttributes.TextColor)
+ if (null != inputFieldAttrs?.InputBoxAttributes)
{
- inputFieldAttrs.InputBoxAttributes.TextColor = new Selector<Color>();
+ inputFieldAttrs.InputBoxAttributes.TextColor = value;
+ if (null != textField) textField.TextColor = value;
}
- if (null != inputFieldAttrs.InputBoxAttributes.TextColor)
- {
- inputFieldAttrs.InputBoxAttributes.TextColor.All = value;
- }
- textField.TextColor = value;
}
}
{
get
{
- return textField.PlaceholderTextColor;
+ return textField?.PlaceholderTextColor;
}
set
{
CreateTextFieldAttributes();
- if (null == inputFieldAttrs.InputBoxAttributes.PlaceholderTextColor)
- {
- inputFieldAttrs.InputBoxAttributes.PlaceholderTextColor = new Selector<Color>();
- }
- if (null != inputFieldAttrs.InputBoxAttributes.PlaceholderTextColor)
+ if (null != inputFieldAttrs?.InputBoxAttributes)
{
- inputFieldAttrs.InputBoxAttributes.PlaceholderTextColor.All = value;
+ inputFieldAttrs.InputBoxAttributes.PlaceholderTextColor = value;
+ if (null != textField) textField.PlaceholderTextColor = value;
}
- textField.PlaceholderTextColor = value;
}
}
{
get
{
- return textField.PrimaryCursorColor;
+ return textField?.PrimaryCursorColor;
}
set
{
CreateTextFieldAttributes();
- if (null == inputFieldAttrs.InputBoxAttributes.PrimaryCursorColor)
+ if (null == inputFieldAttrs?.InputBoxAttributes)
{
- inputFieldAttrs.InputBoxAttributes.PrimaryCursorColor = new Selector<Color>();
+ inputFieldAttrs.InputBoxAttributes.PrimaryCursorColor = value;
+ if (null != textField) textField.PrimaryCursorColor = value;
}
- if (null != inputFieldAttrs.InputBoxAttributes.PrimaryCursorColor)
- {
- inputFieldAttrs.InputBoxAttributes.PrimaryCursorColor.All = value;
- }
- textField.PrimaryCursorColor = value;
}
}
{
get
{
- return textField.FontFamily;
+ return textField?.FontFamily;
}
set
{
CreateTextFieldAttributes();
- inputFieldAttrs.InputBoxAttributes.FontFamily = value;
- textField.FontFamily = value;
+ if (null != inputFieldAttrs?.InputBoxAttributes)
+ {
+ inputFieldAttrs.InputBoxAttributes.FontFamily = value;
+ if (null != textField) textField.FontFamily = value;
+ }
}
}
{
get
{
- return textField.EnableCursorBlink;
+ return textField?.EnableCursorBlink ?? false;
}
set
{
CreateTextFieldAttributes();
- inputFieldAttrs.InputBoxAttributes.EnableCursorBlink = value;
- textField.EnableCursorBlink = value;
+ if (null != inputFieldAttrs.InputBoxAttributes)
+ {
+ inputFieldAttrs.InputBoxAttributes.EnableCursorBlink = value;
+ if (null != textField) textField.EnableCursorBlink = value;
+ }
}
}
{
get
{
- return textField.EnableSelection;
+ return textField?.EnableSelection ?? false;
}
set
{
CreateTextFieldAttributes();
- inputFieldAttrs.InputBoxAttributes.EnableSelection = value;
- textField.EnableSelection = value;
+ if (null != inputFieldAttrs?.InputBoxAttributes)
+ {
+ inputFieldAttrs.InputBoxAttributes.EnableSelection = value;
+ if (null != textField) textField.EnableSelection = value;
+ }
}
}
{
get
{
- return textField.CursorWidth;
+ return textField?.CursorWidth ?? 0;
}
set
{
CreateTextFieldAttributes();
- inputFieldAttrs.InputBoxAttributes.CursorWidth = value;
- textField.CursorWidth = value;
+ if (null != inputFieldAttrs.InputBoxAttributes)
+ {
+ inputFieldAttrs.InputBoxAttributes.CursorWidth = value;
+ if (null != textField) textField.CursorWidth = value;
+ }
}
}
{
get
{
- return textField.Ellipsis;
+ return textField?.Ellipsis ?? false;
}
set
{
CreateTextFieldAttributes();
- inputFieldAttrs.InputBoxAttributes.Ellipsis = value;
- textField.Ellipsis = value;
+ if (null != inputFieldAttrs.InputBoxAttributes)
+ {
+ inputFieldAttrs.InputBoxAttributes.Ellipsis = value;
+ if (null != textField) textField.Ellipsis = value;
+ }
}
}
{
get
{
- return inputFieldAttrs.BackgroundImageAttributes?.ResourceUrl?.All;
+ return inputFieldAttrs?.BackgroundImageAttributes?.ResourceUrl?.All;
}
set
{
- if (value != null)
+ CreateBackgroundAttributes();
+ if (null != inputFieldAttrs?.BackgroundImageAttributes)
{
- CreateBackgroundAttributes();
- if (inputFieldAttrs.BackgroundImageAttributes.ResourceUrl == null)
- {
- inputFieldAttrs.BackgroundImageAttributes.ResourceUrl = new Selector<string>();
- }
- if (inputFieldAttrs.BackgroundImageAttributes.ResourceUrl != null)
- {
- inputFieldAttrs.BackgroundImageAttributes.ResourceUrl.All = value;
- }
+ inputFieldAttrs.BackgroundImageAttributes.ResourceUrl = value;
RelayoutRequest();
}
}
{
get
{
- return inputFieldAttrs.BackgroundImageAttributes?.Border?.All;
+ return inputFieldAttrs?.BackgroundImageAttributes?.Border?.All;
}
set
{
- if (value != null)
+ CreateBackgroundAttributes();
+ if (null != inputFieldAttrs?.BackgroundImageAttributes)
{
- CreateBackgroundAttributes();
- if (inputFieldAttrs.BackgroundImageAttributes.Border == null)
- {
- inputFieldAttrs.BackgroundImageAttributes.Border = new Selector<Rectangle>();
- }
- if (inputFieldAttrs.BackgroundImageAttributes.Border != null)
- {
- inputFieldAttrs.BackgroundImageAttributes.Border.All = value;
- }
+ inputFieldAttrs.BackgroundImageAttributes.Border = value;
RelayoutRequest();
}
}
{
get
{
- return inputFieldAttrs.Space ?? 0;
+ return inputFieldAttrs?.Space ?? 0;
}
set
{
- inputFieldAttrs.Space = value;
- RelayoutRequest();
+ if (null != inputFieldAttrs)
+ {
+ inputFieldAttrs.Space = value;
+ RelayoutRequest();
+ }
}
}
{
Size size = (Size)newValue;
instance.Style.Size = size;
- //insbase.Size = value;
- instance.imageVisual.Size = new Size2D((int)size.Width, (int)size.Height);
+ if (null != instance.imageVisual)
+ {
+ instance.imageVisual.Size = new Size2D((int)size.Width, (int)size.Height);
+ }
}
},
defaultValueCreator: (bindable) =>
var instance = (Popup)bindable;
if (newValue != null)
{
- if (instance.Style.ShadowOffset == null)
+ if (null != instance.Style)
{
- instance.Style.ShadowOffset = new Vector4(0, 0, 0, 0);
+ instance.Style.ShadowOffset = (Vector4)newValue;
+ instance.UpdateShadow();
}
- instance.Style.ShadowOffset = (Vector4)newValue;
- instance.UpdateShadow();
}
},
defaultValueCreator: (bindable) =>
var instance = (Popup)bindable;
if (newValue != null)
{
- instance.Style.Buttons.Size.Height = (int)newValue;
- instance.UpdateButton();
+ if (null != instance.Style?.Buttons?.Size)
+ {
+ instance.Style.Buttons.Size.Height = (int)newValue;
+ instance.UpdateButton();
+ }
}
},
defaultValueCreator: (bindable) =>
var instance = (Popup)bindable;
if (newValue != null)
{
- if (instance.Style.Buttons.Text.PointSize == null)
- {
- instance.Style.Buttons.Text.PointSize = new Selector<float?>();
- }
- if (instance.Style.Buttons.Text.PointSize != null)
+ if (null != instance.Style?.Buttons?.Text)
{
- instance.Style.Buttons.Text.PointSize.All = (float)newValue;
+ instance.Style.Buttons.Text.PointSize = (float)newValue;
+ instance.UpdateButton();
}
- instance.UpdateButton();
}
},
defaultValueCreator: (bindable) =>
var instance = (Popup)bindable;
if (newValue != null)
{
- instance.Style.Buttons.Text.FontFamily = (string)newValue;
- instance.UpdateButton();
+ if (null != instance.Style?.Buttons?.Text)
+ {
+ instance.Style.Buttons.Text.FontFamily = (string)newValue;
+ instance.UpdateButton();
+ }
}
},
defaultValueCreator: (bindable) =>
{
var instance = (Popup)bindable;
if (newValue != null)
- {
- if (instance.Style.Buttons.Text.TextColor == null)
- {
- instance.Style.Buttons.Text.TextColor = new Selector<Color>();
- }
- if (instance.Style.Buttons.Text.TextColor != null)
+ {
+ if (null != instance.Style?.Buttons?.Text)
{
- instance.Style.Buttons.Text.TextColor.All = (Color)newValue;
+ instance.Style.Buttons.Text.TextColor = (Color)newValue;
}
- //instance.UpdateButton();
}
},
defaultValueCreator: (bindable) =>
var instance = (Popup)bindable;
if (newValue != null)
{
- instance.Style.Buttons.Overlay.BackgroundColor = (Selector<Color>)newValue;
- instance.UpdateButton();
+ if (null != instance.Style?.Buttons?.Overlay)
+ {
+ Selector<Color> color = (Selector<Color>)newValue;
+ if (null == instance.Style.Buttons.Overlay.BackgroundColor)
+ {
+ instance.Style.Buttons.Overlay.BackgroundColor = new Selector<Color>();
+ }
+ instance.Style.Buttons.Overlay.BackgroundColor.Clone(color);
+ instance.UpdateButton();
+ }
}
},
defaultValueCreator: (bindable) =>
var instance = (Popup)bindable;
if (newValue != null)
{
- instance.Style.Buttons.Text.HorizontalAlignment = (HorizontalAlignment)newValue;
- instance.UpdateButton();
+ if (null != instance.Style?.Buttons?.Text)
+ {
+ instance.Style.Buttons.Text.HorizontalAlignment = (HorizontalAlignment)newValue;
+ instance.UpdateButton();
+ }
}
},
defaultValueCreator: (bindable) =>
var instance = (Popup)bindable;
if (newValue != null)
{
- if (instance.Style.Buttons.Background.ResourceUrl == null)
- {
- instance.Style.Buttons.Background.ResourceUrl = new Selector<string>();
- }
- if (instance.Style.Buttons.Background.ResourceUrl != null)
+ if (null != instance.Style?.Buttons?.BackgroundImage)
{
- instance.Style.Buttons.Background.ResourceUrl.All = (string)newValue;
+ instance.Style.Buttons.BackgroundImage = (string)newValue;
+ instance.UpdateButton();
}
- instance.UpdateButton();
}
},
defaultValueCreator: (bindable) =>
{
var instance = (Popup)bindable;
- return instance.Style.Buttons?.Background?.ResourceUrl?.All;
+ return instance.Style.Buttons?.BackgroundImage?.All;
});
/// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
var instance = (Popup)bindable;
if (newValue != null)
{
- if (instance.Style.Buttons.Background.Border == null)
- {
- instance.Style.Buttons.Background.Border = new Selector<Rectangle>();
- }
- if (instance.Style.Buttons.Background.Border != null)
+ if (null != instance.Style?.Buttons?.BackgroundImageBorder)
{
- instance.Style.Buttons.Background.Border.All = (Rectangle)newValue;
+ instance.Style.Buttons.BackgroundImageBorder = (Rectangle)newValue;
+ instance.UpdateButton();
}
- instance.UpdateButton();
}
},
defaultValueCreator: (bindable) =>
{
var instance = (Popup)bindable;
- return instance.Style.Buttons?.Background?.Border?.All;
+ return instance.Style.Buttons?.BackgroundImageBorder?.All;
});
private TextLabel titleText;
{
get
{
- return Style.Title?.Text?.All;
+ return Style?.Title?.Text?.All;
}
set
{
- if (value != null)
+ if (null != Style?.Title)
{
- //CreateTitleTextAttributes();
- if (Style.Title.Text == null)
- {
- Style.Title.Text = new StringSelector();
- }
- if (Style.Title.Text != null)
- {
- Style.Title.Text.All = value;
- }
-
- //RelayoutRequest();
+ Style.Title.Text = value;
}
}
}
{
get
{
- return Style.Title?.PointSize?.All ?? 0;
+ return Style?.Title?.PointSize?.All ?? 0;
}
set
{
- //CreateTitleTextAttributes();
- if (Style.Title.PointSize == null)
+ if (null != Style?.Title)
{
- Style.Title.PointSize = new FloatSelector();
+ Style.Title.PointSize = value;
}
- if (Style.Title.PointSize != null)
- {
- Style.Title.PointSize.All = value;
- }
- //RelayoutRequest();
}
}
{
get
{
- return Style.Title?.TextColor?.All;
+ return Style?.Title?.TextColor?.All;
}
set
{
- //CreateTitleTextAttributes();
- if (Style.Title.TextColor == null)
+ if (null != Style?.Title)
{
- Style.Title.TextColor = new ColorSelector();
+ Style.Title.TextColor = value;
}
- if (Style.Title.TextColor != null)
- {
- Style.Title.TextColor.All = value;
- }
- //RelayoutRequest();
}
}
{
get
{
- return Style.Title?.HorizontalAlignment ?? HorizontalAlignment.Center;
+ return Style?.Title?.HorizontalAlignment ?? HorizontalAlignment.Center;
}
set
{
- //CreateTitleTextAttributes();
Style.Title.HorizontalAlignment = value;
- //RelayoutRequest();
}
}
{
get
{
- return Style.Title?.Position ?? new Position(0, 0, 0);
+ return Style?.Title?.Position ?? new Position(0, 0, 0);
}
set
{
- //CreateTitleTextAttributes();
Style.Title.Position = value;
- //RelayoutRequest();
}
}
{
get
{
- return (int)(Style.Title?.Size?.Height ?? 0);
+ return (int)(Style?.Title?.Size?.Height ?? 0);
}
set
{
- //CreateTitleTextAttributes();
Style.Title.Size.Height = value;
- //RelayoutRequest();
}
}
private void UpdateButton()
{
if (buttonCount <= 0) return;
- if (buttonTextList.Count != buttonCount) return;
+ if (null == buttonTextList || buttonTextList.Count != buttonCount) return;
- if (buttonList != null)
+ if (null != buttonList)
{
foreach (Button btn in buttonList)
{
- btn.ClickEvent -= ButtonClickEvent;
- this.Remove(btn);
- btn.Dispose();
+ if (null != btn)
+ {
+ btn.ClickEvent -= ButtonClickEvent;
+ this.Remove(btn);
+ btn.Dispose();
+ }
}
buttonList.Clear();
}
- int buttonWidth = Size2D.Width / buttonCount;
- int buttonHeight = (int)Style.Buttons.Size.Height;
+ int sizeWidth = Size2D?.Width ?? 0;
+ int buttonWidth = sizeWidth / buttonCount;
+ int buttonHeight = (int)(Style?.Buttons?.Size?.Height ?? 0);
for (int i = 0; i < buttonCount; i++)
{
- Button btn = new Button(Style.Buttons);
+ Button btn = new Button(Style?.Buttons);
btn.Size2D = new Size2D(buttonWidth, buttonHeight);
btn.Style.Text.Text = buttonTextList[i];
btn.ClickEvent += ButtonClickEvent;
this.Add(btn);
- buttonList?.Add(btn);
+ buttonList.Add(btn);
}
int pos = 0;
- if (buttonList != null && buttonList.Count > 0)
+ if (null != buttonList && buttonList.Count > 0)
{
if (LayoutDirection == ViewLayoutDirectionType.RTL)
{
{
get
{
- return Style.Track?.ResourceUrl?.All;
+ return Style?.Track?.ResourceUrl?.All;
}
set
{
- //CreateTrackImageAttributes();
- if (Style.Track.ResourceUrl == null)
+ if (null != Style?.Track)
{
- Style.Track.ResourceUrl = new StringSelector();
+ Style.Track.ResourceUrl = value;
}
- if (Style.Track.ResourceUrl != null)
- {
- Style.Track.ResourceUrl.All = value;
- }
- //RelayoutRequest();
}
}
{
get
{
- return Style.Progress?.ResourceUrl?.All;
+ return Style?.Progress?.ResourceUrl?.All;
}
set
{
- //CreateProgressImageAttributes();
- if (Style.Progress.ResourceUrl == null)
- {
- Style.Progress.ResourceUrl = new StringSelector();
- }
- if (Style.Progress.ResourceUrl != null)
+ if (null != Style?.Progress)
{
- Style.Progress.ResourceUrl.All = value;
+ Style.Progress.ResourceUrl = value;
}
- //RelayoutRequest();
}
}
{
get
{
- return Style.Buffer?.ResourceUrl?.All;
+ return Style?.Buffer?.ResourceUrl?.All;
}
set
{
- //CreateBufferImageAttributes();
- if (Style.Buffer.ResourceUrl == null)
+ if (null != Style?.Buffer)
{
- Style.Buffer.ResourceUrl = new StringSelector();
+ Style.Buffer.ResourceUrl = value;
+ RelayoutRequest();
}
- if (Style.Buffer.ResourceUrl != null)
- {
- Style.Buffer.ResourceUrl.All = value;
- }
- RelayoutRequest();
}
}
{
get
{
- return Style.Track?.BackgroundColor?.All;
+ return Style?.Track?.BackgroundColor?.All;
}
set
{
- //CreateTrackImageAttributes();
- if (Style.Track.BackgroundColor == null)
+ if (null != Style?.Track)
{
- Style.Track.BackgroundColor = new ColorSelector();
+ Style.Track.BackgroundColor = value;
}
- if (Style.Track.BackgroundColor != null)
- {
- Style.Track.BackgroundColor.All = value;
- }
- //RelayoutRequest();
}
}
{
get
{
- return Style.Progress?.BackgroundColor?.All;
+ return Style?.Progress?.BackgroundColor?.All;
}
set
{
- //CreateProgressImageAttributes();
- if (null == Style.Progress.BackgroundColor)
- {
- Style.Progress.BackgroundColor = new ColorSelector();
- }
- if (null != Style.Progress.BackgroundColor)
+ if (null != Style?.Progress)
{
- Style.Progress.BackgroundColor.All = value;
+ Style.Progress.BackgroundColor = value;
}
- //RelayoutRequest();
}
}
{
get
{
- return Style.Buffer?.BackgroundColor?.All;
+ return Style?.Buffer?.BackgroundColor?.All;
}
set
{
- //CreateBufferImageAttributes();
- if (null == Style.Buffer.BackgroundColor)
- {
- Style.Buffer.BackgroundColor = new ColorSelector();
- }
- if (null != Style.Buffer.BackgroundColor)
+ if (null != Style?.Buffer)
{
- Style.Buffer.BackgroundColor.All = value;
+ Style.Buffer.BackgroundColor = value;
}
- //RelayoutRequest();
}
}
/// <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 RadioButton(SelectButtonStyle attrs) : base(attrs) { }
+ public RadioButton(ButtonStyle attrs) : base(attrs) { }
/// <summary>
/// Get RadioButtonGroup to which this selections belong.
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
public RadioButtonGroup() : base()
{
-
}
/// <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)]
- public RadioButton GetItemByIndex(int index)
+ public RadioButton GetItem(int index)
{
return itemGroup[index] as RadioButton;
}
radio.ItemGroup = this;
}
-
/// <summary>
/// Remove RadioButton from the RadioButtonGroup.
/// </summary>
instance.Style.Duration = (uint)newValue;
if (instance.scrollAniPlayer != null)
{
- instance.scrollAniPlayer.Duration = (int)instance.Style.Duration;
+ instance.scrollAniPlayer.Duration = (int)newValue;
}
}
},
{
get
{
- if (Style.Thumb.Size == null)
- {
- Style.Thumb.Size = new Size();
- }
- return Style.Thumb.Size;
+ return Style?.Thumb?.Size;
}
set
{
- if (Style.Thumb.Size == null)
+ if (null != Style?.Thumb)
{
- Style.Thumb.Size = new Size();
- }
- if (Style.Thumb.Size != null && thumbImage != null)
- {
- Style.Thumb.Size.Width = value.Width;
- Style.Thumb.Size.Height = value.Height;
+ Style.Thumb.Size = value;
RelayoutRequest();
}
}
{
get
{
- return Style.Track.ResourceUrl.All;
+ return Style?.Track?.ResourceUrl?.All;
}
set
{
- if (trackImage != null)
+ if (null != Style?.Track)
{
- if (Style.Track.ResourceUrl == null)
- {
- Style.Track.ResourceUrl = new StringSelector();
- }
- if (Style.Track.ResourceUrl != null)
- {
- Style.Track.ResourceUrl.All = value;
- }
+ Style.Track.ResourceUrl = value;
+ RelayoutRequest();
}
- RelayoutRequest();
}
}
{
get
{
- return Style.Track.BackgroundColor?.All;
+ return Style?.Track?.BackgroundColor?.All;
}
set
{
- if (Style.Track.BackgroundColor == null)
+ if (null != Style?.Track)
{
- Style.Track.BackgroundColor = new ColorSelector { All = value };
- }
- else
- {
- Style.Track.BackgroundColor.All = value;
+ Style.Track.BackgroundColor = value;
+ RelayoutRequest();
}
- RelayoutRequest();
}
}
{
get
{
- return Style.Thumb.BackgroundColor?.All;
+ return Style?.Thumb?.BackgroundColor?.All;
}
set
{
- if(Style.Thumb.BackgroundColor == null)
+ if(null != Style?.Thumb)
{
- Style.Thumb.BackgroundColor = new ColorSelector { All = value };
- }
- else
- {
- Style.Thumb.BackgroundColor.All = value;
+ Style.Thumb.BackgroundColor = value;
+ RelayoutRequest();
}
- RelayoutRequest();
}
}
[EditorBrowsable(EditorBrowsableState.Never)]
protected SelectGroup itemGroup = null;
- private ImageControl selectableImage;
-
- /// 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 SelectButtonStyle Style => ViewStyle as SelectButtonStyle;
-
/// <summary>
/// Creates a new instance of a SelectButton.
/// </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)]
- public SelectButton(SelectButtonStyle style) : base(style)
+ public SelectButton(ButtonStyle style) : base(style)
{
Initialize();
}
}
/// <summary>
- /// Theme change callback when theme is changed, this callback will be trigger.
- /// </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 override void OnThemeChangedEvent(object sender, StyleManager.ThemeChangeEventArgs e)
- {
- SelectButtonStyle tempAttributes = StyleManager.Instance.GetAttributes(style) as SelectButtonStyle;
- if (tempAttributes != null)
- {
- Style?.CopyFrom(tempAttributes);
- UpdateUIContent();
- }
- }
-
- /// <summary>
/// Dispose SelectButton and all children on it.
/// </summary>
/// <param name="type">Dispose type.</param>
if (type == DisposeTypes.Explicit)
{
- if (selectableImage != null)
- {
- Remove(selectableImage);
- selectableImage.Dispose();
- selectableImage = null;
- }
}
base.Dispose(type);
}
- private void UpdateUIContent()
- {
- UpdateTextAttributes();
- base.OnUpdate();
-
- selectableImage?.RaiseToTop();
- }
-
/// <summary>
/// Called after a key event is received by the view that has had its focus set.
/// </summary>
return ret;
}
- /// 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 override void ApplyStyle(ViewStyle viewStyle)
- {
- base.ApplyStyle(viewStyle);
-
- SelectButtonStyle selectButtonStyle = viewStyle as SelectButtonStyle;
-
- if (null != selectButtonStyle)
- {
- if (selectableImage == null)
- {
- selectableImage = new ImageControl();
- selectableImage.Name = "SelectableImage";
- Add(selectableImage);
-
- selectableImage.RaiseToTop();
- }
-
- selectableImage.ApplyStyle(selectButtonStyle.SelectableImage);
- }
- }
-
- /// <summary>
- /// Get SelectButton attribues.
- /// </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 override ViewStyle GetViewStyle()
- {
- return new SelectButtonStyle();
- }
-
/// <summary>
/// Overrides this method if want to handle behavior after pressing return key by user.
/// </summary>
private void Initialize()
{
- if (selectableImage == null)
- {
- selectableImage = new ImageControl();
- selectableImage.Name = "SelectableImage";
- Add(selectableImage);
-
- selectableImage.RaiseToTop();
- }
- if (style != null)
- {
- Style.SelectableImage.PositionUsesPivotPoint = true;
- Style.SelectableImage.ParentOrigin = Tizen.NUI.ParentOrigin.TopLeft;
- Style.SelectableImage.PivotPoint = Tizen.NUI.PivotPoint.TopLeft;
-
- Style.IsSelectable = true;
- }
- LayoutDirectionChanged += SelectButtonLayoutDirectionChanged;
- }
-
- private void UpdateTextAttributes()
- {
- if (Style != null && Style.Text != null && selectableImage != null)
- {
- Style.Text.PositionUsesPivotPoint = true;
- Style.Text.ParentOrigin = Tizen.NUI.ParentOrigin.TopLeft;
- Style.Text.PivotPoint = Tizen.NUI.PivotPoint.TopLeft;
- Style.Text.WidthResizePolicy = ResizePolicyType.Fixed;
- Style.Text.HeightResizePolicy = ResizePolicyType.Fixed;
-
- int iconWidth = (int)selectableImage.SizeWidth;
-
- int textPaddingLeft = Style.Text.Padding.Start;
- int textPaddingRight = Style.Text.Padding.End;
-
- if(Style.Text.Size == null)
- {
- Style.Text.Size = new Size(Size2D.Width - iconWidth - selectableImage.Padding.Start - selectableImage.Padding.End - textPaddingLeft - textPaddingRight, Size2D.Height);
- }
-
- if(Style.Text.Position == null)
- {
- Style.Text.Position = new Position(selectableImage.Padding.Start + iconWidth + selectableImage.Padding.End + textPaddingLeft, 0);
- }
-
- Style.Text.VerticalAlignment = VerticalAlignment.Center;
- }
- }
-
- private void SelectButtonLayoutDirectionChanged(object sender, LayoutDirectionChangedEventArgs e)
- {
- if (Style == null || Style.Text == null)
- {
- return;
- }
-
- UpdateTextAttributes();
-
- int iconWidth = (int)selectableImage.SizeWidth;
-
- int textPaddingLeft = Style.Text.Padding.Start;
- int textPaddingRight = Style.Text.Padding.End;
- int pos = 0;
- if (Style.Text != null && Style.Text.Position != null)
- {
- 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;
+ if (null == Style) return;
+ Style.IsSelectable = true;
}
private void OnSelect()
/// <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 int Count
- {
- get
- {
- return itemGroup.Count;
- }
- }
+ public int Count => itemGroup.Count;
/// <summary>
/// Get the index of currently or latest selected item.
/// <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 int SelectedIndex
- {
- get
- {
- return selectedIndex;
- }
- }
+ public int SelectedIndex => selectedIndex;
/// <summary>
/// Construct SelectionGroup
itemGroup.Remove(selection);
}
-
/// <summary>
/// Overrides this method if want to handle behavior after pressing return key by user.
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
protected virtual void SelectionHandler(SelectButton selection)
{
-
}
private void OnSelectedEvent(object sender, SelectButton.SelectEventArgs args)
private ImageView slidedTrackImage = null;
// the thumb image object
private ImageView thumbImage = null;
- // the background thumb image object
- private ImageView bgThumbImage = null;
// the low indicator image object
private ImageView lowIndicatorImage = null;
// the high indicator image object
{
get
{
- return Style.Thumb?.ResourceUrl?.All;
+ return Style?.Thumb?.ResourceUrl?.All;
}
set
{
- if (Style.Thumb.ResourceUrl == null)
+ if (null != Style?.Thumb)
{
- Style.Thumb.ResourceUrl = new StringSelector();
- }
- if (Style.Thumb.ResourceUrl != null)
- {
- Style.Thumb.ResourceUrl.All = value;
+ Style.Thumb.ResourceUrl = value;
}
}
}
}
}
-
/// <summary>
/// Gets or sets the color of the background track image object.
/// </summary>
{
get
{
- return Style.Track?.BackgroundColor?.All;
+ return Style?.Track?.BackgroundColor?.All;
}
set
{
- if (Style.Track.BackgroundColor == null)
+ if (null != Style?.Track)
{
- Style.Track.BackgroundColor = new ColorSelector();
- }
- if (Style.Track.BackgroundColor != null)
- {
- Style.Track.BackgroundColor.All = value;
+ Style.Track.BackgroundColor = value;
}
}
}
{
get
{
- return Style.Progress?.BackgroundColor?.All;
+ return Style?.Progress?.BackgroundColor?.All;
}
set
{
- if (Style.Progress.BackgroundColor == null)
+ if (null != Style?.Progress)
{
- Style.Progress.BackgroundColor = new ColorSelector();
- }
- if (Style.Progress.BackgroundColor != null)
- {
- Style.Progress.BackgroundColor.All = value;
+ Style.Progress.BackgroundColor = value;
}
}
}
{
get
{
- return Style.LowIndicatorImage?.ResourceUrl?.All;
+ return Style?.LowIndicatorImage?.ResourceUrl?.All;
}
set
{
- if (Style.LowIndicatorImage.ResourceUrl == null)
- {
- Style.LowIndicatorImage.ResourceUrl = new StringSelector();
- }
- if (Style.LowIndicatorImage.ResourceUrl != null)
+ if (null != Style?.LowIndicatorImage)
{
- Style.LowIndicatorImage.ResourceUrl.All = value;
+ Style.LowIndicatorImage.ResourceUrl = value;
}
}
}
{
get
{
- return Style.HighIndicatorImage?.ResourceUrl?.All;
+ return Style?.HighIndicatorImage?.ResourceUrl?.All;
}
set
{
- if (Style.HighIndicatorImage.ResourceUrl == null)
- {
- Style.HighIndicatorImage.ResourceUrl = new StringSelector();
- }
- if (Style.HighIndicatorImage.ResourceUrl != null)
+ if (null != Style?.HighIndicatorImage)
{
- Style.HighIndicatorImage.ResourceUrl.All = value;
+ Style.HighIndicatorImage.ResourceUrl = value;
}
}
}
{
get
{
- return Style.LowIndicator?.Text?.All;
+ return Style?.LowIndicator?.Text?.All;
}
set
{
- if (Style.LowIndicator.Text == null)
+ if (null != Style?.LowIndicator)
{
- Style.LowIndicator.Text = new StringSelector();
- }
- if (Style.LowIndicator.Text != null)
- {
- Style.LowIndicator.Text.All = value;
+ Style.LowIndicator.Text= value;
}
}
}
{
get
{
- return Style.HighIndicator?.Text?.All;
+ return Style?.HighIndicator?.Text?.All;
}
set
{
- if (Style.HighIndicator.Text == null)
- {
- Style.HighIndicator.Text = new StringSelector();
- }
- if (Style.HighIndicator.Text != null)
+ if (null != Style?.HighIndicator)
{
- Style.HighIndicator.Text.All = value;
+ Style.HighIndicator.Text = value;
}
}
}
thumbImage.TouchEvent -= OnTouchEventForThumb;
Utility.Dispose(thumbImage);
}
- Utility.Dispose(bgThumbImage);
Utility.Dispose(slidedTrackImage);
if (null != bgTrackImage)
{
[EditorBrowsable(EditorBrowsableState.Never)]
protected override void OnThemeChangedEvent(object sender, StyleManager.ThemeChangeEventArgs e)
{
- SliderStyle tempAttributes = StyleManager.Instance.GetAttributes(style) as SliderStyle;
- if (tempAttributes != null)
+ SliderStyle sliderStyle = StyleManager.Instance.GetAttributes(style) as SliderStyle;
+ if (sliderStyle != null)
{
- Style.CopyFrom(tempAttributes);
+ Style?.CopyFrom(sliderStyle);
RelayoutRequest();
}
}
{
CreateThumbAttributes();
}
-
- if (null != sliderStyle.ThumbBackground)
- {
- CreateThumbBackgroundAttributes();
- }
}
private void Initialize()
bgTrackImage.Add(slidedTrackImage);
}
- if (null != bgThumbImage)
+ if (null != thumbImage)
{
- slidedTrackImage.Add(bgThumbImage);
+ slidedTrackImage.Add(thumbImage);
}
}
{
thumbImage = new ImageView()
{
- WidthResizePolicy = ResizePolicyType.FillToParent,
- HeightResizePolicy = ResizePolicyType.FillToParent,
+ WidthResizePolicy = ResizePolicyType.Fixed,
+ HeightResizePolicy = ResizePolicyType.Fixed,
ParentOrigin = NUI.ParentOrigin.Center,
PivotPoint = NUI.PivotPoint.Center,
PositionUsesPivotPoint = true
};
- if (bgThumbImage != null)
+ if (slidedTrackImage != null)
{
- bgThumbImage.Add(thumbImage);
+ slidedTrackImage.Add(thumbImage);
}
thumbImage.TouchEvent += OnTouchEventForThumb;
thumbImage.ApplyStyle(Style.Thumb);
}
- private void CreateThumbBackgroundAttributes()
- {
- if (null == bgThumbImage)
- {
- bgThumbImage = new ImageView()
- {
- WidthResizePolicy = ResizePolicyType.Fixed,
- HeightResizePolicy = ResizePolicyType.Fixed
- };
-
- if (slidedTrackImage != null)
- {
- slidedTrackImage.Add(bgThumbImage);
- }
-
- if (null != thumbImage)
- {
- bgThumbImage.Add(thumbImage);
- }
- }
-
- if (null == Style.ThumbBackground)
- {
- Style.ThumbBackground= new ImageViewStyle();
- }
-
- bgThumbImage.ApplyStyle(Style.ThumbBackground);
- }
-
private void OnPanGestureDetected(object source, PanGestureDetector.DetectedEventArgs e)
{
if (e.PanGesture.State == Gesture.StateType.Started)
slidedTrackImage.PivotPoint = NUI.PivotPoint.CenterLeft;
slidedTrackImage.PositionUsesPivotPoint = true;
}
- if (bgThumbImage != null)
+ if (thumbImage != null)
{
- bgThumbImage.ParentOrigin = NUI.ParentOrigin.CenterRight;
- bgThumbImage.PivotPoint = NUI.PivotPoint.Center;
- bgThumbImage.PositionUsesPivotPoint = true;
+ thumbImage.ParentOrigin = NUI.ParentOrigin.CenterRight;
+ thumbImage.PivotPoint = NUI.PivotPoint.Center;
+ thumbImage.PositionUsesPivotPoint = true;
}
if (lowIndicatorImage != null)
{
slidedTrackImage.PivotPoint = NUI.PivotPoint.BottomCenter;
slidedTrackImage.PositionUsesPivotPoint = true;
}
- if (bgThumbImage != null)
+ if (thumbImage != null)
{
- bgThumbImage.ParentOrigin = NUI.ParentOrigin.TopCenter;
- bgThumbImage.PivotPoint = NUI.PivotPoint.Center;
- bgThumbImage.PositionUsesPivotPoint = true;
+ thumbImage.ParentOrigin = NUI.ParentOrigin.TopCenter;
+ thumbImage.PivotPoint = NUI.PivotPoint.Center;
+ thumbImage.PositionUsesPivotPoint = true;
}
if (lowIndicatorImage != null)
{
{
get
{
- return Style.Track?.ResourceUrl?.All;
+ return Style?.Track?.ResourceUrl?.All;
}
set
{
- if (value != null)
+ if (null != value && null != Style?.Track)
{
- if (Style.Track.ResourceUrl == null)
- {
- Style.Track.ResourceUrl = new StringSelector();
- }
- if (Style.Track.ResourceUrl != null)
- {
- Style.Track.ResourceUrl.All = value;
- }
+ Style.Track.ResourceUrl = value;
}
}
}
{
get
{
- return Style.Thumb?.ResourceUrl?.All;
+ return Style?.Thumb?.ResourceUrl?.All;
}
set
{
- if (value != null)
+ if (null != value && null != Style?.Thumb)
{
- if (Style.Thumb.ResourceUrl == null)
- {
- Style.Thumb.ResourceUrl = new StringSelector();
- }
- if (Style.Thumb.ResourceUrl != null)
- {
- Style.Thumb.ResourceUrl.All = value;
- }
+ Style.Thumb.ResourceUrl = value;
}
}
}
}
}
-
/// <summary>
/// Handler image's size in Switch.
/// </summary>
{
get
{
- return Style.Thumb?.Size ?? new Size(0, 0);
+ return Style?.Thumb?.Size;
}
set
{
- Style.Thumb.Size = value;
+ if (null != Style?.Thumb)
+ {
+ Style.Thumb.Size = value;
+ }
}
}
{
get
{
- return Style.UseTextNaturalSize;
+ return Style?.UseTextNaturalSize ?? false;
}
set
{
- Style.UseTextNaturalSize = value;
- RelayoutRequest();
+ if (null != Style)
+ {
+ Style.UseTextNaturalSize = value;
+ RelayoutRequest();
+ }
}
}
{
get
{
- return Style.ItemSpace;
+ return Style?.ItemSpace ?? 0;
}
set
{
- Style.ItemSpace = value;
- RelayoutRequest();
+ if (null != Style)
+ {
+ Style.ItemSpace = value;
+ RelayoutRequest();
+ }
}
}
}
set
{
- if(null != value)
+ if(null != value && null != Style?.ItemPadding)
{
Style.ItemPadding.CopyFrom(value);
{
get
{
- return Style.UnderLine?.Size;
+ return Style?.UnderLine?.Size;
}
set
{
- if (value != null)
+ if (null != Style?.UnderLine)
{
- //CreateUnderLineAttributes();
Style.UnderLine.Size = value;
- //RelayoutRequest();
}
}
}
{
get
{
- return Style.UnderLine?.BackgroundColor?.All;
+ return Style?.UnderLine?.BackgroundColor?.All;
}
set
{
- if (value != null)
+ if (null != Style?.UnderLine)
{
- //CreateUnderLineAttributes();
- if (Style.UnderLine.BackgroundColor == null)
- {
- Style.UnderLine.BackgroundColor = new ColorSelector();
- }
- if (Style.UnderLine.BackgroundColor != null)
- {
- Style.UnderLine.BackgroundColor.All = value;
- }
- //RelayoutRequest();
+ Style.UnderLine.BackgroundColor = value;
}
}
}
{
get
{
- return Style.Text?.PointSize?.All ?? 0;
+ return Style?.Text?.PointSize?.All ?? 0;
}
set
{
- //CreateTextAttributes();
- if (Style.Text.PointSize == null)
- {
- Style.Text.PointSize = new FloatSelector();
- }
- if (Style.Text.PointSize != null)
+ if (null != Style?.Text)
{
- Style.Text.PointSize.All = value;
+ Style.Text.PointSize = value;
}
- //RelayoutRequest();
}
}
{
get
{
- return Style.Text?.FontFamily.All;
+ return Style?.Text?.FontFamily?.All;
}
set
{
- //CreateTextAttributes();
- Style.Text.FontFamily.All = value;
- //RelayoutRequest();
+ if (null != Style?.Text)
+ {
+ Style.Text.FontFamily = value;
+ }
}
}
{
get
{
- return Style.Text?.TextColor?.All;
+ return Style?.Text?.TextColor?.All;
}
set
{
- //CreateTextAttributes();
- if (Style.Text.TextColor == null)
- {
- Style.Text.TextColor = new ColorSelector();
- }
- if (Style.Text.TextColor != null)
+ if (null != Style?.Text)
{
- Style.Text.TextColor.All = value;
+ Style.Text.TextColor = value;
}
- //RelayoutRequest();
}
}
}
}
-
/// <summary>
/// Add tab item by item data. The added item will be added to end of all items automatically.
/// </summary>
{
get
{
- return (float)Style.Text?.PointSize?.All;
+ return (float)Style?.Text?.PointSize?.All;
}
set
{
- if (null == Style.Text.PointSize)
+ if (null != Style?.Text)
{
- Style.Text.PointSize = new FloatSelector();
- }
- if (null != Style.Text.PointSize)
- {
- Style.Text.PointSize.All = value;
+ Style.Text.PointSize = value;
}
}
}
{
get
{
- return Style.Text?.FontFamily.All;
+ return Style?.Text?.FontFamily?.All;
}
set
{
- Style.Text.FontFamily = value;
+ if (null != Style?.Text)
+ {
+ Style.Text.FontFamily = value;
+ }
}
}
{
get
{
- return Style.Text?.TextColor?.All;
+ return Style?.Text?.TextColor?.All;
}
set
{
- //CreateTextAttributes();
- if (null == Style.Text.TextColor)
+ if (null != Style?.Text)
{
- Style.Text.TextColor = new ColorSelector();
+ Style.Text.TextColor = value;
}
- if (null != Style.Text.TextColor)
- {
- Style.Text.TextColor.All = value;
- }
- //RelayoutRequest();
}
}
{
get
{
- return Style.Text?.HorizontalAlignment ?? HorizontalAlignment.Center;
+ return Style?.Text?.HorizontalAlignment ?? HorizontalAlignment.Center;
}
set
{
- //CreateTextAttributes();
- Style.Text.HorizontalAlignment = value;
- //RelayoutRequest();
+ if (null != Style?.Text)
+ {
+ Style.Text.HorizontalAlignment = value;
+ }
}
}
});
/// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- public static readonly BindableProperty BackgroundImageProperty = BindableProperty.Create("BackgroundImage", typeof(string), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
+ public static readonly BindableProperty BackgroundImageSelectorProperty = BindableProperty.Create("BackgroundImageSelector", typeof(Selector<string>), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
{
var viewStyle = (ViewStyle)bindable;
- viewStyle.backgroundImage = (string)newValue;
+ if (null == viewStyle.backgroundImageSelector) viewStyle.backgroundImageSelector = new Selector<string>();
+ viewStyle.backgroundImageSelector.Clone((Selector<string>)newValue);
},
defaultValueCreator: (bindable) =>
{
var viewStyle = (ViewStyle)bindable;
- return viewStyle.backgroundImage;
+ return viewStyle.backgroundImageSelector;
});
/// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
});
/// 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 OpacitySelectorProperty = BindableProperty.Create("OpacitySelector", typeof(Selector<float?>), typeof(ViewStyle), null, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) =>
+ public static readonly BindableProperty OpacitySelectorProperty = BindableProperty.Create("OpacitySelector", typeof(Selector<float?>), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
{
var viewStyle = (ViewStyle)bindable;
- viewStyle.OpacitySelector.Clone((Selector<float?>)newValue);
- }),
+ if (null == viewStyle.opacitySelector) viewStyle.opacitySelector = new Selector<float?>();
+ viewStyle.opacitySelector.Clone((Selector<float?>)newValue);
+ },
defaultValueCreator: (bindable) =>
{
- var viewStyle = (ViewStyle)bindable;
- return viewStyle.OpacitySelector;
+ var controlStyle = (ViewStyle)bindable;
+ return controlStyle.opacitySelector;
});
/// 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 PaddingProperty = BindableProperty.Create("Padding", typeof(Extents), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
{
var viewStyle = (ViewStyle)bindable;
- if (null == viewStyle.padding)
- {
- viewStyle.padding = new Extents((ushort start, ushort end, ushort top, ushort bottom) =>
- {
- Extents extents = new Extents(start, end, top, bottom);
- viewStyle.padding.CopyFrom(extents);
- viewStyle.SetValue(PaddingProperty, extents);
- }, 0, 0, 0, 0);
- }
- viewStyle.padding.CopyFrom((Extents)newValue);
+ viewStyle.padding = (Extents)newValue;
},
defaultValueCreator: (bindable) =>
{
var viewStyle = (ViewStyle)bindable;
-
- if (null == viewStyle.padding)
- {
- viewStyle.padding = new Extents((ushort start, ushort end, ushort top, ushort bottom) =>
- {
- Extents extents = new Extents(start, end, top, bottom);
- viewStyle.padding.CopyFrom(extents);
- viewStyle.SetValue(PaddingProperty, extents);
- }, 0, 0, 0, 0);
- }
-
return viewStyle.padding;
});
/// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
defaultValueCreator: (bindable) =>
{
var viewStyle = (ViewStyle)bindable;
-
- if (null == viewStyle.padding)
- {
- viewStyle.margin = new Extents((ushort start, ushort end, ushort top, ushort bottom) =>
- {
- Extents extents = new Extents(start, end, top, bottom);
- viewStyle.margin.CopyFrom(extents);
- viewStyle.SetValue(MarginProperty, extents);
- }, 0, 0, 0, 0);
- }
-
return viewStyle.margin;
});
/// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
public static readonly BindableProperty BackgroundColorSelectorProperty = BindableProperty.Create("BackgroundColorSelector", typeof(Selector<Color>), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
{
var viewStyle = (ViewStyle)bindable;
- viewStyle.BackgroundColorSelector.Clone((Selector<Color>)newValue);
+ if (null == viewStyle.backgroundColorSelector) viewStyle.backgroundColorSelector = new Selector<Color>();
+ viewStyle.backgroundColorSelector.Clone((Selector<Color>)newValue);
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var viewStyle = (ViewStyle)bindable;
+ return viewStyle.backgroundColorSelector;
+ });
+ /// 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 BackgroundImageBorderSelectorProperty = BindableProperty.Create("BackgroundImageBorderSelector", typeof(Selector<Rectangle>), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var viewStyle = (ViewStyle)bindable;
+ if (null == viewStyle.backgroundImageBorderSelector) viewStyle.backgroundImageBorderSelector = new Selector<Rectangle>();
+ viewStyle.backgroundImageBorderSelector.Clone((Selector<Rectangle>)newValue);
},
defaultValueCreator: (bindable) =>
{
var viewStyle = (ViewStyle)bindable;
- return viewStyle.BackgroundColorSelector;
+ return viewStyle.backgroundImageBorderSelector;
});
/// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
public string StyleName
{
- get
- {
- string temp = (string)GetValue(StyleNameProperty);
- return temp;
- }
- set
- {
- SetValue(StyleNameProperty, value);
- }
+ get => (string)GetValue(StyleNameProperty);
+ set => SetValue(StyleNameProperty, value);
}
+ private Selector<string> backgroundImageSelector;
/// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- public string BackgroundImage
+ public Selector<string> BackgroundImage
{
get
{
- string temp = (string)GetValue(BackgroundImageProperty);
- return temp;
- }
- set
- {
- SetValue(BackgroundImageProperty, value);
+ Selector<string> image = (Selector<string>)GetValue(BackgroundImageSelectorProperty);
+ return (null != image) ? image : backgroundImageSelector = new Selector<string>();
}
+ set => SetValue(BackgroundImageSelectorProperty, value);
}
/// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
public View.States? State
{
- get
- {
- View.States? temp = (View.States?)GetValue(StateProperty);
- return temp;
- }
- set
- {
- SetValue(StateProperty, value);
- }
+ get => (View.States?)GetValue(StateProperty);
+ set => SetValue(StateProperty, value);
}
/// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
public View.States? SubState
{
- get
- {
- View.States? temp = (View.States?)GetValue(SubStateProperty);
- return temp;
- }
- set
- {
- SetValue(SubStateProperty, value);
- }
+ get => (View.States?)GetValue(SubStateProperty);
+ set => SetValue(SubStateProperty, value);
}
/// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
public float? Flex
{
- get
- {
- float? temp = (float?)GetValue(FlexProperty);
- return temp;
- }
- set
- {
- SetValue(FlexProperty, value);
- }
+ get => (float?)GetValue(FlexProperty);
+ set => SetValue(FlexProperty, value);
}
/// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
public int? AlignSelf
{
- get
- {
- int? temp = (int?)GetValue(AlignSelfProperty);
- return temp;
- }
- set
- {
- SetValue(AlignSelfProperty, value);
- }
+ get => (int?)GetValue(AlignSelfProperty);
+ set => SetValue(AlignSelfProperty, value);
}
/// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
public Vector4 FlexMargin
{
- get
- {
- Vector4 temp = (Vector4)GetValue(FlexMarginProperty);
- return temp;
- }
- set
- {
- SetValue(FlexMarginProperty, value);
- }
+ get => (Vector4)GetValue(FlexMarginProperty);
+ set => SetValue(FlexMarginProperty, value);
}
/// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
public Vector2 CellIndex
{
- get
- {
- Vector2 temp = (Vector2)GetValue(CellIndexProperty);
- return temp;
- }
- set
- {
- SetValue(CellIndexProperty, value);
- }
+ get => (Vector2)GetValue(CellIndexProperty);
+ set => SetValue(CellIndexProperty, value);
}
/// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
public float? RowSpan
{
- get
- {
- float? temp = (float?)GetValue(RowSpanProperty);
- return temp;
- }
- set
- {
- SetValue(RowSpanProperty, value);
- }
+ get => (float?)GetValue(RowSpanProperty);
+ set => SetValue(RowSpanProperty, value);
}
/// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
public float? ColumnSpan
{
- get
- {
- float? temp = (float?)GetValue(ColumnSpanProperty);
- return temp;
- }
- set
- {
- SetValue(ColumnSpanProperty, value);
- }
+ get => (float?)GetValue(ColumnSpanProperty);
+ set => SetValue(ColumnSpanProperty, value);
}
/// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
public HorizontalAlignmentType? CellHorizontalAlignment
{
- get
- {
- HorizontalAlignmentType? temp = (HorizontalAlignmentType?)GetValue(CellHorizontalAlignmentProperty);
- return temp;
- }
- set
- {
- SetValue(CellHorizontalAlignmentProperty, value);
- }
+ get => (HorizontalAlignmentType?)GetValue(CellHorizontalAlignmentProperty);
+ set => SetValue(CellHorizontalAlignmentProperty, value);
}
/// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
public VerticalAlignmentType? CellVerticalAlignment
{
- get
- {
- VerticalAlignmentType? temp = (VerticalAlignmentType?)GetValue(CellVerticalAlignmentProperty);
- return temp;
- }
- set
- {
- SetValue(CellVerticalAlignmentProperty, value);
- }
+ get => (VerticalAlignmentType?)GetValue(CellVerticalAlignmentProperty);
+ set => SetValue(CellVerticalAlignmentProperty, value);
}
/// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
public View LeftFocusableView
{
- get
- {
- View temp = (View)GetValue(LeftFocusableViewProperty);
- return temp;
- }
- set
- {
- SetValue(LeftFocusableViewProperty, value);
- }
+ get => (View)GetValue(LeftFocusableViewProperty);
+ set => SetValue(LeftFocusableViewProperty, value);
}
/// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
public View RightFocusableView
{
- get
- {
- View temp = (View)GetValue(RightFocusableViewProperty);
- return temp;
- }
- set
- {
- SetValue(RightFocusableViewProperty, value);
- }
+ get => (View)GetValue(RightFocusableViewProperty);
+ set => SetValue(RightFocusableViewProperty, value);
}
/// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
public View UpFocusableView
{
- get
- {
- View temp = (View)GetValue(UpFocusableViewProperty);
- return temp;
- }
- set
- {
- SetValue(UpFocusableViewProperty, value);
- }
+ get => (View)GetValue(UpFocusableViewProperty);
+ set => SetValue(UpFocusableViewProperty, value);
}
/// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
public View DownFocusableView
{
- get
- {
- View temp = (View)GetValue(DownFocusableViewProperty);
- return temp;
- }
- set
- {
- SetValue(DownFocusableViewProperty, value);
- }
+ get => (View)GetValue(DownFocusableViewProperty);
+ set => SetValue(DownFocusableViewProperty, value);
}
/// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
public bool? Focusable
{
- get
- {
- bool? temp = (bool?)GetValue(FocusableProperty);
- return temp;
- }
- set
- {
- SetValue(FocusableProperty, value);
- }
+ get => (bool?)GetValue(FocusableProperty);
+ set => SetValue(FocusableProperty, value);
}
/// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
public Size2D Size2D
{
- get
- {
- Size2D temp = (Size2D)GetValue(Size2DProperty);
- return temp;
- }
- set
- {
- SetValue(Size2DProperty, value);
- }
+ get => (Size2D)GetValue(Size2DProperty);
+ set => SetValue(Size2DProperty, value);
}
private Selector<float?> opacitySelector;
- private Selector<float?> OpacitySelector
- {
- get
- {
- if (null == opacitySelector)
- {
- opacitySelector = new Selector<float?>();
- }
- return opacitySelector;
- }
- }
/// 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<float?> Opacity
{
get
{
- return (Selector<float?>)GetValue(OpacitySelectorProperty);
- }
- set
- {
- SetValue(OpacitySelectorProperty, value);
+ Selector<float?> opacity = (Selector<float?>)GetValue(OpacitySelectorProperty);
+ return (null != opacity) ? opacity : opacitySelector = new Selector<float?>();
}
+ set => SetValue(OpacitySelectorProperty, value);
}
/// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
public Position2D Position2D
{
- get
- {
- Position2D temp = (Position2D)GetValue(Position2DProperty);
- return temp;
- }
- set
- {
- SetValue(Position2DProperty, value);
- }
+ get => (Position2D)GetValue(Position2DProperty);
+ set => SetValue(Position2DProperty, value);
}
/// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
public bool? PositionUsesPivotPoint
{
- get
- {
- bool? temp = (bool?)GetValue(PositionUsesPivotPointProperty);
- return temp;
- }
- set
- {
- SetValue(PositionUsesPivotPointProperty, value);
- }
+ get => (bool?)GetValue(PositionUsesPivotPointProperty);
+ set => SetValue(PositionUsesPivotPointProperty, value);
}
/// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
public int? SiblingOrder
{
- get
- {
- int? temp = (int?)GetValue(SiblingOrderProperty);
- return temp;
- }
- set
- {
- SetValue(SiblingOrderProperty, value);
- }
+ get => (int?)GetValue(SiblingOrderProperty);
+ set => SetValue(SiblingOrderProperty, value);
}
/// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
public Position ParentOrigin
{
- get
- {
- Position temp = (Position)GetValue(ParentOriginProperty);
- return temp;
- }
- set
- {
- SetValue(ParentOriginProperty, value);
- }
+ get => (Position)GetValue(ParentOriginProperty);
+ set => SetValue(ParentOriginProperty, value);
}
/// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
public Position PivotPoint
{
- get
- {
- Position temp = (Position)GetValue(PivotPointProperty);
- return temp;
- }
- set
- {
- SetValue(PivotPointProperty, value);
- }
+ get => (Position)GetValue(PivotPointProperty);
+ set => SetValue(PivotPointProperty, value);
}
/// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
public float? SizeWidth
{
- get
- {
- float? temp = (float?)GetValue(SizeWidthProperty);
- return temp;
- }
- set
- {
- SetValue(SizeWidthProperty, value);
- }
+ get => (float?)GetValue(SizeWidthProperty);
+ set => SetValue(SizeWidthProperty, value);
}
/// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
public float? SizeHeight
{
- get
- {
- float? temp = (float?)GetValue(SizeHeightProperty);
- return temp;
- }
- set
- {
- SetValue(SizeHeightProperty, value);
- }
+ get => (float?)GetValue(SizeHeightProperty);
+ set => SetValue(SizeHeightProperty, value);
}
/// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
public Position Position
{
- get
- {
- Position temp = (Position)GetValue(PositionProperty);
- return temp;
- }
- set
- {
- SetValue(PositionProperty, value);
- }
+ get => (Position)GetValue(PositionProperty);
+ set => SetValue(PositionProperty, value);
}
/// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
public float? PositionX
{
- get
- {
- float? temp = (float?)GetValue(PositionXProperty);
- return temp;
- }
- set
- {
- SetValue(PositionXProperty, value);
- }
+ get => (float?)GetValue(PositionXProperty);
+ set => SetValue(PositionXProperty, value);
}
/// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
public float? PositionY
{
- get
- {
- float? temp = (float?)GetValue(PositionYProperty);
- return temp;
- }
- set
- {
- SetValue(PositionYProperty, value);
- }
+ get => (float?)GetValue(PositionYProperty);
+ set => SetValue(PositionYProperty, value);
}
/// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
public float? PositionZ
{
- get
- {
- float? temp = (float?)GetValue(PositionZProperty);
- return temp;
- }
- set
- {
- SetValue(PositionZProperty, value);
- }
+ get => (float?)GetValue(PositionZProperty);
+ set => SetValue(PositionZProperty, value);
}
/// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
public Rotation Orientation
{
- get
- {
- Rotation temp = (Rotation)GetValue(OrientationProperty);
- return temp;
- }
- set
- {
- SetValue(OrientationProperty, value);
- }
+ get => (Rotation)GetValue(OrientationProperty);
+ set => SetValue(OrientationProperty, value);
}
/// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
public Vector3 Scale
{
- get
- {
- Vector3 temp = (Vector3)GetValue(ScaleProperty);
- return temp;
- }
- set
- {
- SetValue(ScaleProperty, value);
- }
+ get => (Vector3)GetValue(ScaleProperty);
+ set => SetValue(ScaleProperty, value);
}
/// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
public float? ScaleX
{
- get
- {
- float? temp = (float?)GetValue(ScaleXProperty);
- return temp;
- }
- set
- {
- SetValue(ScaleXProperty, value);
- }
+ get => (float?)GetValue(ScaleXProperty);
+ set => SetValue(ScaleXProperty, value);
}
/// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
public float? ScaleY
{
- get
- {
- float? temp = (float?)GetValue(ScaleYProperty);
- return temp;
- }
- set
- {
- SetValue(ScaleYProperty, value);
- }
+ get => (float?)GetValue(ScaleYProperty);
+ set => SetValue(ScaleYProperty, value);
}
/// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
public float? ScaleZ
{
- get
- {
- float? temp = (float?)GetValue(ScaleZProperty);
- return temp;
- }
- set
- {
- SetValue(ScaleZProperty, value);
- }
+ get => (float?)GetValue(ScaleZProperty);
+ set => SetValue(ScaleZProperty, value);
}
/// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
public string Name
{
- get
- {
- string temp = (string)GetValue(NameProperty);
- return temp;
- }
- set
- {
- SetValue(NameProperty, value);
- }
+ get => (string)GetValue(NameProperty);
+ set => SetValue(NameProperty, value);
}
/// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
public bool? Sensitive
{
- get
- {
- bool? temp = (bool?)GetValue(SensitiveProperty);
- return temp;
- }
- set
- {
- SetValue(SensitiveProperty, value);
- }
+ get => (bool?)GetValue(SensitiveProperty);
+ set => SetValue(SensitiveProperty, value);
}
/// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
public bool? LeaveRequired
{
- get
- {
- bool? temp = (bool?)GetValue(LeaveRequiredProperty);
- return temp;
- }
- set
- {
- SetValue(LeaveRequiredProperty, value);
- }
+ get => (bool?)GetValue(LeaveRequiredProperty);
+ set => SetValue(LeaveRequiredProperty, value);
}
/// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
public bool? InheritOrientation
{
- get
- {
- bool? temp = (bool?)GetValue(InheritOrientationProperty);
- return temp;
- }
- set
- {
- SetValue(InheritOrientationProperty, value);
- }
+ get => (bool?)GetValue(InheritOrientationProperty);
+ set => SetValue(InheritOrientationProperty, value);
}
/// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
public bool? InheritScale
{
- get
- {
- bool? temp = (bool?)GetValue(InheritScaleProperty);
- return temp;
- }
- set
- {
- SetValue(InheritScaleProperty, value);
- }
+ get => (bool?)GetValue(InheritScaleProperty);
+ set => SetValue(InheritScaleProperty, value);
}
/// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
public DrawModeType? DrawMode
{
- get
- {
- DrawModeType? temp = (DrawModeType?)GetValue(DrawModeProperty);
- return temp;
- }
- set
- {
- SetValue(DrawModeProperty, value);
- }
+ get => (DrawModeType?)GetValue(DrawModeProperty);
+ set => SetValue(DrawModeProperty, value);
}
/// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
public Vector3 SizeModeFactor
{
- get
- {
- Vector3 temp = (Vector3)GetValue(SizeModeFactorProperty);
- return temp;
- }
- set
- {
- SetValue(SizeModeFactorProperty, value);
- }
+ get => (Vector3)GetValue(SizeModeFactorProperty);
+ set => SetValue(SizeModeFactorProperty, value);
}
/// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
public ResizePolicyType? WidthResizePolicy
{
- get
- {
- ResizePolicyType? temp = (ResizePolicyType?)GetValue(WidthResizePolicyProperty);
- return temp;
- }
- set
- {
- SetValue(WidthResizePolicyProperty, value);
- }
+ get => (ResizePolicyType?)GetValue(WidthResizePolicyProperty);
+ set => SetValue(WidthResizePolicyProperty, value);
}
/// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
public ResizePolicyType? HeightResizePolicy
{
- get
- {
- ResizePolicyType? temp = (ResizePolicyType?)GetValue(HeightResizePolicyProperty);
- return temp;
- }
- set
- {
- SetValue(HeightResizePolicyProperty, value);
- }
+ get => (ResizePolicyType?)GetValue(HeightResizePolicyProperty);
+ set => SetValue(HeightResizePolicyProperty, value);
}
/// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
public SizeScalePolicyType? SizeScalePolicy
{
- get
- {
- SizeScalePolicyType? temp = (SizeScalePolicyType?)GetValue(SizeScalePolicyProperty);
- return temp;
- }
- set
- {
- SetValue(SizeScalePolicyProperty, value);
- }
+ get => (SizeScalePolicyType?)GetValue(SizeScalePolicyProperty);
+ set => SetValue(SizeScalePolicyProperty, value);
}
/// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
public bool? WidthForHeight
{
- get
- {
- bool? temp = (bool?)GetValue(WidthForHeightProperty);
- return temp;
- }
- set
- {
- SetValue(WidthForHeightProperty, value);
- }
+ get => (bool?)GetValue(WidthForHeightProperty);
+ set => SetValue(WidthForHeightProperty, value);
}
/// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
public bool? HeightForWidth
{
- get
- {
- bool? temp = (bool?)GetValue(HeightForWidthProperty);
- return temp;
- }
- set
- {
- SetValue(HeightForWidthProperty, value);
- }
+ get => (bool?)GetValue(HeightForWidthProperty);
+ set => SetValue(HeightForWidthProperty, value);
}
/// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
{
get
{
- Extents temp = (Extents)GetValue(PaddingProperty);
- return temp;
- }
- set
- {
- SetValue(PaddingProperty, value);
+ Extents tmp = (Extents)GetValue(PaddingProperty);
+ return (null != tmp) ? tmp : padding = new Extents((ushort start, ushort end, ushort top, ushort bottom) => { Padding = new Extents(start, end, top, bottom); }, 0, 0, 0, 0);
}
+ set => SetValue(PaddingProperty, value);
}
/// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
public Size2D MinimumSize
{
- get
- {
- Size2D temp = (Size2D)GetValue(MinimumSizeProperty);
- return temp;
- }
- set
- {
- SetValue(MinimumSizeProperty, value);
- }
+ get => (Size2D)GetValue(MinimumSizeProperty);
+ set => SetValue(MinimumSizeProperty, value);
}
/// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
public Size2D MaximumSize
{
- get
- {
- Size2D temp = (Size2D)GetValue(MaximumSizeProperty);
- return temp;
- }
- set
- {
- SetValue(MaximumSizeProperty, value);
- }
+ get => (Size2D)GetValue(MaximumSizeProperty);
+ set => SetValue(MaximumSizeProperty, value);
}
/// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
public bool? InheritPosition
{
- get
- {
- bool? temp = (bool?)GetValue(InheritPositionProperty);
- return temp;
- }
- set
- {
- SetValue(InheritPositionProperty, value);
- }
+ get => (bool?)GetValue(InheritPositionProperty);
+ set => SetValue(InheritPositionProperty, value);
}
/// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
public ClippingModeType? ClippingMode
{
- get
- {
- ClippingModeType? temp = (ClippingModeType?)GetValue(ClippingModeProperty);
- return temp;
- }
- set
- {
- SetValue(ClippingModeProperty, value);
- }
+ get => (ClippingModeType?)GetValue(ClippingModeProperty);
+ set => SetValue(ClippingModeProperty, value);
}
/// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
{
get
{
- Size temp = (Size)GetValue(SizeProperty);
- return temp;
- }
- set
- {
- SetValue(SizeProperty, value);
+ Size tmp = (Size)GetValue(SizeProperty);
+ return (null != tmp) ? tmp : size = new Size((float width, float height, float depth) => { Size = new Size(width, height, depth); }, 0, 0, 0);
}
+ set => SetValue(SizeProperty, value);
}
/// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
public bool? InheritLayoutDirection
{
- get
- {
- bool? temp = (bool?)GetValue(InheritLayoutDirectionProperty);
- return temp;
- }
- set
- {
- SetValue(InheritLayoutDirectionProperty, value);
- }
+ get => (bool?)GetValue(InheritLayoutDirectionProperty);
+ set => SetValue(InheritLayoutDirectionProperty, value);
}
/// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
public ViewLayoutDirectionType? LayoutDirection
{
- get
- {
- ViewLayoutDirectionType? temp = (ViewLayoutDirectionType?)GetValue(LayoutDirectionProperty);
- return temp;
- }
- set
- {
- SetValue(LayoutDirectionProperty, value);
- }
+ get => (ViewLayoutDirectionType?)GetValue(LayoutDirectionProperty);
+ set => SetValue(LayoutDirectionProperty, value);
}
/// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
{
get
{
- Extents temp = (Extents)GetValue(MarginProperty);
- return temp;
- }
- set
- {
- SetValue(MarginProperty, value);
+ Extents tmp = (Extents)GetValue(MarginProperty);
+ return (null != tmp) ? tmp : margin = new Extents((ushort start, ushort end, ushort top, ushort bottom) => { Margin = new Extents(start, end, top, bottom); }, 0, 0, 0, 0);
}
+ set => SetValue(MarginProperty, value);
}
/// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
public float? Weight
{
- get
- {
- float? temp = (float?)GetValue(WeightProperty);
- return temp;
- }
- set
- {
- SetValue(WeightProperty, value);
- }
+ get => (float?)GetValue(WeightProperty);
+ set => SetValue(WeightProperty, value);
}
private Selector<Color> backgroundColorSelector;
- private Selector<Color> BackgroundColorSelector
+ /// <summary> View BackgroundColor </summary>
+ /// 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 Selector<Color> BackgroundColor
{
get
{
- if (null == backgroundColorSelector)
- {
- backgroundColorSelector = new Selector<Color>();
- }
- return backgroundColorSelector;
+ Selector<Color> color = (Selector<Color>)GetValue(BackgroundColorSelectorProperty);
+ return (null != color) ? color : backgroundColorSelector = new Selector<Color>();
}
+ set => SetValue(BackgroundColorSelectorProperty, value);
}
- /// <summary>
- /// View BackgroundColor
- /// </summary>
+ private Selector<Rectangle> backgroundImageBorderSelector;
+ /// <summary>View BackgroundBorder</summary>
/// 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 Selector<Color> BackgroundColor
+ public Selector<Rectangle> BackgroundImageBorder
{
get
{
- return (Selector<Color>)GetValue(BackgroundColorSelectorProperty);
- }
- set
- {
- SetValue(BackgroundColorSelectorProperty, value);
+ Selector<Rectangle> border = (Selector<Rectangle>)GetValue(BackgroundImageBorderSelectorProperty);
+ return (null != border) ? border : backgroundImageBorderSelector = new Selector<Rectangle>();
}
+ set => SetValue(BackgroundImageBorderSelectorProperty, value);
}
}
}
private bool _backgroundImageSynchronosLoading = false;
private Dictionary<string, Transition> transDictionary = new Dictionary<string, Transition>();
private string[] transitionNames;
+ private Rectangle backgroundImageBorder;
private ViewStyle viewStyle;
/// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
ControlStateChangeEvent?.Invoke(this, value);
- foreach (View child in Children)
+ if (true == OnControlStateChanged(value))
{
- child.ControlState = value;
+ foreach (View child in Children)
+ {
+ child.ControlState = value;
+ }
}
}
}
}
/// <summary>
+ /// Get or set the border of background image.
+ /// </summary>
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public Rectangle BackgroundImageBorder
+ {
+ get
+ {
+ return (Rectangle)GetValue(BackgroundImageBorderProperty);
+ }
+ set
+ {
+ SetValue(BackgroundImageBorderProperty, value);
+ NotifyPropertyChanged();
+ }
+ }
+
+ /// <summary>
/// The background of view.
/// </summary>
/// <since_tizen> 3 </since_tizen>
}
/// <summary>
- /// Get attribues, it is abstract function and must be override.
+ /// Get Style, it is abstract function and must be override.
/// </summary>
/// <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.
return viewStyle;
}
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ protected virtual bool OnControlStateChanged(ControlStates currentState)
+ {
+ //If need to apply the state to all child, return true;
+ return true;
+ }
+ internal static readonly BindableProperty BackgroundImageSelectorProperty = BindableProperty.Create("BackgroundImageSelector", typeof(Selector<string>), typeof(View), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var view = (View)bindable;
+ view.backgroundImageSelector.Clone((Selector<string>)newValue);
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var view = (View)bindable;
+ return view.backgroundImageSelector;
+ });
+ private TriggerableSelector<string> _backgroundImageSelector;
+ private TriggerableSelector<string> backgroundImageSelector
+ {
+ get
+ {
+ if (null == _backgroundImageSelector)
+ {
+ _backgroundImageSelector = new TriggerableSelector<string>(this, BackgroundImageProperty);
+ }
+ return _backgroundImageSelector;
+ }
+ }
internal static readonly BindableProperty BackgroundColorSelectorProperty = BindableProperty.Create("BackgroundColorSelector", typeof(Selector<Color>), typeof(View), null, propertyChanged: (bindable, oldValue, newValue) =>
{
var view = (View)bindable;
return _backgroundColorSelector;
}
}
-
+ internal static readonly BindableProperty BackgroundImageBorderSelectorProperty = BindableProperty.Create("BackgroundImageBorderSelector", typeof(Selector<Rectangle>), typeof(View), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var view = (View)bindable;
+ view.backgroundImageBorderSelector.Clone((Selector<Rectangle>)newValue);
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var view = (View)bindable;
+ return view.backgroundImageBorderSelector;
+ });
+ private TriggerableSelector<Rectangle> _backgroundImageBorderSelector;
+ private TriggerableSelector<Rectangle> backgroundImageBorderSelector
+ {
+ get
+ {
+ if (null == _backgroundImageBorderSelector)
+ {
+ _backgroundImageBorderSelector = new TriggerableSelector<Rectangle>(this, BackgroundImageBorderProperty);
+ }
+ return _backgroundImageBorderSelector;
+ }
+ }
internal static readonly BindableProperty OpacitySelectorProperty = BindableProperty.Create("OpacitySelector", typeof(Selector<float?>), typeof(View), null, propertyChanged: (bindable, oldValue, newValue) =>
{
var view = (View)bindable;
return backgroundColor;
});
- /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+
+ /// <summary> BackgroundImageProperty </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
public static readonly BindableProperty BackgroundImageProperty = BindableProperty.Create("BackgroundImage", typeof(string), typeof(View), default(string), propertyChanged: (bindable, oldValue, newValue) =>
{
return backgroundImage;
});
- /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ /// <summary>BackgroundImageBorderProperty</summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty BackgroundImageBorderProperty = BindableProperty.Create(nameof(BackgroundImageBorder), typeof(Rectangle), typeof(View), default(Rectangle), propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var view = (View)bindable;
+ if (null != newValue)
+ {
+ view.backgroundImageBorder = (Rectangle)newValue;
+ }
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var view = (View)bindable;
+ return view.backgroundImageBorder;
+ });
+ /// <summary>
+ /// BackgroundProperty
+ /// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
public static readonly BindableProperty BackgroundProperty = BindableProperty.Create("Background", typeof(PropertyMap), typeof(View), null, propertyChanged: (bindable, oldValue, newValue) =>
{