/*
- * 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 WeightProperty = BindableProperty.Create("Weight", typeof(float), typeof(View), default(float), propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var view = (View)bindable;
+ if (newValue != null)
+ {
+ Tizen.NUI.Object.SetProperty(view.swigCPtr, LinearLayout.ChildProperty.WEIGHT, new Tizen.NUI.PropertyValue((float)newValue));
+ }
+ },
+ defaultValueCreator:(bindable) =>
+ {
+ var view = (View)bindable;
+ float temp = 0.0f;
+ Tizen.NUI.Object.GetProperty(view.swigCPtr, LinearLayout.ChildProperty.WEIGHT).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 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)
{
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
- PositionUsesPivotPoint = false;
+ if (HasBody())
+ {
+ 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 the ChildAdded event.
+ /// </summary>
+ /// <since_tizen> 5 </since_tizen>
+ 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>
+ 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)
{
- NDalicPINVOKE.Actor_Add(swigCPtr, View.getCPtr(child));
- if (NDalicPINVOKE.SWIGPendingException.Pending)
- throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ if (null == child)
+ {
+ Tizen.Log.Fatal("NUI", "Child is null");
+ return;
+ }
- Children.Add(child);
+ Container oldParent = child.GetParent();
+ if (oldParent != this)
+ {
+ if (oldParent != null)
+ {
+ oldParent.Remove(child);
+ }
+ child.InternalParent = this;
+
+ if (layoutSet == true && child.Layout == null) // Only give children a layout if parent an explicit container
+ {
+ if( child.GetType() == typeof(View) || true == child.LayoutingRequired )
+ {
+ child.Layout = new LayoutGroup();
+
+ }
+ else
+ {
+ child.Layout = new 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 the ChildRemoved event.
+ /// </summary>
+ /// <since_tizen> 5 </since_tizen>
+ 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>
+ 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()
{
- IntPtr cPtr = NDalicPINVOKE.Actor_GetParent(swigCPtr);
-
- BaseHandle basehandle = Registry.GetManagedBaseHandleFromNativePtr(cPtr);
-
- if (NDalicPINVOKE.SWIGPendingException.Pending)
- throw NDalicPINVOKE.SWIGPendingException.Retrieve();
-
- return basehandle as Container;
+ return this.InternalParent as Container;
}
internal bool IsTopLevelView()
{
- if(GetParent() is Layer)
+ if (GetParent() is Layer)
{
return true;
}
/// <since_tizen> 3 </since_tizen>
protected override void Dispose(DisposeTypes type)
{
- if(disposed)
+ if (disposed)
{
return;
}
- if(type == DisposeTypes.Explicit)
+ if (type == DisposeTypes.Explicit)
{
//Called by User
//Release your own managed resources here.
//Release your own unmanaged resources here.
//You should not access any managed member here except static instance.
//because the execution order of Finalizes is non-deterministic.
-
- DisConnectFromSignals();
+ if (this != null)
+ {
+ DisConnectFromSignals();
+ }
if (swigCPtr.Handle != global::System.IntPtr.Zero)
{
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
}
+ foreach (View view in Children)
+ {
+ view.InternalParent = null;
+ }
+
base.Dispose(type);
}
private bool OnKeyEvent(IntPtr view, IntPtr keyEvent)
{
+ if (keyEvent == global::System.IntPtr.Zero)
+ {
+ NUILog.Error("keyEvent should not be null!");
+ return true;
+ }
+
KeyEventArgs e = new KeyEventArgs();
bool result = false;
Delegate[] delegateList = _keyEventHandler.GetInvocationList();
// Oring the result of each callback.
- foreach ( EventHandlerWithReturnType<object, KeyEventArgs, bool> del in delegateList )
+ foreach (EventHandlerWithReturnType<object, KeyEventArgs, bool> del in delegateList)
{
- result |= del( this, e );
+ result |= del(this, e);
}
}
// Callback for View TouchSignal
private bool OnTouch(IntPtr view, IntPtr touchData)
{
+ if (touchData == global::System.IntPtr.Zero)
+ {
+ NUILog.Error("touchData should not be null!");
+ return true;
+ }
+
TouchEventArgs e = new TouchEventArgs();
e.Touch = Tizen.NUI.Touch.GetTouchFromPtr(touchData);
// Callback for View Hover signal
private bool OnHoverEvent(IntPtr view, IntPtr hoverEvent)
{
+ if (hoverEvent == global::System.IntPtr.Zero)
+ {
+ NUILog.Error("hoverEvent should not be null!");
+ return true;
+ }
+
HoverEventArgs e = new HoverEventArgs();
e.Hover = Tizen.NUI.Hover.GetHoverFromPtr(hoverEvent);
// Callback for View Wheel signal
private bool OnWheelEvent(IntPtr view, IntPtr wheelEvent)
{
+ if (wheelEvent == global::System.IntPtr.Zero)
+ {
+ NUILog.Error("wheelEvent should not be null!");
+ return true;
+ }
+
WheelEventArgs e = new WheelEventArgs();
e.Wheel = Tizen.NUI.Wheel.GetWheelFromPtr(wheelEvent);
}
}
-
-
-
-
-
-
// Resource Ready Signal
private EventHandler _resourcesLoadedEventHandler;
internal static readonly int SIZE_SCALE_POLICY = NDalicPINVOKE.Actor_Property_SIZE_SCALE_POLICY_get();
internal static readonly int WIDTH_FOR_HEIGHT = NDalicPINVOKE.Actor_Property_WIDTH_FOR_HEIGHT_get();
internal static readonly int HEIGHT_FOR_WIDTH = NDalicPINVOKE.Actor_Property_HEIGHT_FOR_WIDTH_get();
- internal static readonly int PADDING = NDalicPINVOKE.Actor_Property_PADDING_get();
internal static readonly int MINIMUM_SIZE = NDalicPINVOKE.Actor_Property_MINIMUM_SIZE_get();
internal static readonly int MAXIMUM_SIZE = NDalicPINVOKE.Actor_Property_MAXIMUM_SIZE_get();
internal static readonly int INHERIT_POSITION = NDalicPINVOKE.Actor_Property_INHERIT_POSITION_get();
internal static readonly int INHERIT_LAYOUT_DIRECTION = NDalicManualPINVOKE.Actor_Property_INHERIT_LAYOUT_DIRECTION_get();
internal static readonly int LAYOUT_DIRECTION = NDalicManualPINVOKE.Actor_Property_LAYOUT_DIRECTION_get();
internal static readonly int MARGIN = NDalicPINVOKE.View_Property_MARGIN_get();
- internal static readonly int PADDINGEX = NDalicPINVOKE.View_Property_PADDING_get();
+ internal static readonly int PADDING = NDalicPINVOKE.View_Property_PADDING_get();
}
/// <summary>
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)
{
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
- /// <summary>
- /// Downcasts a handle to view handle.<br />
- /// If handle points to a view, the downcast produces a valid handle.<br />
- /// If not, the returned handle is left uninitialized.<br />
- /// </summary>
- /// <param name="handle">A handle to an object.</param>
- /// <returns>A handle to a view or an uninitialized handle.</returns>
- /// <since_tizen> 3 </since_tizen>
- [Obsolete("Please do not use! this will be deprecated, instead please use as keyword.")]
- [EditorBrowsable(EditorBrowsableState.Never)]
- public static View DownCast(BaseHandle handle)
- {
- View ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as View;
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- return ret;
- }
-
- /// <summary>
- /// [Obsolete("Please do not use! this will be deprecated, instead please use as keyword.")]
- /// </summary>
- /// <since_tizen> 3 </since_tizen>
- [Obsolete("Please do not use! this will be deprecated, instead please use as keyword.")]
- [EditorBrowsable(EditorBrowsableState.Never)]
- public static T DownCast<T>(View view) where T : View
- {
- T ret = Registry.GetManagedBaseHandleFromNativePtr(view) as T;
- if (ret != null)
- {
- return ret;
- }
- return null;
- }
-
private View ConvertIdToView(uint id)
{
View view = null;
-
- if (Parent is View)
+ if (GetParent() is View)
{
- View parentView = Parent as View;
+ View parentView = GetParent() as View;
view = parentView.FindChildById(id);
}
{
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();
}
}
/// background visual, creates one with transparent black as it's mixColor.
/// </summary>
/// <since_tizen> 3 </since_tizen>
- public Animation AnimateBackgroundColor( object destinationValue,
+ public Animation AnimateBackgroundColor(object destinationValue,
int startTime,
int endTime,
AlphaFunction.BuiltinFunctions? alphaFunction = null,
{
Tizen.NUI.PropertyMap background = Background;
- if( background.Empty() )
+ if (background.Empty())
{
// If there is no background yet, ensure there is a transparent
// color visual
BackgroundColor = new Color(0.0f, 0.0f, 0.0f, 0.0f);
background = Background;
}
- return AnimateColor( "background", destinationValue, startTime, endTime, alphaFunction, initialValue );
+ return AnimateColor("background", destinationValue, startTime, endTime, alphaFunction, initialValue);
}
/// <summary>
/// Creates an animation to animate the mixColor of the named visual.
/// </summary>
/// <since_tizen> 3 </since_tizen>
- public Animation AnimateColor( string targetVisual, object destinationColor, int startTime, int endTime, AlphaFunction.BuiltinFunctions? alphaFunction = null, object initialColor = null )
+ public Animation AnimateColor(string targetVisual, object destinationColor, int startTime, int endTime, AlphaFunction.BuiltinFunctions? alphaFunction = null, object initialColor = null)
{
Animation animation = null;
{
PropertyMap _animator = new PropertyMap();
- if( alphaFunction != null )
+ if (alphaFunction != null)
{
- _animator.Add("alphaFunction", new PropertyValue( AlphaFunction.BuiltinToPropertyKey(alphaFunction) ) );
+ _animator.Add("alphaFunction", new PropertyValue(AlphaFunction.BuiltinToPropertyKey(alphaFunction)));
}
PropertyMap _timePeriod = new PropertyMap();
- _timePeriod.Add( "duration", new PropertyValue((endTime-startTime)/1000.0f) );
- _timePeriod.Add( "delay", new PropertyValue( startTime/1000.0f ) );
- _animator.Add( "timePeriod", new PropertyValue( _timePeriod ) );
+ _timePeriod.Add("duration", new PropertyValue((endTime - startTime) / 1000.0f));
+ _timePeriod.Add("delay", new PropertyValue(startTime / 1000.0f));
+ _animator.Add("timePeriod", new PropertyValue(_timePeriod));
PropertyMap _transition = new PropertyMap();
- _transition.Add( "animator", new PropertyValue( _animator ) );
- _transition.Add( "target", new PropertyValue( targetVisual ) );
- _transition.Add( "property", new PropertyValue( "mixColor" ) );
+ _transition.Add("animator", new PropertyValue(_animator));
+ _transition.Add("target", new PropertyValue(targetVisual));
+ _transition.Add("property", new PropertyValue("mixColor"));
- if( initialColor != null )
+ if (initialColor != null)
{
- PropertyValue initValue = PropertyValue.CreateFromObject( initialColor );
- _transition.Add( "initialValue", initValue );
+ PropertyValue initValue = PropertyValue.CreateFromObject(initialColor);
+ _transition.Add("initialValue", initValue);
}
- PropertyValue destValue = PropertyValue.CreateFromObject( destinationColor );
- _transition.Add( "targetValue", destValue );
- TransitionData _transitionData = new TransitionData( _transition );
+ PropertyValue destValue = PropertyValue.CreateFromObject(destinationColor);
+ _transition.Add("targetValue", destValue);
+ TransitionData _transitionData = new TransitionData(_transition);
- animation = new Animation( NDalicManualPINVOKE.View_CreateTransition(swigCPtr, TransitionData.getCPtr(_transitionData)), true );
+ animation = new Animation(NDalicManualPINVOKE.View_CreateTransition(swigCPtr, TransitionData.getCPtr(_transitionData)), true);
if (NDalicPINVOKE.SWIGPendingException.Pending)
throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
{
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();
}
}
/// </summary>
/// <since_tizen> 3 </since_tizen>
public States SubState
- {
- 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;
- }
+ {
+ get
+ {
+ 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);
+ // Set Specification so when layouts measure this View it matches the value set here.
+ // All Views are currently Layouts.
+ 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 />
}
/// <summary>
- /// [Obsolete("Please do not use! this will be deprecated. Please use Visibility instead.")]
- /// </summary>
- /// <since_tizen> 3 </since_tizen>
- [Obsolete("Please do not use! this will be deprecated. Please use Visibility instead.")]
- [EditorBrowsable(EditorBrowsableState.Never)]
- public bool Visible
- {
- get
- {
- return IsVisible();
- }
- }
-
- /// <summary>
/// Retrieves and sets the view's opacity.<br />
/// </summary>
/// <since_tizen> 3 </since_tizen>
{
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();
}
}
/// Please do not use! this will be deprecated!
/// Instead please use PositionUsesPivotPoint.
/// <since_tizen> 3 </since_tizen>
- [Obsolete("Please do not use! this will be deprecated, instead please use PositionUsesPivotPoint")]
+ [Obsolete("Please do not use! This will be deprecated! Please use PositionUsesPivotPoint instead! " +
+ "Like: " +
+ "View view = new View(); " +
+ "view.PivotPoint = PivotPoint.Center; " +
+ "view.PositionUsesPivotPoint = true;")]
[EditorBrowsable(EditorBrowsableState.Never)]
public bool PositionUsesAnchorPoint
{
set
{
SetProperty(View.Property.POSITION_USES_ANCHOR_POINT, new Tizen.NUI.PropertyValue(value));
+ NotifyPropertyChanged();
}
}
/// Sets the sibling order of the view so the depth position can be defined within the same parent.
/// </summary>
/// <remarks>
- /// Note the initial value is 0.
+ /// Note the initial value is 0. SiblingOrder should be bigger than 0 or equal to 0.
/// Raise, Lower, RaiseToTop, LowerToBottom, RaiseAbove, and LowerBelow will override the sibling order.
/// The values set by this property will likely change.
/// </remarks>
{
get
{
- int temp = 0;
- GetProperty(View.Property.SIBLING_ORDER).Get(out temp);
- return temp;
+ return (int)GetValue(SiblingOrderProperty);
}
set
{
- SetProperty(View.Property.SIBLING_ORDER, new Tizen.NUI.PropertyValue(value));
+ SetValue(SiblingOrderProperty, value);
+ NotifyPropertyChanged();
}
}
/// <remarks>
/// Deriving classes stipulate the natural size and by default a view has a zero natural size.
/// </remarks>
- /// /// Please do not use! this will be deprecated!
- /// Instead please use NaturalSize2D.
- /// <since_tizen> 3 </since_tizen>
- [Obsolete("Please do not use! this will be deprecated, please use NaturalSize2D instead")]
- [EditorBrowsable(EditorBrowsableState.Never)]
+ /// <since_tizen> 5 </since_tizen>
public Vector3 NaturalSize
{
get
}
/// <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>
+ /// Set that layouting is required on this View. It will automatically receive a Layout.
+ /// </summary>
+ /// <remarks>
+ /// </remarks>
+ internal bool LayoutingRequired
+ {
+ get
+ {
+ bool result = Tizen.NUI.NDalicManualPINVOKE.View_IsLayoutingRequired(View.getCPtr(this));
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ return result;
+ }
+ set
+ {
+ Tizen.NUI.NDalicManualPINVOKE.View_SetLayoutingRequired(View.getCPtr(this), value);
+ }
+ }
+
+ /// <summary>
/// Shows the view.
/// </summary>
/// <remarks>
internal void Raise()
{
- var parentChildren = Parent?.Children;
+ var parentChildren = GetParent()?.Children;
if (parentChildren != null)
{
int currentIndex = parentChildren.IndexOf(this);
// If the view is not already the last item in the list.
- if (currentIndex != parentChildren.Count -1)
+ if (currentIndex >= 0 && currentIndex < parentChildren.Count - 1)
{
View temp = parentChildren[currentIndex + 1];
parentChildren[currentIndex + 1] = this;
parentChildren[currentIndex] = temp;
+
+ NDalicPINVOKE.Raise(swigCPtr);
+ if (NDalicPINVOKE.SWIGPendingException.Pending)
+ throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
}
- NDalicPINVOKE.Raise(swigCPtr);
- if (NDalicPINVOKE.SWIGPendingException.Pending)
- throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
internal void Lower()
{
- var parentChildren = Parent?.Children;
+ var parentChildren = GetParent()?.Children;
if (parentChildren != null)
{
int currentIndex = parentChildren.IndexOf(this);
// If the view is not already the first item in the list.
- if (currentIndex > 0)
+ if (currentIndex > 0 && currentIndex < parentChildren.Count)
{
View temp = parentChildren[currentIndex - 1];
parentChildren[currentIndex - 1] = this;
parentChildren[currentIndex] = temp;
+
+ NDalicPINVOKE.Lower(swigCPtr);
+ if (NDalicPINVOKE.SWIGPendingException.Pending)
+ throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
}
-
- NDalicPINVOKE.Lower(swigCPtr);
- if (NDalicPINVOKE.SWIGPendingException.Pending)
- throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
/// <summary>
/// <since_tizen> 3 </since_tizen>
public void RaiseToTop()
{
- var parentChildren = Parent?.Children;
+ var parentChildren = GetParent()?.Children;
if (parentChildren != null)
{
parentChildren.Remove(this);
parentChildren.Add(this);
+
+ NDalicPINVOKE.RaiseToTop(swigCPtr);
+ if (NDalicPINVOKE.SWIGPendingException.Pending)
+ throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
- NDalicPINVOKE.RaiseToTop(swigCPtr);
- if (NDalicPINVOKE.SWIGPendingException.Pending)
- throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
/// <summary>
/// <since_tizen> 3 </since_tizen>
public void LowerToBottom()
{
- var parentChildren = Parent?.Children;
+ var parentChildren = GetParent()?.Children;
if (parentChildren != null)
{
parentChildren.Remove(this);
parentChildren.Insert(0, this);
- }
- NDalicPINVOKE.LowerToBottom(swigCPtr);
- if (NDalicPINVOKE.SWIGPendingException.Pending)
- throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ NDalicPINVOKE.LowerToBottom(swigCPtr);
+ if (NDalicPINVOKE.SWIGPendingException.Pending)
+ throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ }
}
/// <summary>
/// <param name="target">Will be raised above this view.</param>
internal void RaiseAbove(View target)
{
- var parentChildren = Parent?.Children;
+ var parentChildren = GetParent()?.Children;
if (parentChildren != null)
{
int currentIndex = parentChildren.IndexOf(this);
int targetIndex = parentChildren.IndexOf(target);
+ 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;
+ }
// If the currentIndex is less than the target index and the target has the same parent.
if (currentIndex < targetIndex)
{
parentChildren.Remove(this);
parentChildren.Insert(targetIndex, this);
+
+ NDalicPINVOKE.RaiseAbove(swigCPtr, View.getCPtr(target));
+ if (NDalicPINVOKE.SWIGPendingException.Pending)
+ throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
}
- NDalicPINVOKE.RaiseAbove(swigCPtr, View.getCPtr(target));
- if (NDalicPINVOKE.SWIGPendingException.Pending)
- throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
/// <summary>
/// <param name="target">Will be lowered below this view.</param>
internal void LowerBelow(View target)
{
- var parentChildren = Parent?.Children;
+ var parentChildren = GetParent()?.Children;
if (parentChildren != null)
{
int currentIndex = parentChildren.IndexOf(this);
int targetIndex = parentChildren.IndexOf(target);
+ 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;
+ }
// If the currentIndex is not already the 0th index and the target has the same parent.
if ((currentIndex != 0) && (targetIndex != -1) &&
{
parentChildren.Remove(this);
parentChildren.Insert(targetIndex, this);
+
+ NDalicPINVOKE.LowerBelow(swigCPtr, View.getCPtr(target));
+ if (NDalicPINVOKE.SWIGPendingException.Pending)
+ throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
}
- NDalicPINVOKE.LowerBelow(swigCPtr, View.getCPtr(target));
- if (NDalicPINVOKE.SWIGPendingException.Pending)
- throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
internal string GetName()
}
/// <summary>
- /// Gets the parent layer of this view.If a view has no parent, this method does nothing.
+ /// Gets the parent layer of this view.If a view has no parent, this method does not do anything.
/// </summary>
/// <pre>The view has been initialized. </pre>
- /// <returns>the parent layer of view </returns>
+ /// <returns>The parent layer of view </returns>
/// <since_tizen> 5 </since_tizen>
public Layer GetLayer()
{
+ //to fix memory leak issue, match the handle count with native side.
IntPtr cPtr = NDalicPINVOKE.Actor_GetLayer(swigCPtr);
- Layer ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as Layer;
+ HandleRef CPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
+ Layer ret = Registry.GetManagedBaseHandleFromNativePtr(CPtr.Handle) as Layer;
+ NDalicPINVOKE.delete_BaseHandle(CPtr);
+ CPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
if (NDalicPINVOKE.SWIGPendingException.Pending)
throw NDalicPINVOKE.SWIGPendingException.Retrieve();
/// <since_tizen> 3 </since_tizen>
public View FindChildByName(string viewName)
{
+ //to fix memory leak issue, match the handle count with native side.
IntPtr cPtr = NDalicPINVOKE.Actor_FindChildByName(swigCPtr, viewName);
-
- View ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as View;
+ HandleRef CPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
+ View ret = Registry.GetManagedBaseHandleFromNativePtr(CPtr.Handle) as View;
+ NDalicPINVOKE.delete_BaseHandle(CPtr);
+ CPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
if (NDalicPINVOKE.SWIGPendingException.Pending)
throw NDalicPINVOKE.SWIGPendingException.Retrieve();
internal View FindChildById(uint id)
{
+ //to fix memory leak issue, match the handle count with native side.
IntPtr cPtr = NDalicPINVOKE.Actor_FindChildById(swigCPtr, id);
-
- View ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as View;
+ HandleRef CPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
+ View ret = Registry.GetManagedBaseHandleFromNativePtr(CPtr.Handle) as View;
+ NDalicPINVOKE.delete_BaseHandle(CPtr);
+ CPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
if (NDalicPINVOKE.SWIGPendingException.Pending)
throw NDalicPINVOKE.SWIGPendingException.Retrieve();
/// <since_tizen> 3 </since_tizen>
public Renderer GetRendererAt(uint index)
{
+ //to fix memory leak issue, match the handle count with native side.
IntPtr cPtr = NDalicPINVOKE.Actor_GetRendererAt(swigCPtr, index);
- Renderer ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as Renderer;
+ HandleRef CPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
+ Renderer ret = Registry.GetManagedBaseHandleFromNativePtr(CPtr.Handle) as Renderer;
+ 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 ret;
}
- internal ViewVisibilityChangedSignal VisibilityChangedSignal(View view) {
+ internal ViewVisibilityChangedSignal VisibilityChangedSignal(View view)
+ {
ViewVisibilityChangedSignal ret = new ViewVisibilityChangedSignal(NDalicPINVOKE.VisibilityChangedSignal(View.getCPtr(view)), false);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
- internal ViewLayoutDirectionChangedSignal LayoutDirectionChangedSignal(View view) {
+ internal ViewLayoutDirectionChangedSignal LayoutDirectionChangedSignal(View view)
+ {
ViewLayoutDirectionChangedSignal ret = new ViewLayoutDirectionChangedSignal(NDalicManualPINVOKE.LayoutDirectionChangedSignal(View.getCPtr(view)), false);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
{
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();
}
}
/// <summary>
/// Gets or sets the padding for use in layout.
/// </summary>
- /// <since_tizen> 3 </since_tizen>
- public Vector4 Padding
+ /// <since_tizen> 5 </since_tizen>
+ public Extents Padding
{
get
{
- Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f);
- 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();
}
}
}
}
-
-
/// <summary>
/// [Obsolete("Please do not use! this will be deprecated")]
/// </summary>
/// <since_tizen> 3 </since_tizen>
/// Please do not use! this will be deprecated!
- /// Instead please use TouchEvent.
- [Obsolete("Please do not use! this will be deprecated, instead please use TouchEvent.")]
+ /// Instead please use PivotPoint.
+ [Obsolete("Please do not use! This will be deprecated! Please use PivotPoint instead! " +
+ "Like: " +
+ "View view = new View(); " +
+ "view.PivotPoint = PivotPoint.Center; " +
+ "view.PositionUsesPivotPoint = true;")]
[EditorBrowsable(EditorBrowsableState.Never)]
- public event EventHandlerWithReturnType<object, TouchEventArgs, bool> Touched
+ public Position AnchorPoint
{
- add
+ get
{
- if (_touchDataEventHandler == null)
- {
- _touchDataCallback = OnTouch;
- this.TouchSignal().Connect(_touchDataCallback);
- }
-
- _touchDataEventHandler += value;
+ Position temp = new Position(0.0f, 0.0f, 0.0f);
+ GetProperty(View.Property.ANCHOR_POINT).Get(temp);
+ return temp;
}
-
- remove
+ set
{
- _touchDataEventHandler -= value;
-
- if (_touchDataEventHandler == null && TouchSignal().Empty() == false)
- {
- this.TouchSignal().Disconnect(_touchDataCallback);
- }
-
+ SetProperty(View.Property.ANCHOR_POINT, new Tizen.NUI.PropertyValue(value));
+ NotifyPropertyChanged();
}
}
/// <summary>
- /// [Obsolete("Please do not use! this will be deprecated")]
+ /// Sets the size of a view for the width, the height and the depth.<br />
+ /// Geometry can be scaled to fit within this area.<br />
+ /// This does not interfere with the view's scale factor.<br />
+ /// The views default depth is the minimum of width and height.<br />
/// </summary>
- /// <since_tizen> 3 </since_tizen>
- /// Please do not use! this will be deprecated!
- /// Instead please use HoverEvent.
- [Obsolete("Please do not use! this will be deprecated, instead please use HoverEvent.")]
- [EditorBrowsable(EditorBrowsableState.Never)]
- public event EventHandlerWithReturnType<object, HoverEventArgs, bool> Hovered
+ /// <remarks>
+ /// Please note that multi-cascade setting is not possible for this NUI object. <br />
+ /// It is recommended that NUI object typed properties are configured by their constructor with parameters. <br />
+ /// For example, this code is working fine : view.Size = new Size( 1.0f, 1.0f, 0.0f); <br />
+ /// but this will not work! : view.Size.Width = 2.0f; view.Size.Height = 2.0f; <br />
+ /// </remarks>
+ /// <since_tizen> 5 </since_tizen>
+ public Size Size
{
- add
+ get
{
- if (_hoverEventHandler == null)
- {
- _hoverEventCallback = OnHoverEvent;
- this.HoveredSignal().Connect(_hoverEventCallback);
- }
-
- _hoverEventHandler += value;
+ return (Size)GetValue(SizeProperty);
}
-
- remove
+ set
{
- _hoverEventHandler -= value;
-
- if (_hoverEventHandler == null && HoveredSignal().Empty() == false)
- {
- this.HoveredSignal().Disconnect(_hoverEventCallback);
- }
-
+ SetValue(SizeProperty, value);
+ NotifyPropertyChanged();
}
}
/// <summary>
- /// Please do not use! this will be deprecated.
+ /// "Please DO NOT use! This will be deprecated! Please use 'Container GetParent() for derived class' instead!"
/// </summary>
/// <since_tizen> 3 </since_tizen>
- /// Please do not use! this will be deprecated!
- /// Instead please use WheelEvent.
- [Obsolete("Please do not use! this will be deprecated, instead please use WheelEvent.")]
+ [Obsolete("Please do not use! This will be deprecated! Please use 'Container GetParent() for derived class' instead! " +
+ "Like: " +
+ "Container parent = view.GetParent(); " +
+ "View view = parent as View;")]
[EditorBrowsable(EditorBrowsableState.Never)]
- public event EventHandlerWithReturnType<object, WheelEventArgs, bool> WheelMoved
+ public new View Parent
{
- add
+ get
{
- if (_wheelEventHandler == null)
+ View ret;
+ IntPtr cPtr = NDalicPINVOKE.Actor_GetParent(swigCPtr);
+ HandleRef CPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
+ BaseHandle basehandle = Registry.GetManagedBaseHandleFromNativePtr(CPtr.Handle);
+
+ if (basehandle is Layer layer)
{
- _wheelEventCallback = OnWheelEvent;
- this.WheelEventSignal().Connect(_wheelEventCallback);
+ ret = new View(Layer.getCPtr(layer).Handle, false);
+ NUILog.Error("This Parent property is deprecated, shoud do not be used");
}
-
- _wheelEventHandler += value;
- }
-
- remove
- {
- _wheelEventHandler -= value;
-
- if (_wheelEventHandler == null && WheelEventSignal().Empty() == false)
+ else
{
- this.WheelEventSignal().Disconnect(_wheelEventCallback);
+ ret = basehandle as View;
}
+ 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 ret;
}
}
/// <summary>
- /// [Obsolete("Please do not use! this will be deprecated")]
+ /// Gets/Sets whether inherit parent's the layout Direction.
/// </summary>
- /// <since_tizen> 3 </since_tizen>
- /// Please do not use! this will be deprecated!
- /// Instead please use PivotPoint.
- [Obsolete("Please do not use! this will be deprecated, instead please use PivotPoint")]
- [EditorBrowsable(EditorBrowsableState.Never)]
- public Position AnchorPoint
+ /// <since_tizen> 4 </since_tizen>
+ public bool InheritLayoutDirection
{
get
{
- Position temp = new Position(0.0f, 0.0f, 0.0f);
- GetProperty(View.Property.ANCHOR_POINT).Get(temp);
- return temp;
+ return (bool)GetValue(InheritLayoutDirectionProperty);
}
set
{
- SetProperty(View.Property.ANCHOR_POINT, new Tizen.NUI.PropertyValue(value));
+ SetValue(InheritLayoutDirectionProperty, value);
+ NotifyPropertyChanged();
}
}
/// <summary>
- /// [Obsolete("Please do not use! this will be deprecated")]
+ /// Gets/Sets the layout Direction.
/// </summary>
- /// <since_tizen> 3 </since_tizen>
- [Obsolete("Please do not use! this will be deprecated, please use Size2D instead")]
- [EditorBrowsable(EditorBrowsableState.Never)]
- public Size Size
+ /// <since_tizen> 4 </since_tizen>
+ public ViewLayoutDirectionType LayoutDirection
{
get
{
- Size temp = new Size(0.0f, 0.0f, 0.0f);
- GetProperty(View.Property.SIZE).Get(temp);
- return temp;
+ return (ViewLayoutDirectionType)GetValue(LayoutDirectionProperty);
}
set
{
- SetProperty(View.Property.SIZE, new Tizen.NUI.PropertyValue(value));
+ SetValue(LayoutDirectionProperty, value);
+ NotifyPropertyChanged();
}
}
/// <summary>
- /// [Obsolete("Please do not use! this will be deprecated")]
+ /// Gets or sets the Margin for use in layout.
/// </summary>
- /// <since_tizen> 3 </since_tizen>
- /// Please do not use! this will be deprecated!
- /// Instead please use AddedToWindow.
- [Obsolete("Please do not use! this will be deprecated, instead please use AddedToWindow")]
- [EditorBrowsable(EditorBrowsableState.Never)]
- public event EventHandler OnWindowEvent
+ /// <remarks>
+ /// Margin property is supported by Layout algorithms and containers.
+ /// Please Set Layout if you want to use Margin property.
+ /// </remarks>
+ /// <since_tizen> 4 </since_tizen>
+ public Extents Margin
{
- add
+ get
{
- if (_onWindowEventHandler == null)
- {
- _onWindowEventCallback = OnWindow;
- this.OnWindowSignal().Connect(_onWindowEventCallback);
- }
-
- _onWindowEventHandler += value;
+ return (Extents)GetValue(MarginProperty);
}
-
- remove
+ set
{
- _onWindowEventHandler -= value;
-
- if (_onWindowEventHandler == null && OnWindowSignal().Empty() == false)
- {
- this.OnWindowSignal().Disconnect(_onWindowEventCallback);
- }
+ SetValue(MarginProperty, value);
+ NotifyPropertyChanged();
}
}
- /// <summary>
- /// [Obsolete("Please do not use! this will be deprecated")]
- /// </summary>
- /// <since_tizen> 3 </since_tizen>
- /// Please do not use! this will be deprecated!
- /// Instead please use RemovedFromWindow.
- [Obsolete("Please do not use! this will be deprecated, instead please use RemovedFromWindow")]
- [EditorBrowsable(EditorBrowsableState.Never)]
- public event EventHandler OffWindowEvent
+ internal Style Style
{
- add
+ get
{
- if (_offWindowEventHandler == null)
- {
- _offWindowEventCallback = OffWindow;
- this.OffWindowSignal().Connect(_offWindowEventCallback);
- }
-
- _offWindowEventHandler += value;
+ return (Style)GetValue(StyleProperty);
}
-
- remove
+ set
{
- _offWindowEventHandler -= value;
-
- if (_offWindowEventHandler == null && OffWindowSignal().Empty() == false)
- {
- this.OffWindowSignal().Disconnect(_offWindowEventCallback);
- }
+ SetValue(StyleProperty, value);
}
}
/// <summary>
/// [Obsolete("Please do not use! this will be deprecated")]
/// </summary>
- /// <since_tizen> 3 </since_tizen>
/// Please do not use! this will be deprecated!
- /// Instead please use Relayout.
- [Obsolete("Please do not use! this will be deprecated, instead please use Relayout")]
+ /// Instead please use Padding.
+ /// <since_tizen> 4 </since_tizen>
+ [Obsolete("Please do not use! this will be deprecated, instead please use Padding.")]
[EditorBrowsable(EditorBrowsableState.Never)]
- public event EventHandler OnRelayoutEvent
+ public Extents PaddingEX
{
- add
+ get
{
- if (_onRelayoutEventHandler == null)
- {
- _onRelayoutEventCallback = OnRelayout;
- this.OnRelayoutSignal().Connect(_onRelayoutEventCallback);
- }
-
- _onRelayoutEventHandler += value;
+ Extents temp = new Extents(0, 0, 0, 0);
+ GetProperty(View.Property.PADDING).Get(temp);
+ return temp;
}
-
- remove
+ set
{
- _onRelayoutEventHandler -= value;
-
- if (_onRelayoutEventHandler == null && OnRelayoutSignal().Empty() == false)
- {
- this.OnRelayoutSignal().Disconnect(_onRelayoutEventCallback);
- }
-
+ SetProperty(View.Property.PADDING, new Tizen.NUI.PropertyValue(value));
+ NotifyPropertyChanged();
}
}
/// <summary>
- /// "Please DO NOT use! This will be deprecated! Please use 'Container GetParent() for derived class' instead!"
+ /// Perform an action on a visual registered to this view. <br />
+ /// Visuals will have actions. This API is used to perform one of these actions with the given attributes.
/// </summary>
- /// <since_tizen> 3 </since_tizen>
- [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
- public new View Parent
+ /// <param name="propertyIndexOfVisual">The Property index of the visual.</param>
+ /// <param name="propertyIndexOfActionId">The action to perform. See Visual to find the supported actions.</param>
+ /// <param name="attributes">Optional attributes for the action.</param>
+ /// <since_tizen> 5 </since_tizen>
+ public void DoAction(int propertyIndexOfVisual, int propertyIndexOfActionId, PropertyValue attributes)
{
- get
- {
- View ret;
- IntPtr cPtr = NDalicPINVOKE.Actor_GetParent(swigCPtr);
+ NDalicManualPINVOKE.View_DoAction(swigCPtr, propertyIndexOfVisual, propertyIndexOfActionId, PropertyValue.getCPtr(attributes));
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ }
- BaseHandle basehandle = Registry.GetManagedBaseHandleFromNativePtr(cPtr);
+ internal readonly MergedStyle _mergedStyle;
- if (basehandle is Layer)
- {
- ret = new View(cPtr, false);
- }
- else
+ /// <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)
{
- ret = basehandle as View;
+ NUILog.Error("WidthSpecificationFixed get error!");
}
-
- if (NDalicPINVOKE.SWIGPendingException.Pending)
- throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- return ret;
+ return tmp;
+ }
+ set
+ {
+ SetProperty(LayoutItemWrapper.ChildProperty.WIDTH_SPECIFICATION, new Tizen.NUI.PropertyValue(value));
}
}
/// <summary>
- /// Gets/Sets whether inherit parent's the layout Direction.
+ /// Child property to specify desired height
/// </summary>
- /// <since_tizen> 4 </since_tizen>
- public bool InheritLayoutDirection
+ internal int LayoutHeightSpecificationFixed
{
get
{
- bool temp = false;
- GetProperty(View.Property.INHERIT_LAYOUT_DIRECTION).Get(out temp);
- return temp;
+ int tmp = 0;
+ if (GetProperty(LayoutItemWrapper.ChildProperty.HEIGHT_SPECIFICATION).Get(out tmp) == false)
+ {
+ NUILog.Error("HeightSpecificationFixed get error!");
+ }
+ return tmp;
}
set
{
- SetProperty(View.Property.INHERIT_LAYOUT_DIRECTION, new Tizen.NUI.PropertyValue(value));
+ SetProperty(LayoutItemWrapper.ChildProperty.HEIGHT_SPECIFICATION, new Tizen.NUI.PropertyValue(value));
}
}
/// <summary>
- /// Gets/Sets the layout Direction.
+ /// Child property to specify desired width, use MatchParent/WrapContent)
/// </summary>
- /// <since_tizen> 4 </since_tizen>
- public ViewLayoutDirectionType LayoutDirection
+ internal ChildLayoutData LayoutWidthSpecification
{
get
{
- int temp;
- if (GetProperty(View.Property.LAYOUT_DIRECTION).Get(out temp) == false)
+ int tmp = 0;
+ if (GetProperty(LayoutItemWrapper.ChildProperty.WIDTH_SPECIFICATION).Get(out tmp) == false)
{
- NUILog.Error("LAYOUT_DIRECTION get error!");
+ NUILog.Error("WidthSpecificationFixed get error!");
}
- return (ViewLayoutDirectionType)temp;
+ return (ChildLayoutData)tmp;
}
set
{
- SetProperty(View.Property.LAYOUT_DIRECTION, new Tizen.NUI.PropertyValue((int)value));
+ SetProperty(LayoutItemWrapper.ChildProperty.WIDTH_SPECIFICATION, new Tizen.NUI.PropertyValue((int)value));
}
}
/// <summary>
- /// Gets or sets the Margin for use in layout.
+ /// Child property to specify desired height, use MatchParent/WrapContent)
/// </summary>
- /// <since_tizen> 4 </since_tizen>
- public Extents Margin
+ internal ChildLayoutData LayoutHeightSpecification
{
get
{
- Extents temp = new Extents(0, 0, 0, 0);
- GetProperty(View.Property.MARGIN).Get(temp);
- return temp;
+ int tmp = 0;
+ if (GetProperty(LayoutItemWrapper.ChildProperty.HEIGHT_SPECIFICATION).Get(out tmp) == false)
+ {
+ NUILog.Error("HeightSpecificationFixed get error!");
+ }
+ return (ChildLayoutData)tmp;
}
set
{
- SetProperty(View.Property.MARGIN, new Tizen.NUI.PropertyValue(value));
+ SetProperty(LayoutItemWrapper.ChildProperty.HEIGHT_SPECIFICATION, new Tizen.NUI.PropertyValue((int)value));
}
}
- /// <summary>
- /// Gets or sets the Padding for use in layout.
- /// </summary>
- /// <since_tizen> 4 </since_tizen>
- public Extents PaddingEX
+ internal float Weight
{
get
{
- Extents temp = new Extents(0, 0, 0, 0);
- GetProperty(View.Property.PADDINGEX).Get(temp);
- return temp;
+ return (float)GetValue(WeightProperty);
}
set
{
- SetProperty(View.Property.PADDINGEX, new Tizen.NUI.PropertyValue(value));
+ SetValue(WeightProperty, value);
+ NotifyPropertyChanged();
}
}
+
}
/// <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,
+ }
+
}