To customize and apply app's own style instance, constructor with style
instance should be added.
For now, ApplyStyle() modifies the given properties only based on the
default style unlike applying style in constructor.
e.g. Let default style contain properties A, B, C.
Let custom style contain properties B, C.
Then ApplyStyle(custom style) contain default style's A and custom
style's B and C.
Consequently, to apply custom style without applying default style,
constructor with style instance is required.
14 files changed:
private View content = null;
private View content = null;
+ private void Initialize()
+ {
+ Layout = new AbsoluteLayout();
+
+ this.Relayout += OnRelayout;
+ }
+
/// <summary>
/// Creates a new instance of Dialog.
/// </summary>
/// <since_tizen> 9 </since_tizen>
public Dialog() : base()
{
/// <summary>
/// Creates a new instance of Dialog.
/// </summary>
/// <since_tizen> 9 </since_tizen>
public Dialog() : base()
{
- Layout = new AbsoluteLayout();
- this.Relayout += OnRelayout;
+ /// <summary>
+ /// Creates a new instance of a Dialog with style.
+ /// </summary>
+ /// <param name="style">A style applied to the newly created Dialog.</param>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public Dialog(ControlStyle style) : base(style)
+ {
+ Initialize();
+ /// <summary>
+ /// Creates a new instance of a Menu with style.
+ /// </summary>
+ /// <param name="style">A style applied to the newly created Menu.</param>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public Menu(MenuStyle style) : base(style)
+ {
+ Initialize();
+ }
+
/// <inheritdoc/>
[EditorBrowsable(EditorBrowsableState.Never)]
protected override void Dispose(DisposeTypes type)
/// <inheritdoc/>
[EditorBrowsable(EditorBrowsableState.Never)]
protected override void Dispose(DisposeTypes type)
WidthSpecification = LayoutParamPolicies.WrapContent;
HeightSpecification = LayoutParamPolicies.WrapContent;
WidthSpecification = LayoutParamPolicies.WrapContent;
HeightSpecification = LayoutParamPolicies.WrapContent;
- BackgroundColor = Color.Transparent;
-
// Menu is added to Anchor so Menu should exclude layouting because
// if Anchor has Layout, then Menu is displayed at an incorrect position.
ExcludeLayouting = true;
// Menu is added to Anchor so Menu should exclude layouting because
// if Anchor has Layout, then Menu is displayed at an incorrect position.
ExcludeLayouting = true;
+ /// <summary>
+ /// Creates a new instance of a MenuItem with style.
+ /// </summary>
+ /// <param name="style">A style applied to the newly created MenuItem.</param>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public MenuItem(ButtonStyle style) : base(style)
+ {
+ Initialize();
+ }
+
/// <inheritdoc/>
[EditorBrowsable(EditorBrowsableState.Never)]
protected override void Dispose(DisposeTypes type)
/// <inheritdoc/>
[EditorBrowsable(EditorBrowsableState.Never)]
protected override void Dispose(DisposeTypes type)
private AppBar appBar = null;
private View content = null;
private AppBar appBar = null;
private View content = null;
+ private void Initialize()
+ {
+ Layout = new ContentPageLayout();
+
+ // ContentPage matches to parent by default.
+ WidthSpecification = LayoutParamPolicies.MatchParent;
+ HeightSpecification = LayoutParamPolicies.MatchParent;
+ }
+
/// <summary>
/// Creates a new instance of a ContentPage.
/// </summary>
/// <since_tizen> 9 </since_tizen>
public ContentPage() : base()
{
/// <summary>
/// Creates a new instance of a ContentPage.
/// </summary>
/// <since_tizen> 9 </since_tizen>
public ContentPage() : base()
{
- Layout = new ContentPageLayout();
- // ContentPage matches to parent by default.
- WidthSpecification = LayoutParamPolicies.MatchParent;
- HeightSpecification = LayoutParamPolicies.MatchParent;
+ /// <summary>
+ /// Creates a new instance of a ContentPage with style.
+ /// </summary>
+ /// <param name="style">A style applied to the newly created ContentPage.</param>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public ContentPage(ControlStyle style) : base(style)
+ {
+ Initialize();
private View scrim = null;
private bool enableScrim = true;
private View scrim = null;
private bool enableScrim = true;
- /// <summary>
- /// Creates a new instance of a DialogPage.
- /// </summary>
- /// <since_tizen> 9 </since_tizen>
- public DialogPage() : base()
+ private void Initialize()
{
Layout = new AbsoluteLayout();
{
Layout = new AbsoluteLayout();
+ /// Creates a new instance of a DialogPage.
+ /// </summary>
+ /// <since_tizen> 9 </since_tizen>
+ public DialogPage() : base()
+ {
+ Initialize();
+ }
+
+ /// <summary>
+ /// Creates a new instance of a DialogPage with style.
+ /// </summary>
+ /// <param name="style">A style applied to the newly created DialogPage.</param>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public DialogPage(ControlStyle style) : base(style)
+ {
+ Initialize();
+ }
+
+ /// <summary>
/// Dispose DialogPage and all children on it.
/// </summary>
/// <param name="type">Dispose type.</param>
/// Dispose DialogPage and all children on it.
/// </summary>
/// <param name="type">Dispose type.</param>
private List<Page> navigationPages = new List<Page>();
private List<Page> navigationPages = new List<Page>();
+ private void Initialize()
+ {
+ Layout = new AbsoluteLayout();
+ }
+
/// <summary>
/// Creates a new instance of a Navigator.
/// </summary>
/// <since_tizen> 9 </since_tizen>
public Navigator() : base()
{
/// <summary>
/// Creates a new instance of a Navigator.
/// </summary>
/// <since_tizen> 9 </since_tizen>
public Navigator() : base()
{
- Layout = new AbsoluteLayout();
+ Initialize();
+ }
+
+ /// <summary>
+ /// Creates a new instance of a Navigator with style.
+ /// </summary>
+ /// <param name="style">A style applied to the newly created Navigator.</param>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public Navigator(ControlStyle style) : base(style)
+ {
+ Initialize();
+ /// Creates a new instance of a Page with style.
+ /// </summary>
+ /// <param name="style">A style applied to the newly created Page.</param>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public Page(ControlStyle style) : base(style)
+ {
+ }
+
+ /// <summary>
/// Navigator which has pushed the Page into its stack.
/// If this Page has not been pushed into any Navigator, then Navigator is null.
/// </summary>
/// Navigator which has pushed the Page into its stack.
/// If this Page has not been pushed into any Navigator, then Navigator is null.
/// </summary>
private bool delayedIndexScrollTo;
private (int index, bool anim, ItemScrollTo scrollTo) delayedIndexScrollToParam;
private bool delayedIndexScrollTo;
private (int index, bool anim, ItemScrollTo scrollTo) delayedIndexScrollToParam;
+ private void Initialize()
+ {
+ FocusGroup = true;
+ SetKeyboardNavigationSupport(true);
+ }
+
/// <summary>
/// Base constructor.
/// </summary>
/// <since_tizen> 9 </since_tizen>
public CollectionView() : base()
{
/// <summary>
/// Base constructor.
/// </summary>
/// <since_tizen> 9 </since_tizen>
public CollectionView() : base()
{
- FocusGroup = true;
- SetKeyboardNavigationSupport(true);
+ /// Creates a new instance of a CollectionView with style.
+ /// </summary>
+ /// <param name="style">A style applied to the newly created CollectionView.</param>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public CollectionView(ControlStyle style) : base(style)
+ {
+ Initialize();
+ }
+
+ /// <summary>
/// Event of Selection changed.
/// previous selection list and current selection will be provided.
/// </summary>
/// Event of Selection changed.
/// previous selection list and current selection will be provided.
/// </summary>
return instance.InternalItemTemplate;
});
return instance.InternalItemTemplate;
});
+ private void Initialize()
+ {
+ Scrolling += OnScrolling;
+ }
+
/// <summary>
/// Base Constructor
/// </summary>
/// <since_tizen> 9 </since_tizen>
public RecyclerView() : base()
{
/// <summary>
/// Base Constructor
/// </summary>
/// <since_tizen> 9 </since_tizen>
public RecyclerView() : base()
{
- Scrolling += OnScrolling;
+ Initialize();
+ }
+
+ /// <summary>
+ /// Creates a new instance of a RecyclerView with style.
+ /// </summary>
+ /// <param name="style">A style applied to the newly created RecyclerView.</param>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public RecyclerView(ControlStyle style) : base(style)
+ {
+ Initialize();
private bool isOverShootingShadowShown = false;
private float startShowShadowDisplacement;
private bool isOverShootingShadowShown = false;
private float startShowShadowDisplacement;
- /// <summary>
- /// Default Constructor
- /// </summary>
- /// <since_tizen> 8 </since_tizen>
- public ScrollableBase() : base()
+ private void Initialize()
{
DecelerationRate = 0.998f;
{
DecelerationRate = 0.998f;
SetKeyboardNavigationSupport(true);
}
SetKeyboardNavigationSupport(true);
}
+ /// <summary>
+ /// Default Constructor
+ /// </summary>
+ /// <since_tizen> 8 </since_tizen>
+ public ScrollableBase() : base()
+ {
+ Initialize();
+ }
+
+ /// <summary>
+ /// Creates a new instance of a ScrollableBase with style.
+ /// </summary>
+ /// <param name="style">A style applied to the newly created ScrollableBase.</param>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public ScrollableBase(ControlStyle style) : base(style)
+ {
+ Initialize();
+ }
+
private bool OnInterruptTouchingChildTouched(object source, View.TouchEventArgs args)
{
if (args.Touch.GetState(0) == PointStateType.Down)
private bool OnInterruptTouchingChildTouched(object source, View.TouchEventArgs args)
{
if (args.Touch.GetState(0) == PointStateType.Down)
private TabButtonGroup tabButtonGroup;
private TabButtonGroup tabButtonGroup;
- /// <summary>
- /// Creates a new instance of TabBar.
- /// </summary>
- /// <since_tizen> 9 </since_tizen>
- public TabBar()
+ private void Initialize()
{
Layout = new LinearLayout() { LinearOrientation = LinearLayout.Orientation.Horizontal };
{
Layout = new LinearLayout() { LinearOrientation = LinearLayout.Orientation.Horizontal };
+ /// Creates a new instance of TabBar.
+ /// </summary>
+ /// <since_tizen> 9 </since_tizen>
+ public TabBar()
+ {
+ Initialize();
+ }
+
+ /// <summary>
+ /// Creates a new instance of a TabBar with style.
+ /// </summary>
+ /// <param name="style">A style applied to the newly created TabBar.</param>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public TabBar(ControlStyle style) : base(style)
+ {
+ Initialize();
+ }
+
+ /// <summary>
/// An event for the tab button selected signal which can be used to
/// subscribe or unsubscribe the event handler provided by a user.
/// </summary>
/// An event for the tab button selected signal which can be used to
/// subscribe or unsubscribe the event handler provided by a user.
/// </summary>
{
private IList<View> views;
{
private IList<View> views;
+ private void Initialize()
+ {
+ SelectedIndex = -1;
+ views = new List<View>();
+ }
+
/// <summary>
/// Creates a new instance of TabContent.
/// </summary>
/// <since_tizen> 9 </since_tizen>
public TabContent()
{
/// <summary>
/// Creates a new instance of TabContent.
/// </summary>
/// <since_tizen> 9 </since_tizen>
public TabContent()
{
- SelectedIndex = -1;
- views = new List<View>();
+ Initialize();
+ }
+
+ /// <summary>
+ /// Creates a new instance of a TabContent with style.
+ /// </summary>
+ /// <param name="style">A style applied to the newly created TabContent.</param>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public TabContent(ControlStyle style) : base(style)
+ {
+ Initialize();
private TabContent content = null;
private TabContent content = null;
- /// <summary>
- /// Creates a new instance of TabView.
- /// </summary>
- /// <since_tizen> 9 </since_tizen>
- public TabView()
+ private void Initialize()
{
Layout = new LinearLayout() { LinearOrientation = LinearLayout.Orientation.Vertical };
WidthSpecification = LayoutParamPolicies.MatchParent;
{
Layout = new LinearLayout() { LinearOrientation = LinearLayout.Orientation.Vertical };
WidthSpecification = LayoutParamPolicies.MatchParent;
TabBar.RaiseAbove(Content);
}
TabBar.RaiseAbove(Content);
}
+ /// <summary>
+ /// Creates a new instance of TabView.
+ /// </summary>
+ /// <since_tizen> 9 </since_tizen>
+ public TabView()
+ {
+ Initialize();
+ }
+
+ /// <summary>
+ /// Creates a new instance of a TabView with style.
+ /// </summary>
+ /// <param name="style">A style applied to the newly created TabView.</param>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public TabView(ControlStyle style) : base(style)
+ {
+ Initialize();
+ }
+
/// <inheritdoc/>
[EditorBrowsable(EditorBrowsableState.Never)]
public override void OnInitialize()
/// <inheritdoc/>
[EditorBrowsable(EditorBrowsableState.Never)]
public override void OnInitialize()
// Menu base style
theme.AddStyleWithoutClone("Tizen.NUI.Components.Menu", new MenuStyle()
{
// Menu base style
theme.AddStyleWithoutClone("Tizen.NUI.Components.Menu", new MenuStyle()
{
+ BackgroundColor = Color.Transparent,
Content = new ViewStyle()
{
BackgroundColor = new Color("#FFFEFE"),
Content = new ViewStyle()
{
BackgroundColor = new Color("#FFFEFE"),