/*
- * Copyright(c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright(c) 2018 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.
using System;
using System.ComponentModel;
using System.Runtime.InteropServices;
+using Tizen.NUI.Binding;
namespace Tizen.NUI.BaseComponents
{
/// View is the base class for all views.
/// </summary>
/// <since_tizen> 3 </since_tizen>
- public class View : Container
+ public class View : Container, IResourcesProvider
{
+ /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public bool IsResourcesCreated
+ {
+ get
+ {
+ return Application.Current.IsResourcesCreated;
+ }
+ }
+
+ /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public ResourceDictionary XamlResources
+ {
+ get
+ {
+ return Application.Current.XamlResources;
+ }
+ set
+ {
+ Application.Current.XamlResources = value;
+ }
+ }
+
+ /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty StyleNameProperty = BindableProperty.Create("StyleName", typeof(string), typeof(View), string.Empty, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var view = (View)bindable;
+ if (newValue != null)
+ {
+ Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.STYLE_NAME, new Tizen.NUI.PropertyValue((string)newValue));
+ }
+ },
+ defaultValueCreator:(bindable) =>
+ {
+ var view = (View)bindable;
+ string temp;
+ Tizen.NUI.Object.GetProperty(view.swigCPtr, View.Property.STYLE_NAME).Get(out temp);
+ return temp;
+ });
+ /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty BackgroundColorProperty = BindableProperty.Create("BackgroundColor", typeof(Color), typeof(View), Color.Transparent, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var view = (View)bindable;
+ if (newValue != null)
+ {
+ Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.BACKGROUND, new Tizen.NUI.PropertyValue((Color)newValue));
+ }
+ },
+ defaultValueCreator:(bindable) =>
+ {
+ var view = (View)bindable;
+ Color backgroundColor = new Color(0.0f, 0.0f, 0.0f, 0.0f);
+
+ Tizen.NUI.PropertyMap background = view.Background;
+ int visualType = 0;
+ background.Find(Visual.Property.Type)?.Get(out visualType);
+ if (visualType == (int)Visual.Type.Color)
+ {
+ background.Find(ColorVisualProperty.MixColor)?.Get(backgroundColor);
+ }
+
+ return backgroundColor;
+ });
+ /// This will be public opened in tizen_5.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(View), default(string), propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var view = (View)bindable;
+ if (newValue != null)
+ {
+ Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.BACKGROUND, new Tizen.NUI.PropertyValue((string)newValue));
+ }
+ },
+ defaultValueCreator:(bindable) =>
+ {
+ var view = (View)bindable;
+ string backgroundImage = "";
+
+ Tizen.NUI.PropertyMap background = view.Background;
+ int visualType = 0;
+ background.Find(Visual.Property.Type)?.Get(out visualType);
+ if (visualType == (int)Visual.Type.Image)
+ {
+ background.Find(ImageVisualProperty.URL)?.Get(out backgroundImage);
+ }
+
+ return backgroundImage;
+ });
+ /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty BackgroundProperty = BindableProperty.Create("Background", typeof(PropertyMap), typeof(View), new PropertyMap(), propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var view = (View)bindable;
+ if (newValue != null)
+ {
+ Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.BACKGROUND, new Tizen.NUI.PropertyValue((PropertyMap)newValue));
+ }
+ },
+ defaultValueCreator:(bindable) =>
+ {
+ var view = (View)bindable;
+ Tizen.NUI.PropertyMap temp = new Tizen.NUI.PropertyMap();
+ Tizen.NUI.Object.GetProperty(view.swigCPtr, View.Property.BACKGROUND).Get(temp);
+ return temp;
+ });
+ /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty StateProperty = BindableProperty.Create("State", typeof(States), typeof(View), States.Normal, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var view = (View)bindable;
+ if (newValue != null)
+ {
+ Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.STATE, new Tizen.NUI.PropertyValue((int)newValue));
+ }
+ },
+ defaultValueCreator:(bindable) =>
+ {
+ var view = (View)bindable;
+ int temp = 0;
+ if (Tizen.NUI.Object.GetProperty(view.swigCPtr, View.Property.STATE).Get(out temp) == false)
+ {
+ NUILog.Error("State get error!");
+ }
+ switch (temp)
+ {
+ case 0: return States.Normal;
+ case 1: return States.Focused;
+ case 2: return States.Disabled;
+ default: return States.Normal;
+ }
+ });
+ /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty SubStateProperty = BindableProperty.Create("SubState", typeof(States), typeof(View), States.Normal, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var view = (View)bindable;
+ string valueToString = "";
+ if (newValue != null)
+ {
+ switch ((States)newValue)
+ {
+ case States.Normal: { valueToString = "NORMAL"; break; }
+ case States.Focused: { valueToString = "FOCUSED"; break; }
+ case States.Disabled: { valueToString = "DISABLED"; break; }
+ default: { valueToString = "NORMAL"; break; }
+ }
+ Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.SUB_STATE, new Tizen.NUI.PropertyValue(valueToString));
+ }
+ },
+ defaultValueCreator:(bindable) =>
+ {
+ var view = (View)bindable;
+ string temp;
+ if (Tizen.NUI.Object.GetProperty(view.swigCPtr, View.Property.SUB_STATE).Get(out temp) == false)
+ {
+ NUILog.Error("subState get error!");
+ }
+ switch (temp)
+ {
+ case "NORMAL": return States.Normal;
+ case "FOCUSED": return States.Focused;
+ case "DISABLED": return States.Disabled;
+ default: return States.Normal;
+ }
+ });
+ /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty TooltipProperty = BindableProperty.Create("Tooltip", typeof(PropertyMap), typeof(View), new PropertyMap(), propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var view = (View)bindable;
+ if (newValue != null)
+ {
+ Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.TOOLTIP, new Tizen.NUI.PropertyValue((PropertyMap)newValue));
+ }
+ },
+ defaultValueCreator:(bindable) =>
+ {
+ var view = (View)bindable;
+ Tizen.NUI.PropertyMap temp = new Tizen.NUI.PropertyMap();
+ Tizen.NUI.Object.GetProperty(view.swigCPtr, View.Property.TOOLTIP).Get(temp);
+ return temp;
+ });
+ // public static readonly BindableProperty TooltipTextProperty = BindableProperty.Create("TooltipText", typeof(string), typeof(View), default(string), propertyChanged: (bindable, oldValue, newValue) =>
+ // {
+ // var view = (View)bindable;
+ // if (newValue != null)
+ // {
+ // Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.TOOLTIP, new Tizen.NUI.PropertyValue((string)newValue));
+ // }
+ // });
+ public static readonly BindableProperty FlexProperty = BindableProperty.Create("Flex", typeof(float), typeof(View), default(float), propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var view = (View)bindable;
+ if (newValue != null)
+ {
+ Tizen.NUI.Object.SetProperty(view.swigCPtr, FlexContainer.ChildProperty.FLEX, new Tizen.NUI.PropertyValue((float)newValue));
+ }
+ },
+ defaultValueCreator:(bindable) =>
+ {
+ var view = (View)bindable;
+ float temp = 0.0f;
+ Tizen.NUI.Object.GetProperty(view.swigCPtr, FlexContainer.ChildProperty.FLEX).Get(out temp);
+ return temp;
+ });
+ /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty AlignSelfProperty = BindableProperty.Create("AlignSelf", typeof(int), typeof(View), default(int), propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var view = (View)bindable;
+ if (newValue != null)
+ {
+ Tizen.NUI.Object.SetProperty(view.swigCPtr, FlexContainer.ChildProperty.ALIGN_SELF, new Tizen.NUI.PropertyValue((int)newValue));
+ }
+ },
+ defaultValueCreator:(bindable) =>
+ {
+ var view = (View)bindable;
+ int temp = 0;
+ Tizen.NUI.Object.GetProperty(view.swigCPtr, FlexContainer.ChildProperty.ALIGN_SELF).Get(out temp);
+ return temp;
+ });
+ /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty FlexMarginProperty = BindableProperty.Create("FlexMargin", typeof(Vector4), typeof(View), Vector4.Zero, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var view = (View)bindable;
+ if (newValue != null)
+ {
+ Tizen.NUI.Object.SetProperty(view.swigCPtr, FlexContainer.ChildProperty.FLEX_MARGIN, new Tizen.NUI.PropertyValue((Vector4)newValue));
+ }
+ },
+ defaultValueCreator:(bindable) =>
+ {
+ var view = (View)bindable;
+ Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f);
+ Tizen.NUI.Object.GetProperty(view.swigCPtr, FlexContainer.ChildProperty.FLEX_MARGIN).Get(temp);
+ return temp;
+ });
+ /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty CellIndexProperty = BindableProperty.Create("CellIndex", typeof(Vector2), typeof(View), Vector2.Zero, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var view = (View)bindable;
+ if (newValue != null)
+ {
+ Tizen.NUI.Object.SetProperty(view.swigCPtr, TableView.ChildProperty.CELL_INDEX, new Tizen.NUI.PropertyValue((Vector2)newValue));
+ }
+ },
+ defaultValueCreator:(bindable) =>
+ {
+ var view = (View)bindable;
+ Vector2 temp = new Vector2(0.0f, 0.0f);
+ Tizen.NUI.Object.GetProperty(view.swigCPtr, TableView.ChildProperty.CELL_INDEX).Get(temp);
+ return temp;
+ });
+ /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty RowSpanProperty = BindableProperty.Create("RowSpan", typeof(float), typeof(View), default(float), propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var view = (View)bindable;
+ if (newValue != null)
+ {
+ Tizen.NUI.Object.SetProperty(view.swigCPtr, TableView.ChildProperty.ROW_SPAN, new Tizen.NUI.PropertyValue((float)newValue));
+ }
+ },
+ defaultValueCreator:(bindable) =>
+ {
+ var view = (View)bindable;
+ float temp = 0.0f;
+ Tizen.NUI.Object.GetProperty(view.swigCPtr, TableView.ChildProperty.ROW_SPAN).Get(out temp);
+ return temp;
+ });
+ /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty ColumnSpanProperty = BindableProperty.Create("ColumnSpan", typeof(float), typeof(View), default(float), propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var view = (View)bindable;
+ if (newValue != null)
+ {
+ Tizen.NUI.Object.SetProperty(view.swigCPtr, TableView.ChildProperty.COLUMN_SPAN, new Tizen.NUI.PropertyValue((float)newValue));
+ }
+ },
+ defaultValueCreator:(bindable) =>
+ {
+ var view = (View)bindable;
+ float temp = 0.0f;
+ Tizen.NUI.Object.GetProperty(view.swigCPtr, TableView.ChildProperty.COLUMN_SPAN).Get(out temp);
+ return temp;
+ });
+ /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty CellHorizontalAlignmentProperty = BindableProperty.Create("CellHorizontalAlignment", typeof(HorizontalAlignmentType), typeof(View), HorizontalAlignmentType.Left, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var view = (View)bindable;
+ string valueToString = "";
+
+ if (newValue != null)
+ {
+ switch ((HorizontalAlignmentType)newValue)
+ {
+ case Tizen.NUI.HorizontalAlignmentType.Left: { valueToString = "left"; break; }
+ case Tizen.NUI.HorizontalAlignmentType.Center: { valueToString = "center"; break; }
+ case Tizen.NUI.HorizontalAlignmentType.Right: { valueToString = "right"; break; }
+ default: { valueToString = "left"; break; }
+ }
+ Tizen.NUI.Object.SetProperty(view.swigCPtr, TableView.ChildProperty.CELL_HORIZONTAL_ALIGNMENT, new Tizen.NUI.PropertyValue(valueToString));
+ }
+ },
+ defaultValueCreator:(bindable) =>
+ {
+ var view = (View)bindable;
+ string temp;
+ if (Tizen.NUI.Object.GetProperty(view.swigCPtr, TableView.ChildProperty.CELL_HORIZONTAL_ALIGNMENT).Get(out temp) == false)
+ {
+ NUILog.Error("CellHorizontalAlignment get error!");
+ }
+
+ switch (temp)
+ {
+ case "left": return Tizen.NUI.HorizontalAlignmentType.Left;
+ case "center": return Tizen.NUI.HorizontalAlignmentType.Center;
+ case "right": return Tizen.NUI.HorizontalAlignmentType.Right;
+ default: return Tizen.NUI.HorizontalAlignmentType.Left;
+ }
+ });
+ /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty CellVerticalAlignmentProperty = BindableProperty.Create("CellVerticalAlignment", typeof(VerticalAlignmentType), typeof(View), VerticalAlignmentType.Top, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var view = (View)bindable;
+ string valueToString = "";
+
+ if (newValue != null)
+ {
+ switch ((VerticalAlignmentType)newValue)
+ {
+ case Tizen.NUI.VerticalAlignmentType.Top: { valueToString = "top"; break; }
+ case Tizen.NUI.VerticalAlignmentType.Center: { valueToString = "center"; break; }
+ case Tizen.NUI.VerticalAlignmentType.Bottom: { valueToString = "bottom"; break; }
+ default: { valueToString = "top"; break; }
+ }
+ Tizen.NUI.Object.SetProperty(view.swigCPtr, TableView.ChildProperty.CELL_VERTICAL_ALIGNMENT, new Tizen.NUI.PropertyValue(valueToString));
+ }
+ },
+ defaultValueCreator:(bindable) =>
+ {
+ var view = (View)bindable;
+ string temp;
+ Tizen.NUI.Object.GetProperty(view.swigCPtr, TableView.ChildProperty.CELL_VERTICAL_ALIGNMENT).Get(out temp);
+ {
+ NUILog.Error("CellVerticalAlignment get error!");
+ }
+
+ switch (temp)
+ {
+ case "top": return Tizen.NUI.VerticalAlignmentType.Top;
+ case "center": return Tizen.NUI.VerticalAlignmentType.Center;
+ case "bottom": return Tizen.NUI.VerticalAlignmentType.Bottom;
+ default: return Tizen.NUI.VerticalAlignmentType.Top;
+ }
+ });
+ /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty LeftFocusableViewProperty = BindableProperty.Create("LeftFocusableView", typeof(View), typeof(View), default(View), propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var view = (View)bindable;
+ if (newValue != null) { view.LeftFocusableViewId = (int)(newValue as View).GetId(); }
+ else { view.LeftFocusableViewId = -1; }
+ },
+ defaultValueCreator:(bindable) =>
+ {
+ var view = (View)bindable;
+ if (view.LeftFocusableViewId >= 0) { return view.ConvertIdToView((uint)view.LeftFocusableViewId); }
+ return null;
+ });
+ /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty RightFocusableViewProperty = BindableProperty.Create("RightFocusableView", typeof(View), typeof(View), default(View), propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var view = (View)bindable;
+ if (newValue != null) { view.RightFocusableViewId = (int)(newValue as View).GetId(); }
+ else { view.RightFocusableViewId = -1; }
+ },
+ defaultValueCreator:(bindable) =>
+ {
+ var view = (View)bindable;
+ if (view.RightFocusableViewId >= 0) { return view.ConvertIdToView((uint)view.RightFocusableViewId); }
+ return null;
+ });
+ /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty UpFocusableViewProperty = BindableProperty.Create("UpFocusableView", typeof(View), typeof(View), default(View), propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var view = (View)bindable;
+ if (newValue != null) { view.UpFocusableViewId = (int)(newValue as View).GetId(); }
+ else { view.UpFocusableViewId = -1; }
+ },
+ defaultValueCreator:(bindable) =>
+ {
+ var view = (View)bindable;
+ if (view.UpFocusableViewId >= 0) { return view.ConvertIdToView((uint)view.UpFocusableViewId); }
+ return null;
+ });
+ /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty DownFocusableViewProperty = BindableProperty.Create("DownFocusableView", typeof(View), typeof(View), default(View), propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var view = (View)bindable;
+ if (newValue != null) { view.DownFocusableViewId = (int)(newValue as View).GetId(); }
+ else { view.DownFocusableViewId = -1; }
+ },
+ defaultValueCreator:(bindable) =>
+ {
+ var view = (View)bindable;
+ if (view.DownFocusableViewId >= 0) { return view.ConvertIdToView((uint)view.DownFocusableViewId); }
+ return null;
+ });
+ /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty FocusableProperty = BindableProperty.Create("Focusable", typeof(bool), typeof(View), false, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var view = (View)bindable;
+ if (newValue != null) { view.SetKeyboardFocusable((bool)newValue); }
+ },
+ defaultValueCreator:(bindable) =>
+ {
+ var view = (View)bindable;
+ return view.IsKeyboardFocusable();
+ });
+ /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty Size2DProperty = BindableProperty.Create("Size2D", typeof(Size2D), typeof(View), new Size2D(0,0), propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var view = (View)bindable;
+ if (newValue != null)
+ {
+ Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.SIZE, new Tizen.NUI.PropertyValue( new Size((Size2D)newValue)));
+ }
+ },
+ defaultValueCreator:(bindable) =>
+ {
+ var view = (View)bindable;
+ Size temp = new Size(0.0f, 0.0f, 0.0f);
+ Tizen.NUI.Object.GetProperty(view.swigCPtr, View.Property.SIZE).Get(temp);
+ Size2D size = new Size2D((int)temp.Width, (int)temp.Height);
+ return size;
+ });
+ /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty OpacityProperty = BindableProperty.Create("Opacity", typeof(float), typeof(View), default(float), propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var view = (View)bindable;
+ if (newValue != null)
+ {
+ Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.OPACITY, new Tizen.NUI.PropertyValue((float)newValue));
+ }
+ },
+ defaultValueCreator:(bindable) =>
+ {
+ var view = (View)bindable;
+ float temp = 0.0f;
+ Tizen.NUI.Object.GetProperty(view.swigCPtr, View.Property.OPACITY).Get(out temp);
+ return temp;
+ });
+ /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty Position2DProperty = BindableProperty.Create("Position2D", typeof(Position2D), typeof(View), new Position2D(0,0), propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var view = (View)bindable;
+ if (newValue != null)
+ {
+ Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.POSITION, new Tizen.NUI.PropertyValue( new Position((Position2D)newValue) ));
+ }
+ },
+ defaultValueCreator:(bindable) =>
+ {
+ var view = (View)bindable;
+ Position temp = new Position(0.0f, 0.0f, 0.0f);
+ Tizen.NUI.Object.GetProperty(view.swigCPtr, View.Property.POSITION).Get(temp);
+ return new Position2D(temp);
+ });
+ /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty PositionUsesPivotPointProperty = BindableProperty.Create("PositionUsesPivotPoint", typeof(bool), typeof(View), true, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var view = (View)bindable;
+ if (newValue != null)
+ {
+ Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.POSITION_USES_ANCHOR_POINT, new Tizen.NUI.PropertyValue((bool)newValue));
+ }
+ },
+ defaultValueCreator:(bindable) =>
+ {
+ var view = (View)bindable;
+ bool temp = false;
+ Tizen.NUI.Object.GetProperty(view.swigCPtr, View.Property.POSITION_USES_ANCHOR_POINT).Get(out temp);
+ return temp;
+ });
+ /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty SiblingOrderProperty = BindableProperty.Create("SiblingOrder", typeof(int), typeof(View), default(int), propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var view = (View)bindable;
+ int value;
+ if (newValue != null)
+ {
+ value = (int)newValue;
+ if(value < 0)
+ {
+ NUILog.Error("SiblingOrder should be bigger than 0 or equal to 0.");
+ return;
+ }
+ var siblings = view.GetParent()?.Children;
+ if (siblings != null)
+ {
+ int currentOrder = siblings.IndexOf(view);
+ if (value != currentOrder)
+ {
+ if (value == 0) { view.LowerToBottom(); }
+ else if (value < siblings.Count - 1)
+ {
+ if (value > currentOrder) { view.RaiseAbove(siblings[value]); }
+ else { view.LowerBelow(siblings[value]); }
+ }
+ else { view.RaiseToTop(); }
+ }
+ }
+ }
+ },
+ defaultValueCreator:(bindable) =>
+ {
+ var view = (View)bindable;
+ var parentChildren = view.GetParent()?.Children;
+ int currentOrder = 0;
+ if (parentChildren != null)
+ {
+ currentOrder = parentChildren.IndexOf(view);
+
+ if (currentOrder < 0) { return 0; }
+ else if (currentOrder < parentChildren.Count) { return currentOrder; }
+ }
+
+ return 0;
+ });
+ /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty ParentOriginProperty = BindableProperty.Create("ParentOrigin", typeof(Position), typeof(View), Position.ParentOriginTopLeft, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var view = (View)bindable;
+ if (newValue != null)
+ {
+ Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.PARENT_ORIGIN, new Tizen.NUI.PropertyValue((Position)newValue));
+ }
+ },
+ defaultValueCreator:(bindable) =>
+ {
+ var view = (View)bindable;
+ Position temp = new Position(0.0f, 0.0f, 0.0f);
+ Tizen.NUI.Object.GetProperty(view.swigCPtr, View.Property.PARENT_ORIGIN).Get(temp);
+ return temp;
+ }
+ );
+ /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty PivotPointProperty = BindableProperty.Create("PivotPoint", typeof(Position), typeof(View), Position.PivotPointTopLeft, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var view = (View)bindable;
+ if (newValue != null)
+ {
+ Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.ANCHOR_POINT, new Tizen.NUI.PropertyValue((Position)newValue));
+ }
+ },
+ defaultValueCreator:(bindable) =>
+ {
+ var view = (View)bindable;
+ Position temp = new Position(0.0f, 0.0f, 0.0f);
+ Tizen.NUI.Object.GetProperty(view.swigCPtr, View.Property.ANCHOR_POINT).Get(temp);
+ return temp;
+ });
+ /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty SizeWidthProperty = BindableProperty.Create("SizeWidth", typeof(float), typeof(View), default(float), propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var view = (View)bindable;
+ if (newValue != null)
+ {
+ Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.SIZE_WIDTH, new Tizen.NUI.PropertyValue((float)newValue));
+ }
+ },
+ defaultValueCreator:(bindable) =>
+ {
+ var view = (View)bindable;
+ float temp = 0.0f;
+ Tizen.NUI.Object.GetProperty(view.swigCPtr, View.Property.SIZE_WIDTH).Get(out temp);
+ return temp;
+ });
+ /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty SizeHeightProperty = BindableProperty.Create("SizeHeight", typeof(float), typeof(View), default(float), propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var view = (View)bindable;
+ if (newValue != null)
+ {
+ Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.SIZE_HEIGHT, new Tizen.NUI.PropertyValue((float)newValue));
+ }
+ },
+ defaultValueCreator:(bindable) =>
+ {
+ var view = (View)bindable;
+ float temp = 0.0f;
+ Tizen.NUI.Object.GetProperty(view.swigCPtr, View.Property.SIZE_HEIGHT).Get(out temp);
+ return temp;
+ });
+ /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty PositionProperty = BindableProperty.Create("Position", typeof(Position), typeof(View), Position.Zero, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var view = (View)bindable;
+ if (newValue != null)
+ {
+ Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.POSITION, new Tizen.NUI.PropertyValue((Position)newValue));
+ }
+ },
+ defaultValueCreator:(bindable) =>
+ {
+ var view = (View)bindable;
+ Position temp = new Position(0.0f, 0.0f, 0.0f);
+ Tizen.NUI.Object.GetProperty(view.swigCPtr, View.Property.POSITION).Get(temp);
+ return temp;
+ });
+ /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty PositionXProperty = BindableProperty.Create("PositionX", typeof(float), typeof(View), default(float), propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var view = (View)bindable;
+ if (newValue != null)
+ {
+ Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.POSITION_X, new Tizen.NUI.PropertyValue((float)newValue));
+ }
+ },
+ defaultValueCreator:(bindable) =>
+ {
+ var view = (View)bindable;
+ float temp = 0.0f;
+ Tizen.NUI.Object.GetProperty(view.swigCPtr, View.Property.POSITION_X).Get(out temp);
+ return temp;
+ });
+ /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty PositionYProperty = BindableProperty.Create("PositionY", typeof(float), typeof(View), default(float), propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var view = (View)bindable;
+ if (newValue != null)
+ {
+ Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.POSITION_Y, new Tizen.NUI.PropertyValue((float)newValue));
+ }
+ },
+ defaultValueCreator:(bindable) =>
+ {
+ var view = (View)bindable;
+ float temp = 0.0f;
+ Tizen.NUI.Object.GetProperty(view.swigCPtr, View.Property.POSITION_Y).Get(out temp);
+ return temp;
+ });
+ /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty PositionZProperty = BindableProperty.Create("PositionZ", typeof(float), typeof(View), default(float), propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var view = (View)bindable;
+ if (newValue != null)
+ {
+ Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.POSITION_Z, new Tizen.NUI.PropertyValue((float)newValue));
+ }
+ },
+ defaultValueCreator:(bindable) =>
+ {
+ var view = (View)bindable;
+ float temp = 0.0f;
+ Tizen.NUI.Object.GetProperty(view.swigCPtr, View.Property.POSITION_Z).Get(out temp);
+ return temp;
+ });
+ /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty OrientationProperty = BindableProperty.Create("Orientation", typeof(Rotation), typeof(View), new Rotation(new Radian(0), Vector3.ZAxis), propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var view = (View)bindable;
+ if (newValue != null)
+ {
+ Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.ORIENTATION, new Tizen.NUI.PropertyValue((Rotation)newValue));
+ }
+ },
+ defaultValueCreator:(bindable) =>
+ {
+ var view = (View)bindable;
+ Rotation temp = new Rotation();
+ Tizen.NUI.Object.GetProperty(view.swigCPtr, View.Property.ORIENTATION).Get(temp);
+ return temp;
+ });
+ /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty ScaleProperty = BindableProperty.Create("Scale", typeof(Vector3), typeof(View), Vector3.Zero, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var view = (View)bindable;
+ if (newValue != null)
+ {
+ Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.SCALE, new Tizen.NUI.PropertyValue((Vector3)newValue));
+ }
+ },
+ defaultValueCreator:(bindable) =>
+ {
+ var view = (View)bindable;
+ Vector3 temp = new Vector3(0.0f, 0.0f, 0.0f);
+ Tizen.NUI.Object.GetProperty(view.swigCPtr, View.Property.SCALE).Get(temp);
+ return temp;
+ });
+ /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty ScaleXProperty = BindableProperty.Create("ScaleX", typeof(float), typeof(View), default(float), propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var view = (View)bindable;
+ if (newValue != null)
+ {
+ Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.SCALE_X, new Tizen.NUI.PropertyValue((float)newValue));
+ }
+ },
+ defaultValueCreator:(bindable) =>
+ {
+ var view = (View)bindable;
+ float temp = 0.0f;
+ Tizen.NUI.Object.GetProperty(view.swigCPtr, View.Property.SCALE_X).Get(out temp);
+ return temp;
+ });
+ /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty ScaleYProperty = BindableProperty.Create("ScaleY", typeof(float), typeof(View), default(float), propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var view = (View)bindable;
+ if (newValue != null)
+ {
+ Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.SCALE_Y, new Tizen.NUI.PropertyValue((float)newValue));
+ }
+ },
+ defaultValueCreator:(bindable) =>
+ {
+ var view = (View)bindable;
+ float temp = 0.0f;
+ Tizen.NUI.Object.GetProperty(view.swigCPtr, View.Property.SCALE_Y).Get(out temp);
+ return temp;
+ });
+ /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty ScaleZProperty = BindableProperty.Create("ScaleZ", typeof(float), typeof(View), default(float), propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var view = (View)bindable;
+ if (newValue != null)
+ {
+ Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.SCALE_Z, new Tizen.NUI.PropertyValue((float)newValue));
+ }
+ },
+ defaultValueCreator:(bindable) =>
+ {
+ var view = (View)bindable;
+ float temp = 0.0f;
+ Tizen.NUI.Object.GetProperty(view.swigCPtr, View.Property.SCALE_Z).Get(out temp);
+ return temp;
+ });
+ /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty NameProperty = BindableProperty.Create("Name", typeof(string), typeof(View), string.Empty, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var view = (View)bindable;
+ if (newValue != null)
+ {
+ Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.NAME, new Tizen.NUI.PropertyValue((string)newValue));
+ }
+ },
+ defaultValueCreator:(bindable) =>
+ {
+ var view = (View)bindable;
+ string temp;
+ Tizen.NUI.Object.GetProperty(view.swigCPtr, View.Property.NAME).Get(out temp);
+ return temp;
+ });
+ /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty SensitiveProperty = BindableProperty.Create("Sensitive", typeof(bool), typeof(View), false, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var view = (View)bindable;
+ if (newValue != null)
+ {
+ Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.SENSITIVE, new Tizen.NUI.PropertyValue((bool)newValue));
+ }
+ },
+ defaultValueCreator:(bindable) =>
+ {
+ var view = (View)bindable;
+ bool temp = false;
+ Tizen.NUI.Object.GetProperty(view.swigCPtr, View.Property.SENSITIVE).Get(out temp);
+ return temp;
+ });
+ /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty LeaveRequiredProperty = BindableProperty.Create("LeaveRequired", typeof(bool), typeof(View), false, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var view = (View)bindable;
+ if (newValue != null)
+ {
+ Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.LEAVE_REQUIRED, new Tizen.NUI.PropertyValue((bool)newValue));
+ }
+ },
+ defaultValueCreator:(bindable) =>
+ {
+ var view = (View)bindable;
+ bool temp = false;
+ Tizen.NUI.Object.GetProperty(view.swigCPtr, View.Property.LEAVE_REQUIRED).Get(out temp);
+ return temp;
+ });
+ /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty InheritOrientationProperty = BindableProperty.Create("InheritOrientation", typeof(bool), typeof(View), false, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var view = (View)bindable;
+ if (newValue != null)
+ {
+ Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.INHERIT_ORIENTATION, new Tizen.NUI.PropertyValue((bool)newValue));
+ }
+ },
+ defaultValueCreator:(bindable) =>
+ {
+ var view = (View)bindable;
+ bool temp = false;
+ Tizen.NUI.Object.GetProperty(view.swigCPtr, View.Property.INHERIT_ORIENTATION).Get(out temp);
+ return temp;
+ });
+ /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty InheritScaleProperty = BindableProperty.Create("InheritScale", typeof(bool), typeof(View), false, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var view = (View)bindable;
+ if (newValue != null)
+ {
+ Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.INHERIT_SCALE, new Tizen.NUI.PropertyValue((bool)newValue));
+ }
+ },
+ defaultValueCreator:(bindable) =>
+ {
+ var view = (View)bindable;
+ bool temp = false;
+ Tizen.NUI.Object.GetProperty(view.swigCPtr, View.Property.INHERIT_SCALE).Get(out temp);
+ return temp;
+ });
+ /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty DrawModeProperty = BindableProperty.Create("DrawMode", typeof(DrawModeType), typeof(View), DrawModeType.Normal, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var view = (View)bindable;
+ if (newValue != null)
+ {
+ Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.DRAW_MODE, new Tizen.NUI.PropertyValue((int)newValue));
+ }
+ },
+ defaultValueCreator:(bindable) =>
+ {
+ var view = (View)bindable;
+ string temp;
+ if (Tizen.NUI.Object.GetProperty(view.swigCPtr, View.Property.DRAW_MODE).Get(out temp) == false)
+ {
+ NUILog.Error("DrawMode get error!");
+ }
+ switch (temp)
+ {
+ case "NORMAL": return DrawModeType.Normal;
+ case "OVERLAY_2D": return DrawModeType.Overlay2D;
+ case "STENCIL": return DrawModeType.Stencil;
+ default: return DrawModeType.Normal;
+ }
+ });
+ /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty SizeModeFactorProperty = BindableProperty.Create("SizeModeFactor", typeof(Vector3), typeof(View), Vector3.Zero, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var view = (View)bindable;
+ if (newValue != null)
+ {
+ Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.SIZE_MODE_FACTOR, new Tizen.NUI.PropertyValue((Vector3)newValue));
+ }
+ },
+ defaultValueCreator:(bindable) =>
+ {
+ var view = (View)bindable;
+ Vector3 temp = new Vector3(0.0f, 0.0f, 0.0f);
+ Tizen.NUI.Object.GetProperty(view.swigCPtr, View.Property.SIZE_MODE_FACTOR).Get(temp);
+ return temp;
+ });
+ /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty WidthResizePolicyProperty = BindableProperty.Create("WidthResizePolicy", typeof(ResizePolicyType), typeof(View), ResizePolicyType.Fixed, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var view = (View)bindable;
+ if (newValue != null)
+ {
+ Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.WIDTH_RESIZE_POLICY, new Tizen.NUI.PropertyValue((int)newValue));
+ }
+ },
+ defaultValueCreator:(bindable) =>
+ {
+ var view = (View)bindable;
+ string temp;
+ if (Tizen.NUI.Object.GetProperty(view.swigCPtr, View.Property.WIDTH_RESIZE_POLICY).Get(out temp) == false)
+ {
+ NUILog.Error("WidthResizePolicy get error!");
+ }
+ switch (temp)
+ {
+ case "FIXED": return ResizePolicyType.Fixed;
+ case "USE_NATURAL_SIZE": return ResizePolicyType.UseNaturalSize;
+ case "FILL_TO_PARENT": return ResizePolicyType.FillToParent;
+ case "SIZE_RELATIVE_TO_PARENT": return ResizePolicyType.SizeRelativeToParent;
+ case "SIZE_FIXED_OFFSET_FROM_PARENT": return ResizePolicyType.SizeFixedOffsetFromParent;
+ case "FIT_TO_CHILDREN": return ResizePolicyType.FitToChildren;
+ case "DIMENSION_DEPENDENCY": return ResizePolicyType.DimensionDependency;
+ case "USE_ASSIGNED_SIZE": return ResizePolicyType.UseAssignedSize;
+ default: return ResizePolicyType.Fixed;
+ }
+ });
+ /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty HeightResizePolicyProperty = BindableProperty.Create("HeightResizePolicy", typeof(ResizePolicyType), typeof(View), ResizePolicyType.Fixed, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var view = (View)bindable;
+ if (newValue != null)
+ {
+ Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.HEIGHT_RESIZE_POLICY, new Tizen.NUI.PropertyValue((int)newValue));
+ }
+ },
+ defaultValueCreator:(bindable) =>
+ {
+ var view = (View)bindable;
+ string temp;
+ if (Tizen.NUI.Object.GetProperty(view.swigCPtr, View.Property.HEIGHT_RESIZE_POLICY).Get(out temp) == false)
+ {
+ NUILog.Error("HeightResizePolicy get error!");
+ }
+ switch (temp)
+ {
+ case "FIXED": return ResizePolicyType.Fixed;
+ case "USE_NATURAL_SIZE": return ResizePolicyType.UseNaturalSize;
+ case "FILL_TO_PARENT": return ResizePolicyType.FillToParent;
+ case "SIZE_RELATIVE_TO_PARENT": return ResizePolicyType.SizeRelativeToParent;
+ case "SIZE_FIXED_OFFSET_FROM_PARENT": return ResizePolicyType.SizeFixedOffsetFromParent;
+ case "FIT_TO_CHILDREN": return ResizePolicyType.FitToChildren;
+ case "DIMENSION_DEPENDENCY": return ResizePolicyType.DimensionDependency;
+ case "USE_ASSIGNED_SIZE": return ResizePolicyType.UseAssignedSize;
+ default: return ResizePolicyType.Fixed;
+ }
+ });
+ /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty SizeScalePolicyProperty = BindableProperty.Create("SizeScalePolicy", typeof(SizeScalePolicyType), typeof(View), SizeScalePolicyType.UseSizeSet, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var view = (View)bindable;
+ string valueToString = "";
+ if (newValue != null)
+ {
+ switch ((SizeScalePolicyType)newValue)
+ {
+ case SizeScalePolicyType.UseSizeSet: { valueToString = "USE_SIZE_SET"; break; }
+ case SizeScalePolicyType.FitWithAspectRatio: { valueToString = "FIT_WITH_ASPECT_RATIO"; break; }
+ case SizeScalePolicyType.FillWithAspectRatio: { valueToString = "FILL_WITH_ASPECT_RATIO"; break; }
+ default: { valueToString = "USE_SIZE_SET"; break; }
+ }
+ Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.SIZE_SCALE_POLICY, new Tizen.NUI.PropertyValue(valueToString));
+ }
+ },
+ defaultValueCreator:(bindable) =>
+ {
+ var view = (View)bindable;
+ string temp;
+ if (Tizen.NUI.Object.GetProperty(view.swigCPtr, View.Property.SIZE_SCALE_POLICY).Get(out temp) == false)
+ {
+ NUILog.Error("SizeScalePolicy get error!");
+ }
+ switch (temp)
+ {
+ case "USE_SIZE_SET": return SizeScalePolicyType.UseSizeSet;
+ case "FIT_WITH_ASPECT_RATIO": return SizeScalePolicyType.FitWithAspectRatio;
+ case "FILL_WITH_ASPECT_RATIO": return SizeScalePolicyType.FillWithAspectRatio;
+ default: return SizeScalePolicyType.UseSizeSet;
+ }
+ });
+ /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty WidthForHeightProperty = BindableProperty.Create("WidthForHeight", typeof(bool), typeof(View), false, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var view = (View)bindable;
+ if (newValue != null)
+ {
+ Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.WIDTH_FOR_HEIGHT, new Tizen.NUI.PropertyValue((bool)newValue));
+ }
+ },
+ defaultValueCreator:(bindable) =>
+ {
+ var view = (View)bindable;
+ bool temp = false;
+ Tizen.NUI.Object.GetProperty(view.swigCPtr, View.Property.WIDTH_FOR_HEIGHT).Get(out temp);
+ return temp;
+ });
+ /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty HeightForWidthProperty = BindableProperty.Create("HeightForWidth", typeof(bool), typeof(View), false, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var view = (View)bindable;
+ if (newValue != null)
+ {
+ Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.HEIGHT_FOR_WIDTH, new Tizen.NUI.PropertyValue((bool)newValue));
+ }
+ },
+ defaultValueCreator:(bindable) =>
+ {
+ var view = (View)bindable;
+ bool temp = false;
+ Tizen.NUI.Object.GetProperty(view.swigCPtr, View.Property.HEIGHT_FOR_WIDTH).Get(out temp);
+ return temp;
+ });
+ /// This will be public opened in tizen_5.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(View), new Extents(0,0,0,0), propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var view = (View)bindable;
+ if (newValue != null)
+ {
+ Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.PADDING, new Tizen.NUI.PropertyValue((Extents)newValue));
+ }
+ },
+ defaultValueCreator:(bindable) =>
+ {
+ var view = (View)bindable;
+ Extents temp = new Extents(0, 0, 0, 0);
+ Tizen.NUI.Object.GetProperty(view.swigCPtr, View.Property.PADDING).Get(temp);
+ return temp;
+ });
+ /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty SizeProperty = BindableProperty.Create("Size", typeof(Size), typeof(View), new Size(0,0,0), propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var view = (View)bindable;
+ if (newValue != null)
+ {
+ Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.SIZE, new Tizen.NUI.PropertyValue((Size)newValue));
+ }
+ },
+ defaultValueCreator: (bindable) => {
+ var view = (View)bindable;
+ Size temp = new Size(0, 0, 0);
+ Tizen.NUI.Object.GetProperty(view.swigCPtr, View.Property.SIZE).Get(temp);
+ return temp;
+ });
+ /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty MinimumSizeProperty = BindableProperty.Create("MinimumSize", typeof(Size2D), typeof(View), new Size2D(0,0), propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var view = (View)bindable;
+ if (newValue != null)
+ {
+ Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.MINIMUM_SIZE, new Tizen.NUI.PropertyValue((Size2D)newValue));
+ }
+ },
+ defaultValueCreator:(bindable) =>
+ {
+ var view = (View)bindable;
+ Size2D temp = new Size2D(0, 0);
+ Tizen.NUI.Object.GetProperty(view.swigCPtr, View.Property.MINIMUM_SIZE).Get(temp);
+ return temp;
+ });
+ /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty MaximumSizeProperty = BindableProperty.Create("MaximumSize", typeof(Size2D), typeof(View), new Size2D(0,0), propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var view = (View)bindable;
+ if (newValue != null)
+ {
+ Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.MAXIMUM_SIZE, new Tizen.NUI.PropertyValue((Size2D)newValue));
+ }
+ },
+ defaultValueCreator:(bindable) =>
+ {
+ var view = (View)bindable;
+ Size2D temp = new Size2D(0, 0);
+ Tizen.NUI.Object.GetProperty(view.swigCPtr, View.Property.MAXIMUM_SIZE).Get(temp);
+ return temp;
+ });
+ /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty InheritPositionProperty = BindableProperty.Create("InheritPosition", typeof(bool), typeof(View), false, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var view = (View)bindable;
+ if (newValue != null)
+ {
+ Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.INHERIT_POSITION, new Tizen.NUI.PropertyValue((bool)newValue));
+ }
+ },
+ defaultValueCreator:(bindable) =>
+ {
+ var view = (View)bindable;
+ bool temp = false;
+ Tizen.NUI.Object.GetProperty(view.swigCPtr, View.Property.INHERIT_POSITION).Get(out temp);
+ return temp;
+ });
+ /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty ClippingModeProperty = BindableProperty.Create("ClippingMode", typeof(ClippingModeType), typeof(View), ClippingModeType.Disabled, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var view = (View)bindable;
+ if (newValue != null)
+ {
+ Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.CLIPPING_MODE, new Tizen.NUI.PropertyValue((int)newValue));
+ }
+ },
+ defaultValueCreator:(bindable) =>
+ {
+ var view = (View)bindable;
+ int temp = 0;
+ if (Tizen.NUI.Object.GetProperty(view.swigCPtr, View.Property.CLIPPING_MODE).Get(out temp) == false)
+ {
+ NUILog.Error("ClippingMode get error!");
+ }
+ return (ClippingModeType)temp;
+ });
+ /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty InheritLayoutDirectionProperty = BindableProperty.Create("InheritLayoutDirection", typeof(bool), typeof(View), false, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var view = (View)bindable;
+ if (newValue != null)
+ {
+ Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.INHERIT_LAYOUT_DIRECTION, new Tizen.NUI.PropertyValue((bool)newValue));
+ }
+ },
+ defaultValueCreator:(bindable) =>
+ {
+ var view = (View)bindable;
+ bool temp = false;
+ Tizen.NUI.Object.GetProperty(view.swigCPtr, View.Property.INHERIT_LAYOUT_DIRECTION).Get(out temp);
+ return temp;
+ });
+ /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty LayoutDirectionProperty = BindableProperty.Create("LayoutDirection", typeof(ViewLayoutDirectionType), typeof(View), ViewLayoutDirectionType.LTR, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var view = (View)bindable;
+ if (newValue != null)
+ {
+ Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.LAYOUT_DIRECTION, new Tizen.NUI.PropertyValue((int)newValue));
+ }
+ },
+ defaultValueCreator:(bindable) =>
+ {
+ var view = (View)bindable;
+ int temp;
+ if (false == Tizen.NUI.Object.GetProperty(view.swigCPtr, View.Property.LAYOUT_DIRECTION).Get(out temp))
+ {
+ NUILog.Error("LAYOUT_DIRECTION get error!");
+ }
+ return (ViewLayoutDirectionType)temp;
+ });
+ /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty MarginProperty = BindableProperty.Create("Margin", typeof(Extents), typeof(View), new Extents(0,0,0,0), propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var view = (View)bindable;
+ if (newValue != null)
+ {
+ Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.MARGIN, new Tizen.NUI.PropertyValue((Extents)newValue));
+ }
+ },
+ defaultValueCreator:(bindable) =>
+ {
+ var view = (View)bindable;
+ Extents temp = new Extents(0, 0, 0, 0);
+ Tizen.NUI.Object.GetProperty(view.swigCPtr, View.Property.MARGIN).Get(temp);
+ return temp;
+ });
+ /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty StyleProperty = BindableProperty.Create("Style", typeof(Style), typeof(View), default(Style),
+ propertyChanged: (bindable, oldvalue, newvalue) => ((View)bindable)._mergedStyle.Style = (Style)newvalue);
+
+
private global::System.Runtime.InteropServices.HandleRef swigCPtr;
+ private bool layoutSet = false; // Flag to indicate if SetLayout was called or View was automatically given a Layout
internal View(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.View_SWIGUpcast(cPtr), cMemoryOwn)
{
{
PositionUsesPivotPoint = false;
}
+ _mergedStyle = new MergedStyle(GetType(), this);
}
internal static global::System.Runtime.InteropServices.HandleRef getCPtr(View obj)
return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
}
- // From Container Base class
+ /// <summary>
+ /// Event argument passed through ChildAdded event
+ /// </summary>
+ /// <since_tizen> 5 </since_tizen>
+ /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public class ChildAddedEventArgs : EventArgs
+ {
+ /// <summary>
+ /// Added child View at moment
+ /// </summary>
+ /// <since_tizen> 5 </since_tizen>
+ public View Added { get; set; }
+ }
+
+ /// <summary>
+ /// Event when a child is added
+ /// </summary>
+ /// <since_tizen> 5 </since_tizen>
+ /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public new event EventHandler<ChildAddedEventArgs> ChildAdded;
+ // From Container Base class
/// <summary>
/// Adds a child view to this view.
/// </summary>
/// <since_tizen> 4 </since_tizen>
public override void Add(View child)
{
+ if (null == child)
+ {
+ Tizen.Log.Fatal("NUI", "Child is null");
+ return;
+ }
+
Container oldParent = child.GetParent();
- if(oldParent != this)
+ if (oldParent != this)
{
if (oldParent != null)
{
oldParent.Remove(child);
}
+ else
+ {
+ child.InternalParent = this;
+ }
+
+ if (layoutSet == true && child.Layout == null) // Only give children a layout if parent an explicit container
+ {
+ LayoutItem layoutItem = new LayoutItem();
+ child.Layout = layoutItem;
+ }
+
+ if (Layout)
+ {
+ Layout.LayoutChildren.Add(child.Layout);
+ }
+
NDalicPINVOKE.Actor_Add(swigCPtr, View.getCPtr(child));
if (NDalicPINVOKE.SWIGPendingException.Pending)
throw NDalicPINVOKE.SWIGPendingException.Retrieve();
Children.Add(child);
+
+ if (ChildAdded != null)
+ {
+ ChildAddedEventArgs e = new ChildAddedEventArgs
+ {
+ Added = child
+ };
+ ChildAdded(this, e);
+ }
}
}
/// <summary>
+ /// Event argument passed through ChildRemoved event
+ /// </summary>
+ /// <since_tizen> 5 </since_tizen>
+ /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public class ChildRemovedEventArgs : EventArgs
+ {
+ /// <summary>
+ /// Removed child View at moment
+ /// </summary>
+ /// <since_tizen> 5 </since_tizen>
+ public View Removed { get; set; }
+ }
+
+ /// <summary>
+ /// Event when a child is removed
+ /// </summary>
+ /// <since_tizen> 5 </since_tizen>
+ /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public new event EventHandler<ChildRemovedEventArgs> ChildRemoved;
+
+
+ /// <summary>
/// Removes a child view from this View. If the view was not a child of this view, this is a no-op.
/// </summary>
/// <seealso cref="Container.Remove" />
throw NDalicPINVOKE.SWIGPendingException.Retrieve();
Children.Remove(child);
+ child.InternalParent = null;
+
+ if (Layout)
+ {
+ if(child.Layout)
+ {
+ Layout.LayoutChildren.Remove(child.Layout);
+ }
+ }
+
+ if (ChildRemoved != null)
+ {
+ ChildRemovedEventArgs e = new ChildRemovedEventArgs
+ {
+ Removed = child
+ };
+ ChildRemoved(this, e);
+ }
}
/// <summary>
/// <since_tizen> 4 </since_tizen>
public override Container GetParent()
{
- //to fix memory leak issue, match the handle count with native side.
- IntPtr cPtr = NDalicPINVOKE.Actor_GetParent(swigCPtr);
- HandleRef CPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
- BaseHandle basehandle = Registry.GetManagedBaseHandleFromNativePtr(CPtr.Handle);
- NDalicPINVOKE.delete_BaseHandle(CPtr);
- CPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
-
- if (NDalicPINVOKE.SWIGPendingException.Pending)
- throw NDalicPINVOKE.SWIGPendingException.Retrieve();
-
- return basehandle as Container;
+ return this.InternalParent as Container;
}
internal bool IsTopLevelView()
}
}
-
-
-
-
-
-
// Resource Ready Signal
private EventHandler _resourcesLoadedEventHandler;
public View() : this(NDalicPINVOKE.View_New(), true)
{
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
-
}
internal View(View uiControl) : this(NDalicPINVOKE.new_View__SWIG_1(View.getCPtr(uiControl)), true)
{
{
get
{
- string temp;
- GetProperty(View.Property.STYLE_NAME).Get(out temp);
- return temp;
+ return (string)GetValue(StyleNameProperty);
}
set
{
- SetProperty(View.Property.STYLE_NAME, new Tizen.NUI.PropertyValue(value));
+ SetValue(StyleNameProperty, value);
+ NotifyPropertyChanged();
}
}
{
get
{
- Color backgroundColor = new Color(0.0f, 0.0f, 0.0f, 0.0f);
-
- Tizen.NUI.PropertyMap background = Background;
- int visualType = 0;
- background.Find(Visual.Property.Type)?.Get(out visualType);
- if (visualType == (int)Visual.Type.Color)
- {
- background.Find(ColorVisualProperty.MixColor)?.Get(backgroundColor);
- }
-
- return backgroundColor;
+ return (Color)GetValue(BackgroundColorProperty);
}
set
{
- SetProperty(View.Property.BACKGROUND, new Tizen.NUI.PropertyValue(value));
+ SetValue(BackgroundColorProperty, value);
+ NotifyPropertyChanged();
}
}
{
get
{
- string backgroundImage = "";
-
- Tizen.NUI.PropertyMap background = Background;
- int visualType = 0;
- background.Find(Visual.Property.Type)?.Get(out visualType);
- if (visualType == (int)Visual.Type.Image)
- {
- background.Find(ImageVisualProperty.URL)?.Get(out backgroundImage);
- }
-
- return backgroundImage;
+ return (string)GetValue(BackgroundImageProperty);
}
set
{
- SetProperty(View.Property.BACKGROUND, new Tizen.NUI.PropertyValue(value));
+ SetValue(BackgroundImageProperty, value);
+ NotifyPropertyChanged();
}
}
{
get
{
- Tizen.NUI.PropertyMap temp = new Tizen.NUI.PropertyMap();
- GetProperty(View.Property.BACKGROUND).Get(temp);
- return temp;
+ return (PropertyMap)GetValue(BackgroundProperty);
}
set
{
- SetProperty(View.Property.BACKGROUND, new Tizen.NUI.PropertyValue(value));
+ SetValue(BackgroundProperty, value);
+ NotifyPropertyChanged();
}
}
{
get
{
- int temp = 0;
- if (GetProperty(View.Property.STATE).Get(out temp) == false)
- {
- NUILog.Error("State get error!");
- }
- switch (temp)
- {
- case 0:
- {
- return States.Normal;
- }
- case 1:
- {
- return States.Focused;
- }
- case 2:
- {
- return States.Disabled;
- }
- default:
- {
- return States.Normal;
- }
- }
+ return (States)GetValue(StateProperty);
}
set
{
- SetProperty(View.Property.STATE, new Tizen.NUI.PropertyValue((int)value));
+ SetValue(StateProperty, value);
+ NotifyPropertyChanged();
}
}
{
get
{
- string temp;
- if (GetProperty(View.Property.SUB_STATE).Get(out temp) == false)
- {
- NUILog.Error("subState get error!");
- }
- switch (temp)
- {
- case "NORMAL":
- return States.Normal;
- case "FOCUSED":
- return States.Focused;
- case "DISABLED":
- return States.Disabled;
- default:
- return States.Normal;
- }
+ return (States)GetValue(SubStateProperty);
}
set
{
- string valueToString = "";
- switch (value)
- {
- case States.Normal:
- {
- valueToString = "NORMAL";
- break;
- }
- case States.Focused:
- {
- valueToString = "FOCUSED";
- break;
- }
- case States.Disabled:
- {
- valueToString = "DISABLED";
- break;
- }
- default:
- {
- valueToString = "NORMAL";
- break;
- }
- }
- SetProperty(View.Property.SUB_STATE, new Tizen.NUI.PropertyValue(valueToString));
+ SetValue(SubStateProperty, value);
+ NotifyPropertyChanged();
}
}
{
get
{
- Tizen.NUI.PropertyMap temp = new Tizen.NUI.PropertyMap();
- GetProperty(View.Property.TOOLTIP).Get(temp);
- return temp;
+ return (PropertyMap)GetValue(TooltipProperty);
}
set
{
- SetProperty(View.Property.TOOLTIP, new Tizen.NUI.PropertyValue(value));
+ SetValue(TooltipProperty, value);
+ NotifyPropertyChanged();
}
}
set
{
SetProperty(View.Property.TOOLTIP, new Tizen.NUI.PropertyValue(value));
+ NotifyPropertyChanged();
}
}
{
get
{
- float temp = 0.0f;
- GetProperty(FlexContainer.ChildProperty.FLEX).Get(out temp);
- return temp;
+ return (float)GetValue(FlexProperty);
}
set
{
- SetProperty(FlexContainer.ChildProperty.FLEX, new Tizen.NUI.PropertyValue(value));
+ SetValue(FlexProperty, value);
+ NotifyPropertyChanged();
}
}
{
get
{
- int temp = 0;
- GetProperty(FlexContainer.ChildProperty.ALIGN_SELF).Get(out temp);
- return temp;
+ return (int)GetValue(AlignSelfProperty);
}
set
{
- SetProperty(FlexContainer.ChildProperty.ALIGN_SELF, new Tizen.NUI.PropertyValue(value));
+ SetValue(AlignSelfProperty, value);
+ NotifyPropertyChanged();
}
}
{
get
{
- Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f);
- GetProperty(FlexContainer.ChildProperty.FLEX_MARGIN).Get(temp);
- return temp;
+ return (Vector4)GetValue(FlexMarginProperty);
}
set
{
- SetProperty(FlexContainer.ChildProperty.FLEX_MARGIN, new Tizen.NUI.PropertyValue(value));
+ SetValue(FlexMarginProperty, value);
+ NotifyPropertyChanged();
}
}
{
get
{
- Vector2 temp = new Vector2(0.0f, 0.0f);
- GetProperty(TableView.ChildProperty.CELL_INDEX).Get(temp);
- return temp;
+ return (Vector2)GetValue(CellIndexProperty);
}
set
{
- SetProperty(TableView.ChildProperty.CELL_INDEX, new Tizen.NUI.PropertyValue(value));
+ SetValue(CellIndexProperty, value);
+ NotifyPropertyChanged();
}
}
{
get
{
- float temp = 0.0f;
- GetProperty(TableView.ChildProperty.ROW_SPAN).Get(out temp);
- return temp;
+ return (float)GetValue(RowSpanProperty);
}
set
{
- SetProperty(TableView.ChildProperty.ROW_SPAN, new Tizen.NUI.PropertyValue(value));
+ SetValue(RowSpanProperty, value);
+ NotifyPropertyChanged();
}
}
{
get
{
- float temp = 0.0f;
- GetProperty(TableView.ChildProperty.COLUMN_SPAN).Get(out temp);
- return temp;
+ return (float)GetValue(ColumnSpanProperty);
}
set
{
- SetProperty(TableView.ChildProperty.COLUMN_SPAN, new Tizen.NUI.PropertyValue(value));
+ SetValue(ColumnSpanProperty, value);
+ NotifyPropertyChanged();
}
}
{
get
{
- string temp;
- if (GetProperty(TableView.ChildProperty.CELL_HORIZONTAL_ALIGNMENT).Get(out temp) == false)
- {
- NUILog.Error("CellHorizontalAlignment get error!");
- }
-
- switch (temp)
- {
- case "left":
- return Tizen.NUI.HorizontalAlignmentType.Left;
- case "center":
- return Tizen.NUI.HorizontalAlignmentType.Center;
- case "right":
- return Tizen.NUI.HorizontalAlignmentType.Right;
- default:
- return Tizen.NUI.HorizontalAlignmentType.Left;
- }
+ return (HorizontalAlignmentType)GetValue(CellHorizontalAlignmentProperty);
}
set
{
- string valueToString = "";
- switch (value)
- {
- case Tizen.NUI.HorizontalAlignmentType.Left:
- {
- valueToString = "left";
- break;
- }
- case Tizen.NUI.HorizontalAlignmentType.Center:
- {
- valueToString = "center";
- break;
- }
- case Tizen.NUI.HorizontalAlignmentType.Right:
- {
- valueToString = "right";
- break;
- }
- default:
- {
- valueToString = "left";
- break;
- }
- }
- SetProperty(TableView.ChildProperty.CELL_HORIZONTAL_ALIGNMENT, new Tizen.NUI.PropertyValue(valueToString));
+ SetValue(CellHorizontalAlignmentProperty, value);
+ NotifyPropertyChanged();
}
}
{
get
{
- string temp;
- GetProperty(TableView.ChildProperty.CELL_VERTICAL_ALIGNMENT).Get(out temp);
- {
- NUILog.Error("CellVerticalAlignment get error!");
- }
-
- switch (temp)
- {
- case "top":
- return Tizen.NUI.VerticalAlignmentType.Top;
- case "center":
- return Tizen.NUI.VerticalAlignmentType.Center;
- case "bottom":
- return Tizen.NUI.VerticalAlignmentType.Bottom;
- default:
- return Tizen.NUI.VerticalAlignmentType.Top;
- }
+ return (VerticalAlignmentType)GetValue(CellVerticalAlignmentProperty);
}
set
{
- string valueToString = "";
- switch (value)
- {
- case Tizen.NUI.VerticalAlignmentType.Top:
- {
- valueToString = "top";
- break;
- }
- case Tizen.NUI.VerticalAlignmentType.Center:
- {
- valueToString = "center";
- break;
- }
- case Tizen.NUI.VerticalAlignmentType.Bottom:
- {
- valueToString = "bottom";
- break;
- }
- default:
- {
- valueToString = "top";
- break;
- }
- }
- SetProperty(TableView.ChildProperty.CELL_VERTICAL_ALIGNMENT, new Tizen.NUI.PropertyValue(valueToString));
+ SetValue(CellVerticalAlignmentProperty, value);
+ NotifyPropertyChanged();
}
}
// As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
get
{
- if (LeftFocusableViewId >= 0)
- {
- return ConvertIdToView((uint)LeftFocusableViewId);
- }
- return null;
+ return (View)GetValue(LeftFocusableViewProperty);
}
set
{
- if (value)
- {
- LeftFocusableViewId = (int)value.GetId();
- }
- else
- {
- LeftFocusableViewId = -1;
- }
+ SetValue(LeftFocusableViewProperty, value);
+ NotifyPropertyChanged();
}
}
// As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
get
{
- if (RightFocusableViewId >= 0)
- {
- return ConvertIdToView((uint)RightFocusableViewId);
- }
- return null;
+ return (View)GetValue(RightFocusableViewProperty);
}
set
{
- if (value)
- {
- RightFocusableViewId = (int)value.GetId();
- }
- else
- {
- RightFocusableViewId = -1;
- }
+ SetValue(RightFocusableViewProperty, value);
+ NotifyPropertyChanged();
}
}
// As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
get
{
- if (UpFocusableViewId >= 0)
- {
- return ConvertIdToView((uint)UpFocusableViewId);
- }
- return null;
+ return (View)GetValue(UpFocusableViewProperty);
}
set
{
- if (value)
- {
- UpFocusableViewId = (int)value.GetId();
- }
- else
- {
- UpFocusableViewId = -1;
- }
+ SetValue(UpFocusableViewProperty, value);
+ NotifyPropertyChanged();
}
}
// As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
get
{
- if (DownFocusableViewId >= 0)
- {
- return ConvertIdToView((uint)DownFocusableViewId);
- }
- return null;
+ return (View)GetValue(DownFocusableViewProperty);
}
set
{
- if (value)
- {
- DownFocusableViewId = (int)value.GetId();
- }
- else
- {
- DownFocusableViewId = -1;
- }
+ SetValue(DownFocusableViewProperty, value);
+ NotifyPropertyChanged();
}
}
{
set
{
- SetKeyboardFocusable(value);
+ SetValue(FocusableProperty, value);
+ NotifyPropertyChanged();
}
get
{
- return IsKeyboardFocusable();
+ return (bool)GetValue(FocusableProperty);
}
}
/// This does not interfere with the view's scale factor.<br />
/// The views default depth is the minimum of width and height.<br />
/// </summary>
+ /// <remarks>
+ /// This NUI object (Size2D) typed property can be configured by multiple cascade setting. <br />
+ /// For example, this code ( view.Size2D.Width = 100; view.Size2D.Height = 100; ) is equivalent to this ( view.Size2D = new Size2D(100, 100); ). <br />
+ /// Please note that this multi-cascade setting is especially possible for this NUI object (Size2D). <br />
+ /// This means by default others are impossible so it is recommended that NUI object typed properties are configured by their constructor with parameters. <br />
+ /// For example, this code is working fine : view.Scale = new Vector3( 2.0f, 1.5f, 0.0f); <br />
+ /// but this will not work! : view.Scale.X = 2.0f; view.Scale.Y = 1.5f; <br />
+ /// </remarks>
/// <since_tizen> 3 </since_tizen>
public Size2D Size2D
{
get
{
- Size temp = new Size(0.0f, 0.0f, 0.0f);
- GetProperty(View.Property.SIZE).Get(temp);
- Size2D size = new Size2D((int)temp.Width, (int)temp.Height);
- return size;
+ Size2D temp = (Size2D)GetValue(Size2DProperty);
+ return new Size2D(OnSize2DChanged, temp.Width, temp.Height);
}
set
{
- SetProperty(View.Property.SIZE, new Tizen.NUI.PropertyValue(new Size(value)));
+ SetValue(Size2DProperty, value);
+ SetProperty(LayoutItemWrapper.ChildProperty.WIDTH_SPECIFICATION, new Tizen.NUI.PropertyValue(value.Width));
+ SetProperty(LayoutItemWrapper.ChildProperty.HEIGHT_SPECIFICATION, new Tizen.NUI.PropertyValue(value.Height));
+ NotifyPropertyChanged();
}
}
+ private void OnSize2DChanged(int width, int height)
+ {
+ Size2D = new Size2D(width, height);
+ }
+
/// <summary>
/// Retrieves the size of the view.<br />
/// The coordinates are relative to the view's parent.<br />
{
get
{
- float temp = 0.0f;
- GetProperty(View.Property.OPACITY).Get(out temp);
- return temp;
+ return (float)GetValue(OpacityProperty);
}
set
{
- SetProperty(View.Property.OPACITY, new Tizen.NUI.PropertyValue(value));
+ SetValue(OpacityProperty, value);
+ NotifyPropertyChanged();
}
}
/// By default, sets the position vector between the parent origin and the pivot point (default).<br />
/// If the position inheritance is disabled, sets the world position.<br />
/// </summary>
+ /// <remarks>
+ /// This NUI object (Position2D) typed property can be configured by multiple cascade setting. <br />
+ /// For example, this code ( view.Position2D.X = 100; view.Position2D.Y = 100; ) is equivalent to this ( view.Position2D = new Position2D(100, 100); ). <br />
+ /// Please note that this multi-cascade setting is especially possible for this NUI object (Position2D). <br />
+ /// This means by default others are impossible so it is recommended that NUI object typed properties are configured by their constructor with parameters. <br />
+ /// For example, this code is working fine : view.Scale = new Vector3( 2.0f, 1.5f, 0.0f); <br />
+ /// but this will not work! : view.Scale.X = 2.0f; view.Scale.Y = 1.5f; <br />
+ /// </remarks>
/// <since_tizen> 3 </since_tizen>
public Position2D Position2D
{
get
{
- Position temp = new Position(0.0f, 0.0f, 0.0f);
- GetProperty(View.Property.POSITION).Get(temp);
- return new Position2D(temp);
+ Position2D temp = (Position2D)GetValue(Position2DProperty);
+ return new Position2D(OnPosition2DChanged, temp.X, temp.Y);
}
set
{
- SetProperty(View.Property.POSITION, new Tizen.NUI.PropertyValue(new Position(value)));
+ SetValue(Position2DProperty, value);
+ NotifyPropertyChanged();
}
}
+ private void OnPosition2DChanged(int x, int y)
+ {
+ Position2D = new Position2D(x, y);
+ }
+
/// <summary>
/// Retrieves the screen postion of the view.<br />
/// </summary>
{
get
{
- bool temp = false;
- GetProperty(View.Property.POSITION_USES_ANCHOR_POINT).Get(out temp);
- return temp;
+ return (bool)GetValue(PositionUsesPivotPointProperty);
}
set
{
- SetProperty(View.Property.POSITION_USES_ANCHOR_POINT, new Tizen.NUI.PropertyValue(value));
+ SetValue(PositionUsesPivotPointProperty, value);
+ NotifyPropertyChanged();
}
}
set
{
SetProperty(View.Property.POSITION_USES_ANCHOR_POINT, new Tizen.NUI.PropertyValue(value));
+ NotifyPropertyChanged();
}
}
{
get
{
- var parentChildren = GetParent()?.Children;
- int currentOrder = 0;
- if (parentChildren != null)
- {
- currentOrder = parentChildren.IndexOf(this);
-
- if (currentOrder < 0)
- {
- return 0;
- }
- else if (currentOrder < parentChildren.Count)
- {
- return currentOrder;
- }
- }
-
- return 0;
+ return (int)GetValue(SiblingOrderProperty);
}
set
{
- if(value < 0)
- {
- NUILog.Error("SiblingOrder should be bigger than 0 or equal to 0.");
- return;
- }
- var siblings = GetParent()?.Children;
- if (siblings != null)
- {
- int currentOrder = siblings.IndexOf(this);
- if (value != currentOrder)
- {
- if (value == 0)
- {
- LowerToBottom();
- }
- else if (value < siblings.Count - 1)
- {
- if (value > currentOrder)
- {
- RaiseAbove(siblings[value]);
- }
- else
- {
- LowerBelow(siblings[value]);
- }
- }
- else
- {
- RaiseToTop();
- }
- }
- }
+ SetValue(SiblingOrderProperty, value);
+ NotifyPropertyChanged();
}
}
}
/// <summary>
+ /// Set the layout on this control.
+ /// </summary>
+ /// <remarks>
+ /// </remarks>
+ internal LayoutItem Layout
+ {
+ get
+ {
+ IntPtr cPtr = Tizen.NUI.NDalicManualPINVOKE.GetLayout__SWIG_1(View.getCPtr(this));
+
+ HandleRef CPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
+ BaseHandle basehandle = Registry.GetManagedBaseHandleFromNativePtr(CPtr.Handle);
+ NDalicPINVOKE.delete_BaseHandle(CPtr);
+ CPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
+
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+
+ return basehandle as LayoutItem;
+ }
+ set
+ {
+ Tizen.NUI.NDalicManualPINVOKE.SetLayout__SWIG_1(View.getCPtr(this), LayoutItem.getCPtr(value));
+ value.LayoutChildren.Clear();
+ layoutSet = true;
+ foreach (View view in Children)
+ {
+ value.LayoutChildren.Add(view.Layout);
+ }
+ }
+ }
+
+ /// <summary>
/// Shows the view.
/// </summary>
/// <remarks>
int currentIndex = parentChildren.IndexOf(this);
// If the view is not already the last item in the list.
- if (currentIndex >= 0 && currentIndex < parentChildren.Count -1)
+ if (currentIndex >= 0 && currentIndex < parentChildren.Count - 1)
{
View temp = parentChildren[currentIndex + 1];
parentChildren[currentIndex + 1] = this;
int currentIndex = parentChildren.IndexOf(this);
int targetIndex = parentChildren.IndexOf(target);
- if(currentIndex < 0 || targetIndex < 0 ||
+ if (currentIndex < 0 || targetIndex < 0 ||
currentIndex >= parentChildren.Count || targetIndex >= parentChildren.Count)
{
NUILog.Error("index should be bigger than 0 and less than children of layer count");
{
int currentIndex = parentChildren.IndexOf(this);
int targetIndex = parentChildren.IndexOf(target);
- if(currentIndex < 0 || targetIndex < 0 ||
- currentIndex >= parentChildren.Count ||targetIndex >= parentChildren.Count)
+ if (currentIndex < 0 || targetIndex < 0 ||
+ currentIndex >= parentChildren.Count || targetIndex >= parentChildren.Count)
{
NUILog.Error("index should be bigger than 0 and less than children of layer count");
return;
{
get
{
- Position temp = new Position(0.0f, 0.0f, 0.0f);
- GetProperty(View.Property.PARENT_ORIGIN).Get(temp);
- return temp;
+ return (Position)GetValue(ParentOriginProperty);
}
set
{
- SetProperty(View.Property.PARENT_ORIGIN, new Tizen.NUI.PropertyValue(value));
+ SetValue(ParentOriginProperty, value);
+ NotifyPropertyChanged();
}
}
set
{
SetProperty(View.Property.PARENT_ORIGIN_X, new Tizen.NUI.PropertyValue(value));
+ NotifyPropertyChanged();
}
}
set
{
SetProperty(View.Property.PARENT_ORIGIN_Y, new Tizen.NUI.PropertyValue(value));
+ NotifyPropertyChanged();
}
}
set
{
SetProperty(View.Property.PARENT_ORIGIN_Z, new Tizen.NUI.PropertyValue(value));
+ NotifyPropertyChanged();
}
}
{
get
{
- Position temp = new Position(0.0f, 0.0f, 0.0f);
- GetProperty(View.Property.ANCHOR_POINT).Get(temp);
- return temp;
+ return (Position)GetValue(PivotPointProperty);
}
set
{
- SetProperty(View.Property.ANCHOR_POINT, new Tizen.NUI.PropertyValue(value));
+ SetValue(PivotPointProperty, value);
+ NotifyPropertyChanged();
}
}
{
get
{
- float temp = 0.0f;
- GetProperty(View.Property.SIZE_WIDTH).Get(out temp);
- return temp;
+ return (float)GetValue(SizeWidthProperty);
}
set
{
- SetProperty(View.Property.SIZE_WIDTH, new Tizen.NUI.PropertyValue(value));
+ SetValue(SizeWidthProperty, value);
+ NotifyPropertyChanged();
}
}
{
get
{
- float temp = 0.0f;
- GetProperty(View.Property.SIZE_HEIGHT).Get(out temp);
- return temp;
+ return (float)GetValue(SizeHeightProperty);
}
set
{
- SetProperty(View.Property.SIZE_HEIGHT, new Tizen.NUI.PropertyValue(value));
+ SetValue(SizeHeightProperty, value);
+ NotifyPropertyChanged();
}
}
{
get
{
- Vector3 temp = new Vector3(0.0f, 0.0f, 0.0f);
- GetProperty(View.Property.POSITION).Get(temp);
- return temp;
+ return (Position)GetValue(PositionProperty);
}
set
{
- SetProperty(View.Property.POSITION, new Tizen.NUI.PropertyValue(value));
+ SetValue(PositionProperty, value);
+ NotifyPropertyChanged();
}
}
{
get
{
- float temp = 0.0f;
- GetProperty(View.Property.POSITION_X).Get(out temp);
- return temp;
+ return (float)GetValue(PositionXProperty);
}
set
{
- SetProperty(View.Property.POSITION_X, new Tizen.NUI.PropertyValue(value));
+ SetValue(PositionXProperty, value);
+ NotifyPropertyChanged();
}
}
{
get
{
- float temp = 0.0f;
- GetProperty(View.Property.POSITION_Y).Get(out temp);
- return temp;
+ return (float)GetValue(PositionYProperty);
}
set
{
- SetProperty(View.Property.POSITION_Y, new Tizen.NUI.PropertyValue(value));
+ SetValue(PositionYProperty, value);
+ NotifyPropertyChanged();
}
}
{
get
{
- float temp = 0.0f;
- GetProperty(View.Property.POSITION_Z).Get(out temp);
- return temp;
+ return (float)GetValue(PositionZProperty);
}
set
{
- SetProperty(View.Property.POSITION_Z, new Tizen.NUI.PropertyValue(value));
+ SetValue(PositionZProperty, value);
+ NotifyPropertyChanged();
}
}
{
get
{
- Rotation temp = new Rotation();
- GetProperty(View.Property.ORIENTATION).Get(temp);
- return temp;
+ return (Rotation)GetValue(OrientationProperty);
}
set
{
- SetProperty(View.Property.ORIENTATION, new Tizen.NUI.PropertyValue(value));
+ SetValue(OrientationProperty, value);
+ NotifyPropertyChanged();
}
}
{
get
{
- Vector3 temp = new Vector3(0.0f, 0.0f, 0.0f);
- GetProperty(View.Property.SCALE).Get(temp);
- return temp;
+ return (Vector3)GetValue(ScaleProperty);
}
set
{
- SetProperty(View.Property.SCALE, new Tizen.NUI.PropertyValue(value));
+ SetValue(ScaleProperty, value);
+ NotifyPropertyChanged();
}
}
{
get
{
- float temp = 0.0f;
- GetProperty(View.Property.SCALE_X).Get(out temp);
- return temp;
+ return (float)GetValue(ScaleXProperty);
}
set
{
- SetProperty(View.Property.SCALE_X, new Tizen.NUI.PropertyValue(value));
+ SetValue(ScaleXProperty, value);
+ NotifyPropertyChanged();
}
}
{
get
{
- float temp = 0.0f;
- GetProperty(View.Property.SCALE_Y).Get(out temp);
- return temp;
+ return (float)GetValue(ScaleYProperty);
}
set
{
- SetProperty(View.Property.SCALE_Y, new Tizen.NUI.PropertyValue(value));
+ SetValue(ScaleYProperty, value);
+ NotifyPropertyChanged();
}
}
{
get
{
- float temp = 0.0f;
- GetProperty(View.Property.SCALE_Z).Get(out temp);
- return temp;
+ return (float)GetValue(ScaleZProperty);
}
set
{
- SetProperty(View.Property.SCALE_Z, new Tizen.NUI.PropertyValue(value));
+ SetValue(ScaleZProperty, value);
+ NotifyPropertyChanged();
}
}
{
get
{
- string temp;
- GetProperty(View.Property.NAME).Get(out temp);
- return temp;
+ return (string)GetValue(NameProperty);
}
set
{
- SetProperty(View.Property.NAME, new Tizen.NUI.PropertyValue(value));
+ SetValue(NameProperty, value);
+ NotifyPropertyChanged();
}
}
{
get
{
- bool temp = false;
- GetProperty(View.Property.SENSITIVE).Get(out temp);
- return temp;
+ return (bool)GetValue(SensitiveProperty);
}
set
{
- SetProperty(View.Property.SENSITIVE, new Tizen.NUI.PropertyValue(value));
+ SetValue(SensitiveProperty, value);
+ NotifyPropertyChanged();
}
}
{
get
{
- bool temp = false;
- GetProperty(View.Property.LEAVE_REQUIRED).Get(out temp);
- return temp;
+ return (bool)GetValue(LeaveRequiredProperty);
}
set
{
- SetProperty(View.Property.LEAVE_REQUIRED, new Tizen.NUI.PropertyValue(value));
+ SetValue(LeaveRequiredProperty, value);
+ NotifyPropertyChanged();
}
}
{
get
{
- bool temp = false;
- GetProperty(View.Property.INHERIT_ORIENTATION).Get(out temp);
- return temp;
+ return (bool)GetValue(InheritOrientationProperty);
}
set
{
- SetProperty(View.Property.INHERIT_ORIENTATION, new Tizen.NUI.PropertyValue(value));
+ SetValue(InheritOrientationProperty, value);
+ NotifyPropertyChanged();
}
}
{
get
{
- bool temp = false;
- GetProperty(View.Property.INHERIT_SCALE).Get(out temp);
- return temp;
+ return (bool)GetValue(InheritScaleProperty);
}
set
{
- SetProperty(View.Property.INHERIT_SCALE, new Tizen.NUI.PropertyValue(value));
+ SetValue(InheritScaleProperty, value);
+ NotifyPropertyChanged();
}
}
{
get
{
- string temp;
- if (GetProperty(View.Property.DRAW_MODE).Get(out temp) == false)
- {
- NUILog.Error("DrawMode get error!");
- }
- switch (temp)
- {
- case "NORMAL":
- return DrawModeType.Normal;
- case "OVERLAY_2D":
- return DrawModeType.Overlay2D;
- case "STENCIL":
- return DrawModeType.Stencil;
- default:
- return DrawModeType.Normal;
- }
+ return (DrawModeType)GetValue(DrawModeProperty);
}
set
{
- SetProperty(View.Property.DRAW_MODE, new Tizen.NUI.PropertyValue((int)value));
+ SetValue(DrawModeProperty, value);
+ NotifyPropertyChanged();
}
}
{
get
{
- Vector3 temp = new Vector3(0.0f, 0.0f, 0.0f);
- GetProperty(View.Property.SIZE_MODE_FACTOR).Get(temp);
- return temp;
+ return (Vector3)GetValue(SizeModeFactorProperty);
}
set
{
- SetProperty(View.Property.SIZE_MODE_FACTOR, new Tizen.NUI.PropertyValue(value));
+ SetValue(SizeModeFactorProperty, value);
+ NotifyPropertyChanged();
}
}
{
get
{
- string temp;
- if (GetProperty(View.Property.WIDTH_RESIZE_POLICY).Get(out temp) == false)
- {
- NUILog.Error("WidthResizePolicy get error!");
- }
- switch (temp)
- {
- case "FIXED":
- return ResizePolicyType.Fixed;
- case "USE_NATURAL_SIZE":
- return ResizePolicyType.UseNaturalSize;
- case "FILL_TO_PARENT":
- return ResizePolicyType.FillToParent;
- case "SIZE_RELATIVE_TO_PARENT":
- return ResizePolicyType.SizeRelativeToParent;
- case "SIZE_FIXED_OFFSET_FROM_PARENT":
- return ResizePolicyType.SizeFixedOffsetFromParent;
- case "FIT_TO_CHILDREN":
- return ResizePolicyType.FitToChildren;
- case "DIMENSION_DEPENDENCY":
- return ResizePolicyType.DimensionDependency;
- case "USE_ASSIGNED_SIZE":
- return ResizePolicyType.UseAssignedSize;
- default:
- return ResizePolicyType.Fixed;
- }
+ return (ResizePolicyType)GetValue(WidthResizePolicyProperty);
}
set
{
- SetProperty(View.Property.WIDTH_RESIZE_POLICY, new Tizen.NUI.PropertyValue((int)value));
+ SetValue(WidthResizePolicyProperty, value);
+ NotifyPropertyChanged();
}
}
{
get
{
- string temp;
- if (GetProperty(View.Property.HEIGHT_RESIZE_POLICY).Get(out temp) == false)
- {
- NUILog.Error("HeightResizePolicy get error!");
- }
- switch (temp)
- {
- case "FIXED":
- return ResizePolicyType.Fixed;
- case "USE_NATURAL_SIZE":
- return ResizePolicyType.UseNaturalSize;
- case "FILL_TO_PARENT":
- return ResizePolicyType.FillToParent;
- case "SIZE_RELATIVE_TO_PARENT":
- return ResizePolicyType.SizeRelativeToParent;
- case "SIZE_FIXED_OFFSET_FROM_PARENT":
- return ResizePolicyType.SizeFixedOffsetFromParent;
- case "FIT_TO_CHILDREN":
- return ResizePolicyType.FitToChildren;
- case "DIMENSION_DEPENDENCY":
- return ResizePolicyType.DimensionDependency;
- case "USE_ASSIGNED_SIZE":
- return ResizePolicyType.UseAssignedSize;
- default:
- return ResizePolicyType.Fixed;
- }
+ return (ResizePolicyType)GetValue(HeightResizePolicyProperty);
}
set
{
- SetProperty(View.Property.HEIGHT_RESIZE_POLICY, new Tizen.NUI.PropertyValue((int)value));
+ SetValue(HeightResizePolicyProperty, value);
+ NotifyPropertyChanged();
}
}
{
get
{
- string temp;
- if (GetProperty(View.Property.SIZE_SCALE_POLICY).Get(out temp) == false)
- {
- NUILog.Error("SizeScalePolicy get error!");
- }
- switch (temp)
- {
- case "USE_SIZE_SET":
- return SizeScalePolicyType.UseSizeSet;
- case "FIT_WITH_ASPECT_RATIO":
- return SizeScalePolicyType.FitWithAspectRatio;
- case "FILL_WITH_ASPECT_RATIO":
- return SizeScalePolicyType.FillWithAspectRatio;
- default:
- return SizeScalePolicyType.UseSizeSet;
- }
+ return (SizeScalePolicyType)GetValue(SizeScalePolicyProperty);
}
set
{
- string valueToString = "";
- switch (value)
- {
- case SizeScalePolicyType.UseSizeSet:
- {
- valueToString = "USE_SIZE_SET";
- break;
- }
- case SizeScalePolicyType.FitWithAspectRatio:
- {
- valueToString = "FIT_WITH_ASPECT_RATIO";
- break;
- }
- case SizeScalePolicyType.FillWithAspectRatio:
- {
- valueToString = "FILL_WITH_ASPECT_RATIO";
- break;
- }
- default:
- {
- valueToString = "USE_SIZE_SET";
- break;
- }
- }
- SetProperty(View.Property.SIZE_SCALE_POLICY, new Tizen.NUI.PropertyValue(valueToString));
+ SetValue(SizeScalePolicyProperty, value);
+ NotifyPropertyChanged();
}
}
{
get
{
- bool temp = false;
- GetProperty(View.Property.WIDTH_FOR_HEIGHT).Get(out temp);
- return temp;
+ return (bool)GetValue(WidthForHeightProperty);
}
set
{
- SetProperty(View.Property.WIDTH_FOR_HEIGHT, new Tizen.NUI.PropertyValue(value));
+ SetValue(WidthForHeightProperty, value);
+ NotifyPropertyChanged();
}
}
{
get
{
- bool temp = false;
- GetProperty(View.Property.HEIGHT_FOR_WIDTH).Get(out temp);
- return temp;
+ return (bool)GetValue(HeightForWidthProperty);
}
set
{
- SetProperty(View.Property.HEIGHT_FOR_WIDTH, new Tizen.NUI.PropertyValue(value));
+ SetValue(HeightForWidthProperty, value);
+ NotifyPropertyChanged();
}
}
{
get
{
- Extents temp = new Extents(0, 0, 0, 0);
- GetProperty(View.Property.PADDING).Get(temp);
- return temp;
+ return (Extents)GetValue(PaddingProperty);
}
set
{
- SetProperty(View.Property.PADDING, new Tizen.NUI.PropertyValue(value));
+ SetValue(PaddingProperty, value);
+ NotifyPropertyChanged();
}
}
{
get
{
- Size2D temp = new Size2D(0, 0);
- GetProperty(View.Property.MINIMUM_SIZE).Get(temp);
- return temp;
+ return (Size2D)GetValue(MinimumSizeProperty);
}
set
{
- SetProperty(View.Property.MINIMUM_SIZE, new Tizen.NUI.PropertyValue(value));
+ if (Layout != null)
+ {
+ // Note: it only works if minimum size is >= than natural size.
+ // To force the size it should be done through the width&height spec or Size2D.
+ Layout.MinimumWidth = new Tizen.NUI.LayoutLength(value.Width);
+ Layout.MinimumHeight = new Tizen.NUI.LayoutLength(value.Height);
+ }
+ SetValue(MinimumSizeProperty, value);
+ NotifyPropertyChanged();
}
}
{
get
{
- Size2D temp = new Size2D(0, 0);
- GetProperty(View.Property.MAXIMUM_SIZE).Get(temp);
- return temp;
+ return (Size2D)GetValue(MaximumSizeProperty);
}
set
{
- SetProperty(View.Property.MAXIMUM_SIZE, new Tizen.NUI.PropertyValue(value));
+ // We don't have Layout.Maximum(Width|Height) so we cannot apply it to layout.
+ // MATCH_PARENT spec + parent container size can be used to limit
+ SetValue(MaximumSizeProperty, value);
+ NotifyPropertyChanged();
}
}
{
get
{
- bool temp = false;
- GetProperty(View.Property.INHERIT_POSITION).Get(out temp);
- return temp;
+ return (bool)GetValue(InheritPositionProperty);
}
set
{
- SetProperty(View.Property.INHERIT_POSITION, new Tizen.NUI.PropertyValue(value));
+ SetValue(InheritPositionProperty, value);
+ NotifyPropertyChanged();
}
}
{
get
{
- string temp;
- if (GetProperty(View.Property.CLIPPING_MODE).Get(out temp) == false)
- {
- NUILog.Error("ClippingMode get error!");
- }
- switch (temp)
- {
- case "DISABLED":
- return ClippingModeType.Disabled;
- case "CLIP_CHILDREN":
- return ClippingModeType.ClipChildren;
- case "CLIP_TO_BOUNDING_BOX":
- return ClippingModeType.ClipToBoundingBox;
- default:
- return ClippingModeType.Disabled;
- }
+ return (ClippingModeType)GetValue(ClippingModeProperty);
}
set
{
- SetProperty(View.Property.CLIPPING_MODE, new Tizen.NUI.PropertyValue((int)value));
+ SetValue(ClippingModeProperty, value);
+ NotifyPropertyChanged();
}
}
set
{
SetProperty(View.Property.ANCHOR_POINT, new Tizen.NUI.PropertyValue(value));
+ NotifyPropertyChanged();
}
}
{
get
{
- Size temp = new Size(0.0f, 0.0f, 0.0f);
- GetProperty(View.Property.SIZE).Get(temp);
- return temp;
+ return (Size)GetValue(SizeProperty);
}
set
{
- SetProperty(View.Property.SIZE, new Tizen.NUI.PropertyValue(value));
+ SetValue(SizeProperty, value);
+ NotifyPropertyChanged();
}
}
HandleRef CPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
BaseHandle basehandle = Registry.GetManagedBaseHandleFromNativePtr(CPtr.Handle);
- if (basehandle is Layer)
+ if (basehandle is Layer layer)
{
- ret = new View(cPtr, false);
+ ret = new View(Layer.getCPtr(layer).Handle, false);
NUILog.Error("This Parent property is deprecated, shoud do not be used");
}
else
{
get
{
- bool temp = false;
- GetProperty(View.Property.INHERIT_LAYOUT_DIRECTION).Get(out temp);
- return temp;
+ return (bool)GetValue(InheritLayoutDirectionProperty);
}
set
{
- SetProperty(View.Property.INHERIT_LAYOUT_DIRECTION, new Tizen.NUI.PropertyValue(value));
+ SetValue(InheritLayoutDirectionProperty, value);
+ NotifyPropertyChanged();
}
}
{
get
{
- int temp;
- if (GetProperty(View.Property.LAYOUT_DIRECTION).Get(out temp) == false)
- {
- NUILog.Error("LAYOUT_DIRECTION get error!");
- }
- return (ViewLayoutDirectionType)temp;
+ return (ViewLayoutDirectionType)GetValue(LayoutDirectionProperty);
}
set
{
- SetProperty(View.Property.LAYOUT_DIRECTION, new Tizen.NUI.PropertyValue((int)value));
+ SetValue(LayoutDirectionProperty, value);
+ NotifyPropertyChanged();
}
}
{
get
{
- Extents temp = new Extents(0, 0, 0, 0);
- GetProperty(View.Property.MARGIN).Get(temp);
- return temp;
+ return (Extents)GetValue(MarginProperty);
+ }
+ set
+ {
+ SetValue(MarginProperty, value);
+ NotifyPropertyChanged();
+ }
+ }
+
+ internal Style Style
+ {
+ get
+ {
+ return (Style)GetValue(StyleProperty);
}
set
{
- SetProperty(View.Property.MARGIN, new Tizen.NUI.PropertyValue(value));
+ SetValue(StyleProperty, value);
}
}
set
{
SetProperty(View.Property.PADDING, new Tizen.NUI.PropertyValue(value));
+ NotifyPropertyChanged();
}
}
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
+ internal readonly MergedStyle _mergedStyle;
+
+ /// <summary>
+ /// Child property to specify desired width
+ /// </summary>
+ internal int LayoutWidthSpecificationFixed
+ {
+ get
+ {
+ int tmp = 0;
+ if (GetProperty(LayoutItemWrapper.ChildProperty.WIDTH_SPECIFICATION).Get(out tmp) == false)
+ {
+ NUILog.Error("WidthSpecificationFixed get error!");
+ }
+ return tmp;
+ }
+ set
+ {
+ SetProperty(LayoutItemWrapper.ChildProperty.WIDTH_SPECIFICATION, new Tizen.NUI.PropertyValue(value));
+ }
+ }
+
+ /// <summary>
+ /// Child property to specify desired height
+ /// </summary>
+ internal int LayoutHeightSpecificationFixed
+ {
+ get
+ {
+ int tmp = 0;
+ if (GetProperty(LayoutItemWrapper.ChildProperty.HEIGHT_SPECIFICATION).Get(out tmp) == false)
+ {
+ NUILog.Error("HeightSpecificationFixed get error!");
+ }
+ return tmp;
+ }
+ set
+ {
+ SetProperty(LayoutItemWrapper.ChildProperty.HEIGHT_SPECIFICATION, new Tizen.NUI.PropertyValue(value));
+ }
+ }
+
+ /// <summary>
+ /// Child property to specify desired width, use MatchParent/WrapContent)
+ /// </summary>
+ internal ChildLayoutData LayoutWidthSpecification
+ {
+ get
+ {
+ int tmp = 0;
+ if (GetProperty(LayoutItemWrapper.ChildProperty.WIDTH_SPECIFICATION).Get(out tmp) == false)
+ {
+ NUILog.Error("WidthSpecificationFixed get error!");
+ }
+ return (ChildLayoutData)tmp;
+ }
+ set
+ {
+ SetProperty(LayoutItemWrapper.ChildProperty.WIDTH_SPECIFICATION, new Tizen.NUI.PropertyValue((int)value));
+ }
+ }
+
+ /// <summary>
+ /// Child property to specify desired height, use MatchParent/WrapContent)
+ /// </summary>
+ internal ChildLayoutData LayoutHeightSpecification
+ {
+ get
+ {
+ int tmp = 0;
+ if (GetProperty(LayoutItemWrapper.ChildProperty.HEIGHT_SPECIFICATION).Get(out tmp) == false)
+ {
+ NUILog.Error("HeightSpecificationFixed get error!");
+ }
+ return (ChildLayoutData)tmp;
+ }
+ set
+ {
+ SetProperty(LayoutItemWrapper.ChildProperty.HEIGHT_SPECIFICATION, new Tizen.NUI.PropertyValue((int)value));
+ }
+ }
+
}
/// <summary>
/// <since_tizen> 4 </since_tizen>
RTL
}
+
+ internal enum ChildLayoutData
+ {
+ /// <summary>
+ /// Constant which indicates child size should match parent size
+ /// </summary>
+ MatchParent = -1,
+ /// <summary>
+ /// Constant which indicates parent should take the smallest size possible to wrap it's children with their desired size
+ /// </summary>
+ WrapContent = -2,
+ }
+
}