public static readonly BindableProperty ImageArrayProperty = null;
internal static void SetInternalImageArrayProperty(BindableObject bindable, object oldValue, object newValue)
{
- var instance = (Loading)bindable;
if (newValue != null)
{
+ var instance = (Loading)bindable;
instance.InternalImageArray = newValue as string[];
}
}
public static readonly BindableProperty ImageListProperty = null;
internal static void SetInternalImageListProperty(BindableObject bindable, object oldValue, object newValue)
{
- Debug.Assert(((Loading)bindable).imageVisual != null);
-
- var newList = newValue as List<string>;
- ((Loading)bindable).imageVisual.URLS = newList == null ? new List<string>() : newList;
+ var instance = (Loading)bindable;
+ instance.SetInternalImageList(newValue as List<string>);
}
internal static object GetInternalImageListProperty(BindableObject bindable)
{
- Debug.Assert(((Loading)bindable).imageVisual != null);
- return ((Loading)bindable).imageVisual.URLS;
+ var instance = (Loading)bindable;
+ return instance.GetInternalImageList();
}
/// <summary>The lottie resource url bindable property.</summary>
internal static void SetInternalLottieResourceUrlProperty(BindableObject bindable, object oldValue, object newValue)
{
var instance = (Loading)bindable;
- instance.RemoveImageVisual();
- instance.EnsureLottieView(newValue as string ?? string.Empty);
+ instance.SetInternalLottieResourceUrl(newValue as string);
}
internal static object GetInternalLottieResourceUrlProperty(BindableObject bindable)
{
- var lottie = ((Loading)bindable).defaultLottieView;
- return lottie == null ? string.Empty : lottie.URL;
+ var instance = (Loading)bindable;
+ return instance.GetInternalLottieResourceUrl();
}
/// <summary>The Size bindable property.</summary>
public new static readonly BindableProperty SizeProperty = null;
internal static new void SetInternalSizeProperty(BindableObject bindable, object oldValue, object newValue)
{
- var instance = (Loading)bindable;
if (newValue != null)
{
- Size size = (Size)newValue;
- ((View)bindable).Size = size;
+ ((View)bindable).Size = (Size)newValue;
}
}
internal static new object GetInternalSizeProperty(BindableObject bindable)
internal static void SetInternalFrameRateProperty(BindableObject bindable, object oldValue, object newValue)
{
var instance = (Loading)bindable;
- instance.frameRate = (int)newValue;
- if (0 != instance.frameRate && instance.imageVisual != null) //It will crash if 0
- {
- instance.imageVisual.FrameDelay = instance.frameRate;
- }
+ instance.SetInternalFrameRate((int)newValue);
}
internal static object GetInternalFrameRateProperty(BindableObject bindable)
{
- return ((Loading)bindable).frameRate;
+ var instance = (Loading)bindable;
+ return instance.GetInternalFrameRate();
}
private const string ImageVisualName = "loadingImageVisual";
}
else
{
- return GetInternalImageArrayProperty(this) as string[];
+ return InternalImageArray;
}
}
set
{
RemoveLottieView();
EnsureImageVisual();
-
if (NUIApplication.IsUsingXaml)
{
SetValue(ImageArrayProperty, value);
}
else
{
- SetInternalImageArrayProperty(this, null, value);
+ InternalImageArray = value;
}
NotifyPropertyChanged();
}
}
else
{
- return (GetInternalImageListProperty(this) as List<string>)?.ToArray() ?? null;
+ return (GetInternalImageList() as List<string>)?.ToArray() ?? null;
}
}
set
}
else
{
- SetInternalImageListProperty(this, null, value == null ? new List<string>() : new List<string>((string[])value));
+ SetInternalImageList(value == null ? new List<string>() : new List<string>(value));
}
}
}
}
else
{
- return GetInternalImageListProperty(this) as IList<string>;
+ return GetInternalImageList();
}
}
}
+ internal void SetInternalImageList(IList<string> newValue)
+ {
+ Debug.Assert(imageVisual != null);
+ var newList = newValue as List<string>;
+ imageVisual.URLS = newList == null ? new List<string>() : newList;
+ }
+
+ private IList<string> GetInternalImageList()
+ {
+ Debug.Assert(imageVisual != null);
+ return imageVisual.URLS;
+ }
+
/// <summary>
/// Gets or sets an lottie resource url.
/// The mutually exclusive with "ImageArray".
}
else
{
- return GetInternalLottieResourceUrlProperty(this) as string;
+ return GetInternalLottieResourceUrl();
}
}
set
}
else
{
- SetInternalLottieResourceUrlProperty(this, null, value);
+ SetInternalLottieResourceUrl(value);
}
}
}
+ private void SetInternalLottieResourceUrl(string newValue)
+ {
+ RemoveImageVisual();
+ EnsureLottieView(newValue ?? string.Empty);
+ }
+
+ private string GetInternalLottieResourceUrl()
+ {
+ var lottie = defaultLottieView;
+ return lottie == null ? string.Empty : lottie.URL;
+ }
+
/// <summary>
/// Gets or sets loading size.
/// </summary>
}
else
{
- return (Size)GetInternalSizeProperty(this);
+ return base.Size;
}
}
set
}
else
{
- SetInternalSizeProperty(this, null, value);
+ if (value != null)
+ {
+ base.Size = value;
+ }
}
}
}
}
else
{
- return (int)GetInternalFrameRateProperty(this);
+ return GetInternalFrameRate();
}
}
set
}
else
{
- SetInternalFrameRateProperty(this, null, value);
+ SetInternalFrameRate(value);
}
}
}
+ private void SetInternalFrameRate(int newValue)
+ {
+ frameRate = newValue;
+ if (0 != frameRate && imageVisual != null) //It will crash if 0
+ {
+ imageVisual.FrameDelay = frameRate;
+ }
+ }
+
+ private int GetInternalFrameRate()
+ {
+ return frameRate;
+ }
+
/// <inheritdoc/>
[EditorBrowsable(EditorBrowsableState.Never)]
public override void OnInitialize()
}
else
{
- return (int)GetInternalCurrentValueProperty(this);
+ return InternalCurrentValue;
}
}
set
}
else
{
- SetInternalCurrentValueProperty(this, null, value);
+ InternalCurrentValue = value;
}
NotifyPropertyChanged();
}
}
else
{
- return (int)GetInternalMaxValueProperty(this);
+ return InternalMaxValue;
}
}
set
}
else
{
- SetInternalMaxValueProperty(this, null, value);
+ InternalMaxValue = value;
}
NotifyPropertyChanged();
}
}
else
{
- return (int)GetInternalMinValueProperty(this);
+ return InternalMinValue;
}
}
set
}
else
{
- SetInternalMinValueProperty(this, null, value);
+ InternalMinValue = value;
}
NotifyPropertyChanged();
}
public static readonly BindableProperty CurrentValueProperty = null;
internal static void SetInternalCurrentValueProperty(BindableObject bindable, object oldValue, object newValue)
{
- var instance = (Picker)bindable;
if (newValue != null)
{
+ var instance = (Picker)bindable;
instance.InternalCurrentValue = (int)newValue;
}
}
public static readonly BindableProperty MaxValueProperty = null;
internal static void SetInternalMaxValueProperty(BindableObject bindable, object oldValue, object newValue)
{
- var instance = (Picker)bindable;
if (newValue != null)
{
+ var instance = (Picker)bindable;
instance.InternalMaxValue = (int)newValue;
}
}
public static readonly BindableProperty MinValueProperty = null;
internal static void SetInternalMinValueProperty(BindableObject bindable, object oldValue, object newValue)
{
- var instance = (Picker)bindable;
if (newValue != null)
{
+ var instance = (Picker)bindable;
instance.InternalMinValue = (int)newValue;
}
}
[Obsolete("Deprecated in API8; Will be removed in API10")]
public partial class Popup : 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 ButtonHeightProperty = null;
- internal static void SetInternalButtonHeightProperty(BindableObject bindable, object oldValue, object newValue)
- {
- var instance = (Popup)bindable;
- if (newValue != null)
- {
- instance.btGroup.Itemheight = (int)newValue;
- instance.UpdateView();
- }
- }
- internal static object GetInternalButtonHeightProperty(BindableObject bindable)
- {
- return (int)((Popup)bindable).btGroup.Itemheight;
- }
-
- /// 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 ButtonTextPointSizeProperty = null;
- internal static void SetInternalButtonTextPointSizeProperty(BindableObject bindable, object oldValue, object newValue)
- {
- var instance = (Popup)bindable;
- if (newValue != null)
- {
- instance.btGroup.ItemPointSize = (float)newValue;
- }
- }
- internal static object GetInternalButtonTextPointSizeProperty(BindableObject bindable)
- {
- return ((Popup)bindable).btGroup.ItemPointSize;
- }
-
- /// 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 ButtonFontFamilyProperty = null;
- internal static void SetInternalButtonFontFamilyProperty(BindableObject bindable, object oldValue, object newValue)
- {
- var instance = (Popup)bindable;
- if (newValue != null)
- {
- instance.btGroup.ItemFontFamily = (string)newValue;
- }
- }
- internal static object GetInternalButtonFontFamilyProperty(BindableObject bindable)
- {
- return ((Popup)bindable).btGroup.ItemFontFamily;
- }
-
- /// 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 ButtonTextColorProperty = null;
- internal static void SetInternalButtonTextColorProperty(BindableObject bindable, object oldValue, object newValue)
- {
- var instance = (Popup)bindable;
- if (newValue != null)
- {
- instance.btGroup.ItemTextColor = (Color)newValue;
- }
- }
- internal static object GetInternalButtonTextColorProperty(BindableObject bindable)
- {
- return ((Popup)bindable).btGroup.ItemTextColor;
- }
-
- /// 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 ButtonOverLayBackgroundColorSelectorProperty = null;
- internal static void SetInternalButtonOverLayBackgroundColorSelectorProperty(BindableObject bindable, object oldValue, object newValue)
- {
- var instance = (Popup)bindable;
- if (newValue != null)
- {
- instance.btGroup.OverLayBackgroundColorSelector = (Selector<Color>)newValue;
- }
- }
- internal static object GetInternalButtonOverLayBackgroundColorSelectorProperty(BindableObject bindable)
- {
- return ((Popup)bindable).btGroup.OverLayBackgroundColorSelector;
- }
-
- /// 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 ButtonTextAlignmentProperty = null;
- internal static void SetInternalButtonTextAlignmentProperty(BindableObject bindable, object oldValue, object newValue)
- {
- var instance = (Popup)bindable;
- if (newValue != null)
- {
- instance.btGroup.ItemTextAlignment = (HorizontalAlignment)newValue;
- }
- }
- internal static object GetInternalButtonTextAlignmentProperty(BindableObject bindable)
- {
- return ((Popup)bindable).btGroup.ItemTextAlignment;
- }
-
- /// 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 ButtonBackgroundProperty = null;
- internal static void SetInternalButtonBackgroundProperty(BindableObject bindable, object oldValue, object newValue)
- {
- var instance = (Popup)bindable;
- if (newValue != null)
- {
- instance.btGroup.ItemBackgroundImageUrl = (string)newValue;
- }
- }
- internal static object GetInternalButtonBackgroundProperty(BindableObject bindable)
- {
- return ((Popup)bindable).btGroup.ItemBackgroundImageUrl;
- }
-
- /// 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 ButtonBackgroundBorderProperty = null;
- internal static void SetInternalButtonBackgroundBorderProperty(BindableObject bindable, object oldValue, object newValue)
- {
- var instance = (Popup)bindable;
- if (newValue != null)
- {
- instance.btGroup.ItemBackgroundBorder = (Rectangle)newValue;
- }
- }
- internal static object GetInternalButtonBackgroundBorderProperty(BindableObject bindable)
- {
- return ((Popup)bindable).btGroup.ItemBackgroundBorder;
- }
-
- /// 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 ButtonImageShadowProperty = null;
- internal static void SetInternalButtonImageShadowProperty(BindableObject bindable, object oldValue, object newValue)
- {
- var instance = (Popup)bindable;
- ImageShadow shadow = (ImageShadow)newValue;
- instance.btGroup.ItemImageShadow = new ImageShadow(shadow);
- }
- internal static object GetInternalButtonImageShadowProperty(BindableObject bindable)
- {
- return ((Popup)bindable).btGroup.ItemImageShadow;
- }
-
private TextLabel titleText;
private ButtonGroup btGroup = null;
private Window window = null;
}
else
{
- return GetInternalTitleTextProperty(this) as string;
+ return InternalTitleText;
}
}
set
}
else
{
- SetInternalTitleTextProperty(this, null, value);
+ InternalTitleText = value;
}
NotifyPropertyChanged();
}
}
else
{
- return (float)GetInternalTitlePointSizeProperty(this);
+ return InternalTitlePointSize;
}
}
set
}
else
{
- SetInternalTitlePointSizeProperty(this, null, value);
+ InternalTitlePointSize = value;
}
NotifyPropertyChanged();
}
}
else
{
- return GetInternalTitleTextColorProperty(this) as Color;
+ return InternalTitleTextColor;
}
}
set
}
else
{
- SetInternalTitleTextColorProperty(this, null, value);
+ InternalTitleTextColor = value;
}
NotifyPropertyChanged();
}
}
else
{
- return (HorizontalAlignment)GetInternalTitleTextHorizontalAlignmentProperty(this);
+ return InternalTitleTextHorizontalAlignment;
}
}
set
}
else
{
- SetInternalTitleTextHorizontalAlignmentProperty(this, null, value);
+ InternalTitleTextHorizontalAlignment = value;
}
NotifyPropertyChanged();
}
}
else
{
- return GetInternalTitleTextPositionProperty(this) as Position;
+ return InternalTitleTextPosition;
}
}
set
}
else
{
- SetInternalTitleTextPositionProperty(this, null, value);
+ InternalTitleTextPosition = value;
}
NotifyPropertyChanged();
}
}
else
{
- return (int)GetInternalTitleHeightProperty(this);
+ return InternalTitleHeight;
}
}
set
}
else
{
- SetInternalTitleHeightProperty(this, null, value);
+ InternalTitleHeight = value;
}
NotifyPropertyChanged();
}
}
else
{
- return (int)GetInternalButtonCountProperty(this);
+ return InternalButtonCount;
}
}
set
}
else
{
- SetInternalButtonCountProperty(this, null, value);
+ InternalButtonCount = value;
}
NotifyPropertyChanged();
}
}
else
{
- return (int)GetInternalButtonHeightProperty(this);
+ return GetInternalButtonHeight();
}
}
set
}
else
{
- SetInternalButtonHeightProperty(this, null, value);
+ SetInternalButtonHeight(value);
}
}
}
+ private void SetInternalButtonHeight(int newValue)
+ {
+ btGroup.Itemheight = newValue;
+ UpdateView();
+ }
+
+ private int GetInternalButtonHeight()
+ {
+ return (int)btGroup.Itemheight;
+ }
+
/// <summary>
/// Button text point size in Popup.
/// </summary>
}
else
{
- return (float)GetInternalButtonTextPointSizeProperty(this);
+ return btGroup.ItemPointSize;
}
}
set
}
else
{
- SetInternalButtonTextPointSizeProperty(this, null, value);
+ btGroup.ItemPointSize = value;
}
}
}
}
else
{
- return (string)GetInternalButtonFontFamilyProperty(this);
+ return btGroup.ItemFontFamily;
}
}
set
}
else
{
- SetInternalButtonFontFamilyProperty(this, null, value);
+ btGroup.ItemFontFamily = value;
}
}
}
}
else
{
- return (Color)GetInternalButtonTextColorProperty(this);
+ return btGroup.ItemTextColor;
}
}
set
}
else
{
- SetInternalButtonTextColorProperty(this, null, value);
+ btGroup.ItemTextColor = value;
}
}
}
}
else
{
- return (Selector<Color>)GetInternalButtonOverLayBackgroundColorSelectorProperty(this);
+ return btGroup.OverLayBackgroundColorSelector;
}
}
set
}
else
{
- SetInternalButtonOverLayBackgroundColorSelectorProperty(this, null, value);
+ btGroup.OverLayBackgroundColorSelector = value;
}
}
}
}
else
{
- return (HorizontalAlignment)GetInternalButtonTextAlignmentProperty(this);
+ return btGroup.ItemTextAlignment;
}
}
set
}
else
{
- SetInternalButtonTextAlignmentProperty(this, null, value);
+ btGroup.ItemTextAlignment = value;
}
}
}
}
else
{
- return (string)GetInternalButtonBackgroundProperty(this);
+ return btGroup.ItemBackgroundImageUrl;
}
}
set
}
else
{
- SetInternalButtonBackgroundProperty(this, null, value);
+ btGroup.ItemBackgroundImageUrl = value;
}
}
}
}
else
{
- return (Rectangle)GetInternalButtonBackgroundBorderProperty(this);
+ return btGroup.ItemBackgroundBorder;
}
}
set
}
else
{
- SetInternalButtonBackgroundBorderProperty(this, null, value);
+ btGroup.ItemBackgroundBorder = value;
}
}
}
}
else
{
- return (ImageShadow)GetInternalButtonImageShadowProperty(this);
+ return btGroup.ItemImageShadow;
}
}
set
}
else
{
- SetInternalButtonImageShadowProperty(this, null, value);
+ btGroup.ItemImageShadow = new ImageShadow(value);
}
}
}
using System.ComponentModel;
+using Tizen.NUI.BaseComponents;
using Tizen.NUI.Binding;
namespace Tizen.NUI.Components
{
public partial class Popup
{
+ /// 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 ButtonHeightProperty = null;
+ internal static void SetInternalButtonHeightProperty(BindableObject bindable, object oldValue, object newValue)
+ {
+ if (newValue != null)
+ {
+ var instance = (Popup)bindable;
+ instance.SetInternalButtonHeight((int)newValue);
+ }
+ }
+ internal static object GetInternalButtonHeightProperty(BindableObject bindable)
+ {
+ var instance = (Popup)bindable;
+ return instance.GetInternalButtonHeight();
+ }
+
+ /// 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 ButtonTextPointSizeProperty = null;
+ internal static void SetInternalButtonTextPointSizeProperty(BindableObject bindable, object oldValue, object newValue)
+ {
+ if (newValue != null)
+ {
+ var instance = (Popup)bindable;
+ instance.btGroup.ItemPointSize = (float)newValue;
+ }
+ }
+ internal static object GetInternalButtonTextPointSizeProperty(BindableObject bindable)
+ {
+ return ((Popup)bindable).btGroup.ItemPointSize;
+ }
+
+ /// 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 ButtonFontFamilyProperty = null;
+ internal static void SetInternalButtonFontFamilyProperty(BindableObject bindable, object oldValue, object newValue)
+ {
+ if (newValue != null)
+ {
+ var instance = (Popup)bindable;
+ instance.btGroup.ItemFontFamily = (string)newValue;
+ }
+ }
+ internal static object GetInternalButtonFontFamilyProperty(BindableObject bindable)
+ {
+ return ((Popup)bindable).btGroup.ItemFontFamily;
+ }
+
+ /// 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 ButtonTextColorProperty = null;
+ internal static void SetInternalButtonTextColorProperty(BindableObject bindable, object oldValue, object newValue)
+ {
+ if (newValue != null)
+ {
+ var instance = (Popup)bindable;
+ instance.btGroup.ItemTextColor = (Color)newValue;
+ }
+ }
+ internal static object GetInternalButtonTextColorProperty(BindableObject bindable)
+ {
+ return ((Popup)bindable).btGroup.ItemTextColor;
+ }
+
+ /// 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 ButtonOverLayBackgroundColorSelectorProperty = null;
+ internal static void SetInternalButtonOverLayBackgroundColorSelectorProperty(BindableObject bindable, object oldValue, object newValue)
+ {
+ if (newValue != null)
+ {
+ var instance = (Popup)bindable;
+ instance.btGroup.OverLayBackgroundColorSelector = (Selector<Color>)newValue;
+ }
+ }
+ internal static object GetInternalButtonOverLayBackgroundColorSelectorProperty(BindableObject bindable)
+ {
+ return ((Popup)bindable).btGroup.OverLayBackgroundColorSelector;
+ }
+
+ /// 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 ButtonTextAlignmentProperty = null;
+ internal static void SetInternalButtonTextAlignmentProperty(BindableObject bindable, object oldValue, object newValue)
+ {
+ if (newValue != null)
+ {
+ var instance = (Popup)bindable;
+ instance.btGroup.ItemTextAlignment = (HorizontalAlignment)newValue;
+ }
+ }
+ internal static object GetInternalButtonTextAlignmentProperty(BindableObject bindable)
+ {
+ return ((Popup)bindable).btGroup.ItemTextAlignment;
+ }
+
+ /// 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 ButtonBackgroundProperty = null;
+ internal static void SetInternalButtonBackgroundProperty(BindableObject bindable, object oldValue, object newValue)
+ {
+ if (newValue != null)
+ {
+ var instance = (Popup)bindable;
+ instance.btGroup.ItemBackgroundImageUrl = (string)newValue;
+ }
+ }
+ internal static object GetInternalButtonBackgroundProperty(BindableObject bindable)
+ {
+ return ((Popup)bindable).btGroup.ItemBackgroundImageUrl;
+ }
+
+ /// 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 ButtonBackgroundBorderProperty = null;
+ internal static void SetInternalButtonBackgroundBorderProperty(BindableObject bindable, object oldValue, object newValue)
+ {
+ if (newValue != null)
+ {
+ var instance = (Popup)bindable;
+ instance.btGroup.ItemBackgroundBorder = (Rectangle)newValue;
+ }
+ }
+ internal static object GetInternalButtonBackgroundBorderProperty(BindableObject bindable)
+ {
+ return ((Popup)bindable).btGroup.ItemBackgroundBorder;
+ }
+
+ /// 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 ButtonImageShadowProperty = null;
+ internal static void SetInternalButtonImageShadowProperty(BindableObject bindable, object oldValue, object newValue)
+ {
+ var instance = (Popup)bindable;
+ instance.btGroup.ItemImageShadow = new ImageShadow((ImageShadow)newValue);
+ }
+ internal static object GetInternalButtonImageShadowProperty(BindableObject bindable)
+ {
+ return ((Popup)bindable).btGroup.ItemImageShadow;
+ }
+
/// <summary>
/// TitleTextProperty
/// </summary>
public static readonly BindableProperty TitleTextProperty = null;
internal static void SetInternalTitleTextProperty(BindableObject bindable, object oldValue, object newValue)
{
- var instance = (Popup)bindable;
if (newValue != null)
{
+ var instance = (Popup)bindable;
instance.InternalTitleText = newValue as string;
}
}
public static readonly BindableProperty TitlePointSizeProperty = null;
internal static void SetInternalTitlePointSizeProperty(BindableObject bindable, object oldValue, object newValue)
{
- var instance = (Popup)bindable;
if (newValue != null)
{
+ var instance = (Popup)bindable;
instance.InternalTitlePointSize = (float)newValue;
}
}
public static readonly BindableProperty TitleTextColorProperty = null;
internal static void SetInternalTitleTextColorProperty(BindableObject bindable, object oldValue, object newValue)
{
- var instance = (Popup)bindable;
if (newValue != null)
{
+ var instance = (Popup)bindable;
instance.InternalTitleTextColor = newValue as Color;
}
}
public static readonly BindableProperty TitleTextHorizontalAlignmentProperty = null;
internal static void SetInternalTitleTextHorizontalAlignmentProperty(BindableObject bindable, object oldValue, object newValue)
{
- var instance = (Popup)bindable;
if (newValue != null)
{
+ var instance = (Popup)bindable;
instance.InternalTitleTextHorizontalAlignment = (HorizontalAlignment)newValue;
}
}
public static readonly BindableProperty TitleTextPositionProperty = null;
internal static void SetInternalTitleTextPositionProperty(BindableObject bindable, object oldValue, object newValue)
{
- var instance = (Popup)bindable;
if (newValue != null)
{
+ var instance = (Popup)bindable;
instance.InternalTitleTextPosition = newValue as Position;
}
}
public static readonly BindableProperty TitleHeightProperty = null;
internal static void SetInternalTitleHeightProperty(BindableObject bindable, object oldValue, object newValue)
{
- var instance = (Popup)bindable;
if (newValue != null)
{
+ var instance = (Popup)bindable;
instance.InternalTitleHeight = (int)newValue;
}
}
public static readonly BindableProperty ButtonCountProperty = null;
internal static void SetInternalButtonCountProperty(BindableObject bindable, object oldValue, object newValue)
{
- var instance = (Popup)bindable;
if (newValue != null)
{
+ var instance = (Popup)bindable;
instance.InternalButtonCount = (int)newValue;
}
}
{
private const int IndeterminateAnimationDuration = 2000;
- /// <summary>
- /// MaxValueProperty
- /// </summary>
- [EditorBrowsable(EditorBrowsableState.Never)]
- public static readonly BindableProperty MaxValueProperty = null;
- internal static void SetInternalMaxValueProperty(BindableObject bindable, object oldValue, object newValue)
- {
- var instance = (Progress)bindable;
- if (newValue != null)
- {
- instance.maxValue = (float)newValue;
- instance.UpdateValue();
- }
- }
- internal static object GetInternalMaxValueProperty(BindableObject bindable)
- {
- var instance = (Progress)bindable;
- return instance.maxValue;
- }
-
- /// <summary>
- /// MinValueProperty
- /// </summary>
- [EditorBrowsable(EditorBrowsableState.Never)]
- public static readonly BindableProperty MinValueProperty = null;
- internal static void SetInternalMinValueProperty(BindableObject bindable, object oldValue, object newValue)
- {
- var instance = (Progress)bindable;
- if (newValue != null)
- {
- instance.minValue = (float)newValue;
- instance.UpdateValue();
- }
- }
- internal static object GetInternalMinValueProperty(BindableObject bindable)
- {
- var instance = (Progress)bindable;
- return instance.minValue;
- }
-
- /// <summary>
- /// CurrentValueProperty
- /// </summary>
- [EditorBrowsable(EditorBrowsableState.Never)]
- public static readonly BindableProperty CurrentValueProperty = null;
- internal static void SetInternalCurrentValueProperty(BindableObject bindable, object oldValue, object newValue)
- {
- var instance = (Progress)bindable;
- if (newValue != null)
- {
- if ((float)newValue > instance.maxValue || (float)newValue < instance.minValue)
- {
- return;
- }
- instance.currentValue = (float)newValue;
- instance.UpdateValue();
- }
- }
- internal static object GetInternalCurrentValueProperty(BindableObject bindable)
- {
- var instance = (Progress)bindable;
- return instance.currentValue;
- }
-
- /// <summary>
- /// BufferValueProperty
- /// </summary>
- [EditorBrowsable(EditorBrowsableState.Never)]
- public static readonly BindableProperty BufferValueProperty = null;
- internal static void SetInternalBufferValueProperty(BindableObject bindable, object oldValue, object newValue)
- {
- var instance = (Progress)bindable;
- if (newValue != null)
- {
- if ((float)newValue > instance.maxValue || (float)newValue < instance.minValue)
- {
- return;
- }
- instance.bufferValue = (float)newValue;
- instance.UpdateValue();
- }
- }
- internal static object GetInternalBufferValueProperty(BindableObject bindable)
- {
- var instance = (Progress)bindable;
- return instance.bufferValue;
- }
-
- /// <summary>
- /// ProgressStateProperty
- /// </summary>
- [EditorBrowsable(EditorBrowsableState.Never)]
- public static readonly BindableProperty ProgressStateProperty = null;
- internal static void SetInternalProgressStateProperty(BindableObject bindable, object oldValue, object newValue)
- {
- var instance = (Progress)bindable;
- if (newValue != null)
- {
- instance.state = (ProgressStatusType)newValue;
- instance.UpdateStates();
- }
- }
- internal static object GetInternalProgressStateProperty(BindableObject bindable)
- {
- var instance = (Progress)bindable;
- return instance.state;
- }
-
/// This needs to be considered more if public-open is necessary.
private ProgressStatusType state = ProgressStatusType.Determinate;
}
else
{
- return GetInternalTrackImageURLProperty(this) as string;
+ return InternalTrackImageURL;
}
}
set
}
else
{
- SetInternalTrackImageURLProperty(this, null, value);
+ InternalTrackImageURL = value;
}
NotifyPropertyChanged();
}
}
else
{
- return GetInternalProgressImageURLProperty(this) as string;
+ return InternalProgressImageURL;
}
}
set
}
else
{
- SetInternalProgressImageURLProperty(this, null, value);
+ InternalProgressImageURL = value;
}
NotifyPropertyChanged();
}
}
else
{
- return GetInternalBufferImageURLProperty(this) as string;
+ return InternalBufferImageURL;
}
}
set
}
else
{
- SetInternalBufferImageURLProperty(this, null, value);
+ InternalBufferImageURL = value;
}
NotifyPropertyChanged();
}
}
else
{
- return GetInternalIndeterminateImageUrlProperty(this) as string;
+ return InternalIndeterminateImageUrl;
}
}
set
}
else
{
- SetInternalIndeterminateImageUrlProperty(this, null, value);
+ InternalIndeterminateImageUrl = value;
}
NotifyPropertyChanged();
}
}
else
{
- return GetInternalTrackColorProperty(this) as Color;
+ return InternalTrackColor;
}
}
set
}
else
{
- SetInternalTrackColorProperty(this, null, value);
+ InternalTrackColor = value;
}
NotifyPropertyChanged();
}
}
else
{
- return GetInternalProgressColorProperty(this) as Color;
+ return InternalProgressColor;
}
}
set
}
else
{
- SetInternalProgressColorProperty(this, null, value);
+ InternalProgressColor = value;
}
NotifyPropertyChanged();
}
}
else
{
- return GetInternalBufferColorProperty(this) as Color;
+ return InternalBufferColor;
}
}
set
}
else
{
- SetInternalBufferColorProperty(this, null, value);
+ InternalBufferColor = value;
}
NotifyPropertyChanged();
}
}
else
{
- return (float)GetInternalMaxValueProperty(this);
+ return GetInternalMaxValue();
}
}
set
}
else
{
- SetInternalMaxValueProperty(this, null, value);
+ SetInternalMaxValue(value);
}
}
}
+ private void SetInternalMaxValue(float newValue)
+ {
+ maxValue = newValue;
+ UpdateValue();
+ }
+
+ private float GetInternalMaxValue()
+ {
+ return maxValue;
+ }
+
/// <summary>
/// The property to get/set the minim value of the Progress.
/// </summary>
}
else
{
- return (float)GetInternalMinValueProperty(this);
+ return GetInternalMinValue();
}
}
set
}
else
{
- SetInternalMinValueProperty(this, null, value);
+ SetInternalMinValue(value);
}
}
}
+ private void SetInternalMinValue(float newValue)
+ {
+ minValue = newValue;
+ UpdateValue();
+ }
+
+ private float GetInternalMinValue()
+ {
+ return minValue;
+ }
+
/// <summary>
/// The property to get/set the current value of the Progress.
/// </summary>
}
else
{
- return (float)GetInternalCurrentValueProperty(this);
+ return GetInternalCurrentValue();
}
}
set
}
else
{
- SetInternalCurrentValueProperty(this, null, value);
+ SetInternalCurrentValue(value);
}
if (Accessibility.Accessibility.IsEnabled && IsHighlighted)
{
}
}
+ private void SetInternalCurrentValue(float newValue)
+ {
+ if ((float)newValue > maxValue || (float)newValue < minValue)
+ {
+ return;
+ }
+ currentValue = newValue;
+ UpdateValue();
+ }
+
+ private float GetInternalCurrentValue()
+ {
+ return currentValue;
+ }
+
/// <summary>
/// The property to get/set the buffer value of the Progress.
/// </summary>
}
else
{
- return (float)GetInternalBufferValueProperty(this);
+ return GetInternalBufferValue();
}
}
set
}
else
{
- SetInternalBufferValueProperty(this, null, value);
+ SetInternalBufferValue(value);
}
}
}
+ private void SetInternalBufferValue(float newValue)
+ {
+ if ((float)newValue > maxValue || (float)newValue < minValue)
+ {
+ return;
+ }
+ bufferValue = newValue;
+ UpdateValue();
+ }
+
+ private float GetInternalBufferValue()
+ {
+ return bufferValue;
+ }
+
/// <summary>
/// Gets or sets state of progress.
/// </summary>
}
else
{
- return (ProgressStatusType)GetInternalProgressStateProperty(this);
+ return GetInternalProgressState();
}
}
set
}
else
{
- SetInternalProgressStateProperty(this, null, value);
+ SetInternalProgressState(value);
}
}
}
+ private void SetInternalProgressState(ProgressStatusType newValue)
+ {
+ state = newValue;
+ UpdateStates();
+ }
+
+ private ProgressStatusType GetInternalProgressState()
+ {
+ return state;
+ }
+
/// <inheritdoc/>
[EditorBrowsable(EditorBrowsableState.Never)]
public override void OnInitialize()
{
public partial class Progress
{
+ /// <summary>
+ /// MaxValueProperty
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty MaxValueProperty = null;
+ internal static void SetInternalMaxValueProperty(BindableObject bindable, object oldValue, object newValue)
+ {
+ if (newValue != null)
+ {
+ var instance = (Progress)bindable;
+ instance.SetInternalMaxValue((float)newValue);
+ }
+ }
+ internal static object GetInternalMaxValueProperty(BindableObject bindable)
+ {
+ var instance = (Progress)bindable;
+ return instance.GetInternalMaxValue();
+ }
+
+ /// <summary>
+ /// MinValueProperty
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty MinValueProperty = null;
+ internal static void SetInternalMinValueProperty(BindableObject bindable, object oldValue, object newValue)
+ {
+ var instance = (Progress)bindable;
+ if (newValue != null)
+ {
+ instance.SetInternalMinValue((float)newValue);
+ }
+ }
+ internal static object GetInternalMinValueProperty(BindableObject bindable)
+ {
+ var instance = (Progress)bindable;
+ return instance.GetInternalMinValue();
+ }
+
+ /// <summary>
+ /// CurrentValueProperty
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty CurrentValueProperty = null;
+ internal static void SetInternalCurrentValueProperty(BindableObject bindable, object oldValue, object newValue)
+ {
+ if (newValue != null)
+ {
+ var instance = (Progress)bindable;
+ instance.SetInternalCurrentValue((float)newValue);
+ }
+ }
+ internal static object GetInternalCurrentValueProperty(BindableObject bindable)
+ {
+ var instance = (Progress)bindable;
+ return instance.GetInternalCurrentValue();
+ }
+
+ /// <summary>
+ /// BufferValueProperty
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty BufferValueProperty = null;
+ internal static void SetInternalBufferValueProperty(BindableObject bindable, object oldValue, object newValue)
+ {
+ if (newValue != null)
+ {
+ var instance = (Progress)bindable;
+ instance.SetInternalBufferValue((float)newValue);
+ }
+ }
+ internal static object GetInternalBufferValueProperty(BindableObject bindable)
+ {
+ var instance = (Progress)bindable;
+ return instance.GetInternalBufferValue();
+ }
+
+ /// <summary>
+ /// ProgressStateProperty
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty ProgressStateProperty = null;
+ internal static void SetInternalProgressStateProperty(BindableObject bindable, object oldValue, object newValue)
+ {
+ if (newValue != null)
+ {
+ var instance = (Progress)bindable;
+ instance.SetInternalProgressState((ProgressStatusType)newValue);
+ }
+ }
+ internal static object GetInternalProgressStateProperty(BindableObject bindable)
+ {
+ var instance = (Progress)bindable;
+ return instance.GetInternalProgressState();
+ }
+
/// <summary>
/// TrackImageURLProperty
/// </summary>
public static readonly BindableProperty TrackImageURLProperty = null;
internal static void SetInternalTrackImageURLProperty(BindableObject bindable, object oldValue, object newValue)
{
- var instance = (Progress)bindable;
if (newValue != null)
{
+ var instance = (Progress)bindable;
instance.InternalTrackImageURL = newValue as string;
}
}
public static readonly BindableProperty ProgressImageURLProperty = null;
internal static void SetInternalProgressImageURLProperty(BindableObject bindable, object oldValue, object newValue)
{
- var instance = (Progress)bindable;
if (newValue != null)
{
+ var instance = (Progress)bindable;
instance.InternalProgressImageURL = newValue as string;
}
}
public static readonly BindableProperty BufferImageURLProperty = null;
internal static void SetInternalBufferImageURLProperty(BindableObject bindable, object oldValue, object newValue)
{
- var instance = (Progress)bindable;
if (newValue != null)
{
+ var instance = (Progress)bindable;
instance.InternalBufferImageURL = newValue as string;
}
}
public static readonly BindableProperty IndeterminateImageUrlProperty = null;
internal static void SetInternalIndeterminateImageUrlProperty(BindableObject bindable, object oldValue, object newValue)
{
- var instance = (Progress)bindable;
if (newValue != null)
{
+ var instance = (Progress)bindable;
instance.InternalIndeterminateImageUrl = newValue as string;
}
}
public static readonly BindableProperty TrackColorProperty = null;
internal static void SetInternalTrackColorProperty(BindableObject bindable, object oldValue, object newValue)
{
- var instance = (Progress)bindable;
if (newValue != null)
{
+ var instance = (Progress)bindable;
instance.InternalTrackColor = newValue as Color;
}
}
public static readonly BindableProperty ProgressColorProperty = null;
internal static void SetInternalProgressColorProperty(BindableObject bindable, object oldValue, object newValue)
{
- var instance = (Progress)bindable;
if (newValue != null)
{
+ var instance = (Progress)bindable;
instance.InternalProgressColor = newValue as Color;
}
}
public static readonly BindableProperty BufferColorProperty = null;
internal static void SetInternalBufferColorProperty(BindableObject bindable, object oldValue, object newValue)
{
- var instance = (Progress)bindable;
if (newValue != null)
{
+ var instance = (Progress)bindable;
instance.InternalBufferColor = newValue as Color;
}
}
/// <since_tizen> 9 </since_tizen>
public partial class CollectionView : RecyclerView
{
- /// <summary>
- /// Binding Property of selected item in single selection.
- /// </summary>
- /// <since_tizen> 9 </since_tizen>
- public static readonly BindableProperty SelectedItemProperty = null;
- internal static void SetInternalSelectedItemProperty(BindableObject bindable, object oldValue, object newValue)
- {
- var colView = bindable as CollectionView;
- if (colView == null)
- {
- throw new Exception("Bindable object is not CollectionView.");
- }
-
- oldValue = colView.selectedItem;
- colView.selectedItem = newValue;
-
- var args = new SelectionChangedEventArgs(oldValue, newValue);
- foreach (RecyclerViewItem item in colView.ContentContainer.Children.Where((item) => item is RecyclerViewItem))
- {
- if (item.BindingContext == null)
- {
- continue;
- }
-
- if (item.BindingContext == oldValue)
- {
- item.IsSelected = false;
- }
- else if (item.BindingContext == newValue)
- {
- item.IsSelected = true;
- }
- }
-
- SelectionPropertyChanged(colView, args);
- }
- internal static object GetInternalSelectedItemProperty(BindableObject bindable)
- {
- var colView = bindable as CollectionView;
- if (colView == null)
- {
- throw new Exception("Bindable object is not CollectionView.");
- }
-
- return colView.selectedItem;
- }
-
- /// <summary>
- /// Binding Property of selected items list in multiple selection.
- /// </summary>
- /// <since_tizen> 9 </since_tizen>
- public static readonly BindableProperty SelectedItemsProperty = null;
- internal static void SetInternalSelectedItemsProperty(BindableObject bindable, object oldValue, object newValue)
- {
- var colView = bindable as CollectionView;
- if (colView == null)
- {
- throw new Exception("Bindable object is not CollectionView.");
- }
-
- var oldSelection = colView.selectedItems ?? selectEmpty;
- //FIXME : CoerceSelectedItems calls only isCreatedByXaml
- var newSelection = (SelectionList)CoerceSelectedItems(colView, newValue);
- colView.selectedItems = newSelection;
- colView.SelectedItemsPropertyChanged(oldSelection, newSelection);
- }
- internal static object GetInternalSelectedItemsProperty(BindableObject bindable)
- {
- var colView = bindable as CollectionView;
- if (colView == null)
- {
- throw new Exception("Bindable object is not CollectionView.");
- }
-
- colView.selectedItems = colView.selectedItems ?? new SelectionList(colView);
- return colView.selectedItems;
- }
-
- /// <summary>
- /// Binding Property of selected items list in multiple selection.
- /// </summary>
- /// <since_tizen> 9 </since_tizen>
- public static readonly BindableProperty SelectionModeProperty = null;
- internal static void SetInternalSelectionModeProperty(BindableObject bindable, object oldValue, object newValue)
- {
- var colView = bindable as CollectionView;
- if (colView == null)
- {
- throw new Exception("Bindable object is not CollectionView.");
- }
-
- oldValue = colView.selectionMode;
- colView.selectionMode = (ItemSelectionMode)newValue;
- SelectionModePropertyChanged(colView, oldValue, newValue);
- }
- internal static object GetInternalSelectionModeProperty(BindableObject bindable)
- {
- var colView = bindable as CollectionView;
- if (colView == null)
- {
- throw new Exception("Bindable object is not CollectionView.");
- }
-
- return colView.selectionMode;
- }
-
private static readonly IList<object> selectEmpty = new List<object>(0);
private DataTemplate itemTemplate = null;
private IEnumerable itemsSource = null;
{
if (NUIApplication.IsUsingXaml)
{
- return GetValue(RecyclerView.ItemsSourceProperty) as IEnumerable;
+ return GetValue(ItemsSourceProperty) as IEnumerable;
}
else
{
- return GetInternalItemsSourceProperty(this) as IEnumerable;
+ return InternalItemsSource;
}
}
set
{
if (NUIApplication.IsUsingXaml)
{
- SetValue(RecyclerView.ItemsSourceProperty, value);
+ SetValue(ItemsSourceProperty, value);
}
else
{
- SetInternalItemsSourceProperty(this, null, value);
+ InternalItemsSource = value;
}
}
}
selectedItems?.Clear();
}
- itemsSource = value as IEnumerable;
+ itemsSource = value;
if (itemsSource == null)
{
}
else
{
- return GetInternalItemTemplateProperty(this) as DataTemplate;
+ return InternalItemTemplate;
}
}
set
}
else
{
- SetInternalItemTemplateProperty(this, null, value);
+ InternalItemTemplate = value;
}
NotifyPropertyChanged();
}
}
else
{
- return GetInternalItemsLayouterProperty(this) as ItemsLayouter;
+ return InternalItemsLayouter;
}
}
set
}
else
{
- SetInternalItemsLayouterProperty(this, null, value);
+ InternalItemsLayouter = value;
}
NotifyPropertyChanged();
}
}
-
/// <inheritdoc/>
[EditorBrowsable(EditorBrowsableState.Never)]
protected override ItemsLayouter InternalItemsLayouter
}
else
{
- return (Direction)GetInternalScrollingDirectionProperty(this);
+ return InternalScrollingDirection;
}
}
set
}
else
{
- SetInternalScrollingDirectionProperty(this, null, value);
+ InternalScrollingDirection = value;
}
NotifyPropertyChanged();
}
}
else
{
- return GetInternalSelectedItemsProperty(this) as IList<object>;
+ return GetInternalSelectedItems();
}
}
// set => SetValue(SelectedItemsProperty, new SelectionList(this, value));
}
+ //NOTE: if setter is uncommented, a function like SetInternalSelectedItems need be added here.
+
+ private IList<object> GetInternalSelectedItems()
+ {
+ selectedItems = selectedItems ?? new SelectionList(this);
+ return selectedItems;
+ }
+
/// <summary>
/// Selection mode to handle items selection. See ItemSelectionMode for details.
/// </summary>
}
else
{
- return (ItemSelectionMode)GetInternalSelectionModeProperty(this);
+ return GetInternalSelectionMode();
}
}
set
}
else
{
- SetInternalSelectionModeProperty(this, null, value);
+ SetInternalSelectionMode(value);
}
}
}
+ private void SetInternalSelectionMode(ItemSelectionMode newValue)
+ {
+ ItemSelectionMode oldValue = selectionMode;
+ selectionMode = newValue;
+ SelectionModePropertyChanged(this, oldValue, newValue);
+ }
+
+ private ItemSelectionMode GetInternalSelectionMode()
+ {
+ return selectionMode;
+ }
+
/// <summary>
/// Command of selection changed.
/// </summary>
}
else
{
- return GetInternalSelectionChangedCommandProperty(this) as ICommand;
+ return InternalSelectionChangedCommand;
}
}
set
}
else
{
- SetInternalSelectionChangedCommandProperty(this, null, value);
+ InternalSelectionChangedCommand = value;
}
NotifyPropertyChanged();
}
}
else
{
- return GetInternalHeaderProperty(this) as RecyclerViewItem;
+ return InternalHeader;
}
}
set
}
else
{
- SetInternalHeaderProperty(this, null, value);
+ InternalHeader = value;
}
NotifyPropertyChanged();
}
}
else
{
- return GetInternalFooterProperty(this) as RecyclerViewItem;
+ return InternalFooter;
}
}
set
}
else
{
- SetInternalFooterProperty(this, null, value);
+ InternalFooter = value;
}
NotifyPropertyChanged();
}
}
else
{
- return (bool)GetInternalIsGroupedProperty(this);
+ return InternalIsGrouped;
}
}
set
}
else
{
- SetInternalIsGroupedProperty(this, null, value);
+ InternalIsGrouped = value;
}
NotifyPropertyChanged();
}
}
else
{
- return GetInternalGroupHeaderTemplateProperty(this) as DataTemplate;
+ return InternalGroupHeaderTemplate;
}
}
set
}
else
{
- SetInternalGroupHeaderTemplateProperty(this, null, value);
+ InternalGroupHeaderTemplate = value;
}
NotifyPropertyChanged();
}
}
else
{
- return GetInternalGroupFooterTemplateProperty(this) as DataTemplate;
+ return InternalGroupFooterTemplate;
}
}
set
}
else
{
- SetInternalGroupFooterTemplateProperty(this, null, value);
+ InternalGroupFooterTemplate = value;
}
NotifyPropertyChanged();
}
using System;
using System.ComponentModel;
+using System.Linq;
using System.Windows.Input;
using Tizen.NUI.Binding;
{
public partial class CollectionView
{
+ /// <summary>
+ /// Binding Property of selected item in single selection.
+ /// </summary>
+ /// <since_tizen> 9 </since_tizen>
+ public static readonly BindableProperty SelectedItemProperty = null;
+ internal static void SetInternalSelectedItemProperty(BindableObject bindable, object oldValue, object newValue)
+ {
+ var colView = bindable as CollectionView;
+ if (colView == null)
+ {
+ throw new Exception("Bindable object is not CollectionView.");
+ }
+
+ oldValue = colView.selectedItem;
+ colView.selectedItem = newValue;
+
+ var args = new SelectionChangedEventArgs(oldValue, newValue);
+ foreach (RecyclerViewItem item in colView.ContentContainer.Children.Where((item) => item is RecyclerViewItem))
+ {
+ if (item.BindingContext == null)
+ {
+ continue;
+ }
+
+ if (item.BindingContext == oldValue)
+ {
+ item.IsSelected = false;
+ }
+ else if (item.BindingContext == newValue)
+ {
+ item.IsSelected = true;
+ }
+ }
+ SelectionPropertyChanged(colView, args);
+ }
+ internal static object GetInternalSelectedItemProperty(BindableObject bindable)
+ {
+ var colView = bindable as CollectionView;
+ if (colView == null)
+ {
+ throw new Exception("Bindable object is not CollectionView.");
+ }
+ return colView.selectedItem;
+ }
+
+ /// <summary>
+ /// Binding Property of selected items list in multiple selection.
+ /// </summary>
+ /// <since_tizen> 9 </since_tizen>
+ public static readonly BindableProperty SelectedItemsProperty = null;
+ internal static void SetInternalSelectedItemsProperty(BindableObject bindable, object oldValue, object newValue)
+ {
+ var colView = bindable as CollectionView;
+ if (colView == null)
+ {
+ throw new Exception("Bindable object is not CollectionView.");
+ }
+
+ var oldSelection = colView.selectedItems ?? selectEmpty;
+ //FIXME : CoerceSelectedItems calls only isCreatedByXaml
+ var newSelection = (SelectionList)CoerceSelectedItems(colView, newValue);
+ colView.selectedItems = newSelection;
+ colView.SelectedItemsPropertyChanged(oldSelection, newSelection);
+ }
+ internal static object GetInternalSelectedItemsProperty(BindableObject bindable)
+ {
+ var colView = bindable as CollectionView;
+ if (colView == null)
+ {
+ throw new Exception("Bindable object is not CollectionView.");
+ }
+ return colView.GetInternalSelectedItems();
+ }
+
+ /// <summary>
+ /// Binding Property of selected items list in multiple selection.
+ /// </summary>
+ /// <since_tizen> 9 </since_tizen>
+ public static readonly BindableProperty SelectionModeProperty = null;
+ internal static void SetInternalSelectionModeProperty(BindableObject bindable, object oldValue, object newValue)
+ {
+ var colView = bindable as CollectionView;
+ if (colView == null)
+ {
+ throw new Exception("Bindable object is not CollectionView.");
+ }
+ colView.SetInternalSelectionMode((ItemSelectionMode)newValue);
+ }
+ internal static object GetInternalSelectionModeProperty(BindableObject bindable)
+ {
+ var colView = bindable as CollectionView;
+ if (colView == null)
+ {
+ throw new Exception("Bindable object is not CollectionView.");
+ }
+ return colView.GetInternalSelectionMode();
+ }
+
/// <summary>
/// ItemsLayouterProperty
/// </summary>
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
public static readonly new BindableProperty ScrollingDirectionProperty = null;
- internal static void SetInternalScrollingDirectionProperty(BindableObject bindable, object oldValue, object newValue)
+ internal static new void SetInternalScrollingDirectionProperty(BindableObject bindable, object oldValue, object newValue)
{
var instance = bindable as CollectionView;
if (instance == null)
instance.InternalScrollingDirection = (Direction)newValue;
}
}
- internal static object GetInternalScrollingDirectionProperty(BindableObject bindable)
+ internal static new object GetInternalScrollingDirectionProperty(BindableObject bindable)
{
var instance = bindable as CollectionView;
if (instance == null)
}
else
{
- return GetInternalBadgeProperty(this) as View;
+ return InternalBadge;
}
}
set
}
else
{
- SetInternalBadgeProperty(this, null, value);
+ InternalBadge = value;
}
NotifyPropertyChanged();
}
}
else
{
- return GetInternalResourceUrlProperty(this) as string;
+ return InternalResourceUrl;
}
}
set
}
else
{
- SetInternalResourceUrlProperty(this, null, value);
+ InternalResourceUrl = value;
}
NotifyPropertyChanged();
}
}
else
{
- return GetInternalTextProperty(this) as string;
+ return InternalText;
}
}
set
}
else
{
- SetInternalTextProperty(this, null, value);
+ InternalText = value;
}
NotifyPropertyChanged();
}
{
if (NUIApplication.IsUsingXaml)
{
- return (Tizen.NUI.Components.DefaultGridItem.LabelOrientation)GetValue(LabelOrientationTypeProperty);
+ return (LabelOrientation)GetValue(LabelOrientationTypeProperty);
}
else
{
- return (Tizen.NUI.Components.DefaultGridItem.LabelOrientation)GetInternalLabelOrientationTypeProperty(this);
+ return InternalLabelOrientationType;
}
}
set
}
else
{
- SetInternalLabelOrientationTypeProperty(this, null, value);
+ InternalLabelOrientationType = value;
}
NotifyPropertyChanged();
}
}
- private Tizen.NUI.Components.DefaultGridItem.LabelOrientation InternalLabelOrientationType
+ private LabelOrientation InternalLabelOrientationType
{
get
{
public static readonly BindableProperty BadgeProperty = null;
internal static void SetInternalBadgeProperty(BindableObject bindable, object oldValue, object newValue)
{
- var instance = (DefaultGridItem)bindable;
if (newValue != null)
{
+ var instance = (DefaultGridItem)bindable;
instance.InternalBadge = newValue as View;
}
}
public static readonly BindableProperty TextProperty = null;
internal static void SetInternalTextProperty(BindableObject bindable, object oldValue, object newValue)
{
- var instance = (DefaultGridItem)bindable;
if (newValue != null)
{
+ var instance = (DefaultGridItem)bindable;
instance.InternalText = newValue as string;
}
}
public static readonly BindableProperty ResourceUrlProperty = null;
internal static void SetInternalResourceUrlProperty(BindableObject bindable, object oldValue, object newValue)
{
- var instance = (DefaultGridItem)bindable;
if (newValue != null)
{
+ var instance = (DefaultGridItem)bindable;
instance.InternalResourceUrl = newValue as string;
}
}
public static readonly BindableProperty LabelOrientationTypeProperty = null;
internal static void SetInternalLabelOrientationTypeProperty(BindableObject bindable, object oldValue, object newValue)
{
- var instance = (DefaultGridItem)bindable;
if (newValue != null)
{
- instance.InternalLabelOrientationType = (Tizen.NUI.Components.DefaultGridItem.LabelOrientation)newValue;
+ var instance = (DefaultGridItem)bindable;
+ instance.InternalLabelOrientationType = (LabelOrientation)newValue;
}
}
internal static object GetInternalLabelOrientationTypeProperty(BindableObject bindable)
}
else
{
- return GetInternalIconProperty(this) as View;
+ return InternalIcon;
}
}
set
}
else
{
- SetInternalIconProperty(this, null, value);
+ InternalIcon = value;
}
NotifyPropertyChanged();
}
}
else
{
- return GetInternalTextProperty(this) as string;
+ return InternalText;
}
}
set
}
else
{
- SetInternalTextProperty(this, null, value);
+ InternalText = value;
}
NotifyPropertyChanged();
}
}
else
{
- return GetInternalSubTextProperty(this) as string;
+ return InternalSubText;
}
}
set
}
else
{
- SetInternalSubTextProperty(this, null, value);
+ InternalSubText = value;
}
NotifyPropertyChanged();
}
}
else
{
- return GetInternalExtraProperty(this) as View;
+ return InternalExtra;
}
}
set
}
else
{
- SetInternalExtraProperty(this, null, value);
+ InternalExtra = value;
}
NotifyPropertyChanged();
}
public static readonly BindableProperty IconProperty = null;
internal static void SetInternalIconProperty(BindableObject bindable, object oldValue, object newValue)
{
- var instance = (DefaultLinearItem)bindable;
if (newValue != null)
{
+ var instance = (DefaultLinearItem)bindable;
instance.InternalIcon = newValue as View;
}
}
public static readonly BindableProperty TextProperty = null;
internal static void SetInternalTextProperty(BindableObject bindable, object oldValue, object newValue)
{
- var instance = (DefaultLinearItem)bindable;
if (newValue != null)
{
+ var instance = (DefaultLinearItem)bindable;
instance.InternalText = newValue as string;
}
}
public static readonly BindableProperty SubTextProperty = null;
internal static void SetInternalSubTextProperty(BindableObject bindable, object oldValue, object newValue)
{
- var instance = (DefaultLinearItem)bindable;
if (newValue != null)
{
+ var instance = (DefaultLinearItem)bindable;
instance.InternalSubText = newValue as string;
}
}
public static readonly BindableProperty ExtraProperty = null;
internal static void SetInternalExtraProperty(BindableObject bindable, object oldValue, object newValue)
{
- var instance = (DefaultLinearItem)bindable;
if (newValue != null)
{
+ var instance = (DefaultLinearItem)bindable;
instance.InternalExtra = newValue as View;
}
}
}
else
{
- return GetInternalIconProperty(this) as View;
+ return InternalIcon;
}
}
set
}
else
{
- SetInternalIconProperty(this, null, value);
+ InternalIcon = value;
}
NotifyPropertyChanged();
}
}
else
{
- return GetInternalTextProperty(this) as string;
+ return InternalText;
}
}
set
}
else
{
- SetInternalTextProperty(this, null, value);
+ InternalText = value;
}
NotifyPropertyChanged();
}
public static readonly BindableProperty IconProperty = null;
internal static void SetInternalIconProperty(BindableObject bindable, object oldValue, object newValue)
{
- var instance = (DefaultTitleItem)bindable;
if (newValue != null)
{
+ var instance = (DefaultTitleItem)bindable;
instance.InternalIcon = newValue as View;
}
}
public static readonly BindableProperty TextProperty = null;
internal static void SetInternalTextProperty(BindableObject bindable, object oldValue, object newValue)
{
- var instance = (DefaultTitleItem)bindable;
if (newValue != null)
{
+ var instance = (DefaultTitleItem)bindable;
instance.InternalText = newValue as string;
}
}
public static readonly BindableProperty IsSelectedProperty = null;
internal static void SetInternalIsSelectedProperty(BindableObject bindable, object oldValue, object newValue)
{
- var instance = (RecyclerViewItem)bindable;
if (newValue != null)
{
- bool newSelected = (bool)newValue;
- if (instance.isSelected != newSelected)
- {
- instance.isSelected = newSelected;
-
- if (instance.isSelectable)
- {
- instance.UpdateState();
- }
- if (instance.ParentItemsView is CollectionView collectionView)
- {
- var context = instance.BindingContext;
- if (collectionView.SelectionMode is ItemSelectionMode.Single ||
- collectionView.SelectionMode is ItemSelectionMode.SingleAlways)
- {
- if (newSelected && collectionView.SelectedItem != context)
- {
- collectionView.SelectedItem = context;
- }
- else if (!newSelected && collectionView.SelectedItem == context)
- {
- collectionView.SelectedItem = null;
- }
- }
- else if (collectionView.SelectionMode is ItemSelectionMode.Multiple)
- {
- var selectedList = collectionView.SelectedItems;
- if (selectedList != null && context != null)
- {
- bool contains = selectedList.Contains(context);
- if (newSelected && !contains)
- {
- selectedList.Add(context);
- }
- else if (!newSelected && contains)
- {
- selectedList.Remove(context);
- }
- }
- }
- }
- }
+ var instance = (RecyclerViewItem)bindable;
+ instance.SetInternalIsSelected((bool)newValue);
}
}
internal static object GetInternalIsSelectedProperty(BindableObject bindable)
{
var instance = (RecyclerViewItem)bindable;
- return instance.isSelectable && instance.isSelected;
+ return instance.GetInternalIsSelected();
}
/// <summary>
public static readonly BindableProperty IsSelectableProperty = null;
internal static void SetInternalIsSelectableProperty(BindableObject bindable, object oldValue, object newValue)
{
- var instance = (RecyclerViewItem)bindable;
if (newValue != null)
{
- bool newSelectable = (bool)newValue;
- if (instance.isSelectable != newSelectable)
- {
- instance.isSelectable = newSelectable;
- instance.UpdateState();
- }
+ var instance = (RecyclerViewItem)bindable;
+ instance.SetInternalIsSelectable((bool)newValue);
}
}
internal static object GetInternalIsSelectableProperty(BindableObject bindable)
{
- return ((RecyclerViewItem)bindable).isSelectable;
+ var instance = (RecyclerViewItem)bindable;
+ return instance.GetInternalIsSelectable();
}
private bool isSelected = false;
private bool isSelectable = true;
- private RecyclerViewItemStyle ItemStyle => ViewStyle as RecyclerViewItemStyle;
static RecyclerViewItem()
{
}
else
{
- return (bool)GetInternalIsSelectableProperty(this);
+ return GetInternalIsSelectable();
}
}
set
}
else
{
- SetInternalIsSelectableProperty(this, null, value);
+ SetInternalIsSelectable(value);
}
OnPropertyChanged(nameof(IsSelectable));
}
}
+ private void SetInternalIsSelectable(bool newValue)
+ {
+ bool newSelectable = newValue;
+ if (isSelectable != newSelectable)
+ {
+ isSelectable = newSelectable;
+ UpdateState();
+ }
+ }
+
+ private bool GetInternalIsSelectable()
+ {
+ return isSelectable;
+ }
+
/// <summary>
/// Flag to decide selected state in RecyclerViewItem.
/// </summary>
}
else
{
- return (bool)GetInternalIsSelectedProperty(this);
+ return GetInternalIsSelected();
}
}
set
}
else
{
- SetInternalIsSelectedProperty(this, null, value);
+ SetInternalIsSelected(value);
}
OnPropertyChanged(nameof(IsSelected));
}
}
+ private void SetInternalIsSelected(bool newValue)
+ {
+ bool newSelected = newValue;
+ if (isSelected != newSelected)
+ {
+ isSelected = newSelected;
+
+ if (isSelectable)
+ {
+ UpdateState();
+ }
+ if (ParentItemsView is CollectionView collectionView)
+ {
+ var context = BindingContext;
+ if (collectionView.SelectionMode is ItemSelectionMode.Single ||
+ collectionView.SelectionMode is ItemSelectionMode.SingleAlways)
+ {
+ if (newSelected && collectionView.SelectedItem != context)
+ {
+ collectionView.SelectedItem = context;
+ }
+ else if (!newSelected && collectionView.SelectedItem == context)
+ {
+ collectionView.SelectedItem = null;
+ }
+ }
+ else if (collectionView.SelectionMode is ItemSelectionMode.Multiple)
+ {
+ var selectedList = collectionView.SelectedItems;
+ if (selectedList != null && context != null)
+ {
+ bool contains = selectedList.Contains(context);
+ if (newSelected && !contains)
+ {
+ selectedList.Add(context);
+ }
+ else if (!newSelected && contains)
+ {
+ selectedList.Remove(context);
+ }
+ }
+ }
+ }
+ }
+ }
+
+ private bool GetInternalIsSelected()
+ {
+ return isSelectable && isSelected;
+ }
+
/// <summary>
/// Flag to decide enabled state in RecyclerViewItem.
/// Set enabled state false makes item untouchable and unfocusable.
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
+using System.Linq;
using Tizen.NUI.Binding;
namespace Tizen.NUI.Components
}
else
{
- return GetInternalItemsSourceProperty(this) as IEnumerable;
+ return InternalItemsSource;
}
}
set
}
else
{
- SetInternalItemsSourceProperty(this, null, value);
+ InternalItemsSource = value;
}
NotifyPropertyChanged();
}
}
+
internal virtual IEnumerable InternalItemsSource { get; set; }
/// <summary>
}
else
{
- return GetInternalItemTemplateProperty(this) as DataTemplate;
+ return InternalItemTemplate;
}
}
set
}
else
{
- SetInternalItemTemplateProperty(this, null, value);
+ InternalItemTemplate = value;
}
NotifyPropertyChanged();
}
public static readonly BindableProperty TimeProperty = null;
internal static void SetInternalTimeProperty(BindableObject bindable, object oldValue, object newValue)
{
- var instance = (TimePicker)bindable;
if (newValue != null)
{
+ var instance = (TimePicker)bindable;
instance.InternalTime = (DateTime)newValue;
}
}
public static readonly BindableProperty Is24HourViewProperty = null;
internal static void SetInternalIs24HourViewProperty(BindableObject bindable, object oldValue, object newValue)
{
- var instance = (TimePicker)bindable;
if (newValue != null)
{
+ var instance = (TimePicker)bindable;
instance.InternalIs24HourView = (bool)newValue;
}
}
}
else
{
- return (DateTime)GetInternalTimeProperty(this);
+ return InternalTime;
}
}
set
}
else
{
- SetInternalTimeProperty(this, null, value);
+ InternalTime = value;
}
NotifyPropertyChanged();
}
}
else
{
- return (bool)GetInternalIs24HourViewProperty(this);
+ return InternalIs24HourView;
}
}
set
}
else
{
- SetInternalIs24HourViewProperty(this, null, value);
+ InternalIs24HourView = value;
}
NotifyPropertyChanged();
}
{
// NOTE framerate selector does not work.
static readonly IStyleProperty FrameRateProperty = new StyleProperty<Loading, Selector<int?>>((v, o) => v.FrameRate = (int)o.Normal);
- static readonly IStyleProperty ImageListProperty = new StyleProperty<Loading, IList<string>>((v, o) => Loading.SetInternalImageListProperty(v, null, o));
+ static readonly IStyleProperty ImageListProperty = new StyleProperty<Loading, IList<string>>((v, o) => v.SetInternalImageList(o));
static readonly IStyleProperty LottieResourceUrlProperty = new StyleProperty<Loading, string>((v, o) => v.LottieResourceUrl = o);
private Size loadingSize;