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;
/// <since_tizen> 6 </since_tizen>
public Extents IconPadding
{
- get
- {
- return Style?.Icon?.Padding;
- }
- set
- {
- if (null != value && null != Style?.Icon?.Padding)
- {
- 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 && null != Style?.Text?.Padding)
- {
- 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();
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);
/// <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
{
{
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;
* 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);
}
}
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);
+ }
+ }
}
}
var instance = (Popup)bindable;
if (newValue != null)
{
- if (null != instance.Style?.Buttons?.Background)
+ if (null != instance.Style?.Buttons?.BackgroundImage)
{
- instance.Style.Buttons.Background.ResourceUrl = (string)newValue;
+ instance.Style.Buttons.BackgroundImage = (string)newValue;
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 (null != instance.Style?.Buttons?.Background)
+ if (null != instance.Style?.Buttons?.BackgroundImageBorder)
{
- instance.Style.Buttons.Background.Border = (Rectangle)newValue;
+ instance.Style.Buttons.BackgroundImageBorder = (Rectangle)newValue;
instance.UpdateButton();
}
}
defaultValueCreator: (bindable) =>
{
var instance = (Popup)bindable;
- return instance.Style.Buttons?.Background?.Border?.All;
+ return instance.Style.Buttons?.BackgroundImageBorder?.All;
});
private TextLabel titleText;
/// <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;
}
}
},
[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 selectButtonStyle = StyleManager.Instance.GetAttributes(style) as SelectButtonStyle;
- if (null != selectButtonStyle)
- {
- Style?.CopyFrom(selectButtonStyle);
- 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 (null == Style) return;
- if (null == selectableImage)
- {
- selectableImage = new ImageControl();
- selectableImage.Name = "SelectableImage";
- Add(selectableImage);
-
- selectableImage.RaiseToTop();
- }
-
- if (null == Style.SelectableImage)
- {
- Style.SelectableImage = new ImageControlStyle();
- }
- Style.SelectableImage.PositionUsesPivotPoint = true;
- Style.SelectableImage.ParentOrigin = NUI.ParentOrigin.TopLeft;
- Style.SelectableImage.PivotPoint = NUI.PivotPoint.TopLeft;
-
Style.IsSelectable = true;
- LayoutDirectionChanged += SelectButtonLayoutDirectionChanged;
- }
-
- private void UpdateTextAttributes()
- {
- if (null == Style) return;
- if (null == selectableImage) return;
- if (null != Style.Text)
- {
- Style.Text.PositionUsesPivotPoint = true;
- Style.Text.ParentOrigin = NUI.ParentOrigin.TopLeft;
- Style.Text.PivotPoint = NUI.PivotPoint.TopLeft;
- Style.Text.WidthResizePolicy = ResizePolicyType.Fixed;
- Style.Text.HeightResizePolicy = ResizePolicyType.Fixed;
-
- int iconWidth = (int)selectableImage.SizeWidth;
-
- int textPaddingLeft = Style.Text.Padding?.Start ?? 0;
- int textPaddingRight = Style.Text.Padding?.End ?? 0;
- int imagePaddingStart = selectableImage.Padding?.Start ?? 0;
- int imagePaddingEnd = selectableImage.Padding?.End ?? 0;
-
- if (null == Style.Text.Size && null != Size2D)
- {
- Style.Text.Size = new Size(Size2D.Width - iconWidth - imagePaddingStart - imagePaddingEnd - textPaddingLeft - textPaddingRight, Size2D.Height);
- }
-
- if(null == Style.Text.Position)
- {
- Style.Text.Position = new Position(imagePaddingStart + iconWidth + imagePaddingEnd + textPaddingLeft, 0);
- }
-
- Style.Text.VerticalAlignment = VerticalAlignment.Center;
- }
- }
-
- private void SelectButtonLayoutDirectionChanged(object sender, LayoutDirectionChangedEventArgs e)
- {
- if (null == Style || null == Style.Text) return;
- if (null == selectableImage) return;
-
- UpdateTextAttributes();
-
- int iconWidth = (int)selectableImage.SizeWidth;
-
- int textPaddingLeft = Style.Text.Padding?.Start ?? 0;
- int textPaddingRight = Style.Text.Padding?.End ?? 0;
- int pos = 0;
- int sizeWidth = (int)(Style.Text.Size?.Width ?? 0);
- if (null == Style.Text.Position)
- {
- Style.Text.Position = new Position(0, 0, 0);
- }
- if (LayoutDirection == ViewLayoutDirectionType.RTL)
- {
- Style.Text.HorizontalAlignment = HorizontalAlignment.End;
-
- Style.Text.Position.X = textPaddingRight;
- pos = sizeWidth + textPaddingLeft + textPaddingRight;
- if (null != Style.Icon?.Padding)
- {
- pos += Style.Icon.Padding.End;
- }
- }
- else if (LayoutDirection == ViewLayoutDirectionType.LTR)
- {
- Style.Text.HorizontalAlignment = HorizontalAlignment.Begin;
- Style.Text.Position.X = iconWidth + textPaddingLeft;
- if (null != Style.Icon?.Padding)
- {
- Style.Text.Position.X += (Style.Icon.Padding.Start + Style.Icon.Padding.End);
- pos = Style.Icon.Padding.Start;
- }
- }
- if (null == selectableImage.Position2D)
- {
- selectableImage.Position2D = new Position2D(0, 0);
- }
- selectableImage.Position2D.X = pos;
}
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
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)
{
});
/// 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;
internal Size2D sizeSetExplicitly = new Size2D(); // Store size set by API, will be used in place of NaturalSize if not set.
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;
});
- /// <summary>
- /// BackgroundImageProperty
- /// </summary>
+ /// <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;
});
-
+ /// <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>