X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2FTizen.NUI%2Fsrc%2Fpublic%2FBaseComponents%2FView.cs;h=a319f4fe476cd85d34cd45c808840c45c8462520;hb=f986b55ea4398d0ce6467fd9e4cad8c0e73823fe;hp=feed4476be2c680690ceb0690049c51a88a0dbb4;hpb=c44dbadd704faf86d672c31949cdce6489cde24c;p=platform%2Fcore%2Fcsapi%2Ftizenfx.git
diff --git a/src/Tizen.NUI/src/public/BaseComponents/View.cs b/src/Tizen.NUI/src/public/BaseComponents/View.cs
index feed447..a319f4f 100755
--- a/src/Tizen.NUI/src/public/BaseComponents/View.cs
+++ b/src/Tizen.NUI/src/public/BaseComponents/View.cs
@@ -17,5878 +17,2019 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
-using System.IO;
using System.Runtime.InteropServices;
using Tizen.NUI.Binding;
-using Tizen.NUI.Xaml;
namespace Tizen.NUI.BaseComponents
{
///
- /// The View layout Direction type.
+ /// View is the base class for all views.
///
- /// 4
- public enum ViewLayoutDirectionType
+ /// 3
+ public partial class View : Container, IResourcesProvider
{
///
- /// Left to right.
- ///
- /// 4
- LTR,
- ///
- /// Right to left.
+ /// Flag to indicate if layout set explicitly via API call or View was automatically given a Layout.
///
- /// 4
- RTL
- }
+ /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public bool layoutSet = false;
- ///
- /// [Draft] Available policies for layout parameters
- ///
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
- public static class LayoutParamPolicies
- {
- ///
- /// Constant which indicates child size should match parent size
- ///
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
- public const int MatchParent = -1;
///
- /// Constant which indicates parent should take the smallest size possible to wrap it's children with their desired size
+ /// Flag to allow Layouting to be disabled for Views.
+ /// Once a View has a Layout set then any children added to Views from then on will receive
+ /// automatic Layouts.
///
/// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- public const int WrapContent = -2;
- }
+ public static bool layoutingDisabled{get; set;} = true;
+
+ private global::System.Runtime.InteropServices.HandleRef swigCPtr;
+ private LayoutItem _layout; // Exclusive layout assigned to this View.
+
+ // List of transitions paired with the condition that uses the transition.
+ private Dictionary _layoutTransitions;
+ private int _widthPolicy = LayoutParamPolicies.WrapContent; // Layout width policy
+ private int _heightPolicy = LayoutParamPolicies.WrapContent; // Layout height policy
+ private float _weight = 0.0f; // Weighting of child View in a Layout
+ private MeasureSpecification _measureSpecificationWidth; // Layout width and internal Mode
+ private MeasureSpecification _measureSpecificationHeight; // Layout height and internal Mode
+ private bool _backgroundImageSynchronosLoading = false;
+ private Dictionary transDictionary = new Dictionary();
+ private string[] transitionNames;
- ///
- /// [Draft] Replaced by LayoutParamPolicies, will be removed once occurrences replaced.
- ///
- internal enum ChildLayoutData
- {
///
- /// Constant which indicates child size should match parent size
+ /// Creates a new instance of a view.
///
- MatchParent = LayoutParamPolicies.MatchParent,
+ /// 3
+ public View() : this(Interop.View.View_New(), true)
+ {
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ }
+
///
- /// Constant which indicates parent should take the smallest size possible to wrap it's children with their desired size
+ /// Create a new instance of a View with setting the status of shown or hidden.
///
- WrapContent = LayoutParamPolicies.WrapContent,
- }
-
- internal enum ResourceLoadingStatusType
- {
- Invalid = -1,
- Preparing = 0,
- Ready,
- Failed,
- }
-
- ///
- /// View is the base class for all views.
- ///
- /// 3
- [ContentProperty("Children")]
- 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.
+ /// false : Not displayed (hidden), true : displayed (shown)
+ /// This will be public opened in next release of tizen after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI).
[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) =>
+ public View(bool shown) : this(Interop.View.View_New(), true)
{
- 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), null, propertyChanged: (bindable, oldValue, newValue) =>
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ SetVisible(shown);
+ }
+
+ internal View(View uiControl, bool shown = true) : this(Interop.View.new_View__SWIG_1(View.getCPtr(uiControl)), true)
{
- var view = (View)bindable;
- if (newValue != null)
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ if(!shown)
{
- Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.BACKGROUND, new Tizen.NUI.PropertyValue((Color)newValue));
+ SetVisible(false);
}
- },
- 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)
+ internal View(global::System.IntPtr cPtr, bool cMemoryOwn, bool shown = true) : base(Interop.View.View_SWIGUpcast(cPtr), cMemoryOwn)
+ {
+ swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
+ if (HasBody())
{
- background.Find(ColorVisualProperty.MixColor)?.Get(backgroundColor);
+ PositionUsesPivotPoint = false;
}
- 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)
+ _onWindowSendEventCallback = SendViewAddedEventToWindow;
+ this.OnWindowSignal().Connect(_onWindowSendEventCallback);
+
+ if (!shown)
{
- Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.BACKGROUND, new Tizen.NUI.PropertyValue((string)newValue));
+ SetVisible(false);
}
- },
- defaultValueCreator: (bindable) =>
+ }
+
+ internal View(ViewImpl implementation, bool shown = true) : this(Interop.View.new_View__SWIG_2(ViewImpl.getCPtr(implementation)), true)
{
- var view = (View)bindable;
- string backgroundImage = "";
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- Tizen.NUI.PropertyMap background = view.Background;
- int visualType = 0;
- background.Find(Visual.Property.Type)?.Get(out visualType);
- if (visualType == (int)Visual.Type.Image)
+ if (!shown)
{
- background.Find(ImageVisualProperty.URL)?.Get(out backgroundImage);
+ SetVisible(false);
}
+ }
- 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), null, propertyChanged: (bindable, oldValue, newValue) =>
+ public bool IsResourcesCreated
{
- var view = (View)bindable;
- if (newValue != null)
+ get
{
- Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.BACKGROUND, new Tizen.NUI.PropertyValue((PropertyMap)newValue));
+ return Application.Current.IsResourcesCreated;
}
- },
- 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) =>
+ public ResourceDictionary XamlResources
{
- var view = (View)bindable;
- if (newValue != null)
+ get
{
- Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.STATE, new Tizen.NUI.PropertyValue((int)newValue));
+ return Application.Current.XamlResources;
}
- },
- defaultValueCreator: (bindable) =>
- {
- var view = (View)bindable;
- int temp = 0;
- if (Tizen.NUI.Object.GetProperty(view.swigCPtr, View.Property.STATE).Get(out temp) == false)
+ set
{
- NUILog.Error("State get error!");
+ Application.Current.XamlResources = value;
}
- switch (temp)
+ }
+
+ ///
+ /// The StyleName, type string.
+ ///
+ /// 3
+ public string StyleName
+ {
+ get
{
- case 0: return States.Normal;
- case 1: return States.Focused;
- case 2: return States.Disabled;
- default: return States.Normal;
+ return (string)GetValue(StyleNameProperty);
}
- });
- /// 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)
+ set
{
- 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));
+ SetValue(StyleNameProperty, value);
+ NotifyPropertyChanged();
}
- },
- defaultValueCreator: (bindable) =>
+ }
+
+ ///
+ /// The mutually exclusive with "backgroundImage" and "background" type Vector4.
+ ///
+ /// 3
+ public Color BackgroundColor
{
- var view = (View)bindable;
- string temp;
- if (Tizen.NUI.Object.GetProperty(view.swigCPtr, View.Property.SUB_STATE).Get(out temp) == false)
+ get
{
- NUILog.Error("subState get error!");
+ return (Color)GetValue(BackgroundColorProperty);
}
- switch (temp)
+ set
{
- case "NORMAL": return States.Normal;
- case "FOCUSED": return States.Focused;
- case "DISABLED": return States.Disabled;
- default: return States.Normal;
+ SetValue(BackgroundColorProperty, value);
+ NotifyPropertyChanged();
}
- });
- /// 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), null, propertyChanged: (bindable, oldValue, newValue) =>
+ }
+
+ ///
+ /// The mutually exclusive with "backgroundColor" and "background" type Map.
+ ///
+ /// 3
+ public string BackgroundImage
{
- var view = (View)bindable;
- if (newValue != null)
+ get
{
- Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.TOOLTIP, new Tizen.NUI.PropertyValue((PropertyMap)newValue));
+ return (string)GetValue(BackgroundImageProperty);
}
- },
- 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;
- });
-
- /// Only for XAML property binding. This will be changed as Inhouse API by ACR later.
- 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)
+ set
{
- Tizen.NUI.Object.SetProperty(view.swigCPtr, FlexContainer.ChildProperty.FLEX, new Tizen.NUI.PropertyValue((float)newValue));
+ SetValue(BackgroundImageProperty, value);
+ NotifyPropertyChanged();
}
- },
- 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) =>
+ ///
+ /// The background of view.
+ ///
+ /// 3
+ public Tizen.NUI.PropertyMap Background
{
- var view = (View)bindable;
- if (newValue != null)
+ get
{
- Tizen.NUI.Object.SetProperty(view.swigCPtr, FlexContainer.ChildProperty.ALIGN_SELF, new Tizen.NUI.PropertyValue((int)newValue));
+ return (PropertyMap)GetValue(BackgroundProperty);
}
- },
- 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), null, propertyChanged: (bindable, oldValue, newValue) =>
- {
- var view = (View)bindable;
- if (newValue != null)
+ set
{
- Tizen.NUI.Object.SetProperty(view.swigCPtr, FlexContainer.ChildProperty.FLEX_MARGIN, new Tizen.NUI.PropertyValue((Vector4)newValue));
+ SetValue(BackgroundProperty, value);
+ NotifyPropertyChanged();
}
- },
- 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), null, propertyChanged: (bindable, oldValue, newValue) =>
+ }
+
+ ///
+ /// The current state of the view.
+ ///
+ /// 3
+ public States State
{
- var view = (View)bindable;
- if (newValue != null)
+ get
{
- Tizen.NUI.Object.SetProperty(view.swigCPtr, TableView.ChildProperty.CELL_INDEX, new Tizen.NUI.PropertyValue((Vector2)newValue));
+ return (States)GetValue(StateProperty);
}
- },
- 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)
+ set
{
- Tizen.NUI.Object.SetProperty(view.swigCPtr, TableView.ChildProperty.ROW_SPAN, new Tizen.NUI.PropertyValue((float)newValue));
+ SetValue(StateProperty, value);
+ NotifyPropertyChanged();
}
- },
- 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) =>
+ }
+
+ ///
+ /// The current sub state of the view.
+ ///
+ /// 3
+ public States SubState
{
- var view = (View)bindable;
- if (newValue != null)
+ get
{
- Tizen.NUI.Object.SetProperty(view.swigCPtr, TableView.ChildProperty.COLUMN_SPAN, new Tizen.NUI.PropertyValue((float)newValue));
+ return (States)GetValue(SubStateProperty);
}
- },
- 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)
+ set
{
- 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));
+ SetValue(SubStateProperty, value);
+ NotifyPropertyChanged();
}
- },
- defaultValueCreator: (bindable) =>
+ }
+
+ ///
+ /// Displays a tooltip
+ ///
+ /// 3
+ public Tizen.NUI.PropertyMap Tooltip
{
- var view = (View)bindable;
- string temp;
- if (Tizen.NUI.Object.GetProperty(view.swigCPtr, TableView.ChildProperty.CELL_HORIZONTAL_ALIGNMENT).Get(out temp) == false)
+ get
{
- NUILog.Error("CellHorizontalAlignment get error!");
+ return (PropertyMap)GetValue(TooltipProperty);
}
-
- switch (temp)
+ set
{
- 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;
+ SetValue(TooltipProperty, value);
+ NotifyPropertyChanged();
}
- });
- /// 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)
+ ///
+ /// Displays a tooltip as a text.
+ ///
+ /// 3
+ public string TooltipText
+ {
+ set
{
- 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));
+ SetProperty(View.Property.TOOLTIP, new Tizen.NUI.PropertyValue(value));
+ NotifyPropertyChanged();
}
- },
- defaultValueCreator: (bindable) =>
+ }
+
+ ///
+ /// The Child property of FlexContainer.
+ /// The proportion of the free space in the container, the flex item will receive.
+ /// If all items in the container set this property, their sizes will be proportional to the specified flex factor.
+ ///
+ /// 3
+ public float Flex
{
- var view = (View)bindable;
- string temp;
- Tizen.NUI.Object.GetProperty(view.swigCPtr, TableView.ChildProperty.CELL_VERTICAL_ALIGNMENT).Get(out temp);
+ get
{
- NUILog.Error("CellVerticalAlignment get error!");
+ return (float)GetValue(FlexProperty);
}
-
- switch (temp)
+ set
{
- 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;
+ SetValue(FlexProperty, value);
+ NotifyPropertyChanged();
}
- });
+ }
///
- /// "Please DO NOT use! This will be deprecated! Please use 'View Weight' instead of BindableProperty"
- /// This needs to be hidden as inhouse API until all applications using it have been updated. Do not make public.
+ /// The Child property of FlexContainer.
+ /// The alignment of the flex item along the cross axis, which, if set, overides the default alignment for all items in the container.
///
- [EditorBrowsable(EditorBrowsableState.Never)]
- public static readonly BindableProperty WeightProperty = BindableProperty.Create("Weight", typeof(float), typeof(View), default(float), propertyChanged: (bindable, oldValue, newValue) =>
+ /// 3
+ public int AlignSelf
{
- var view = (View)bindable;
- if (newValue != null)
+ get
{
- view.Weight = (float)newValue;
+ return (int)GetValue(AlignSelfProperty);
}
- },
-
- defaultValueCreator: (bindable) =>
- {
- var view = (View)bindable;
- return view.Weight;
- });
+ set
+ {
+ SetValue(AlignSelfProperty, value);
+ NotifyPropertyChanged();
+ }
+ }
- /// 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(nameof(View.LeftFocusableView), typeof(View), typeof(View), null, 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(nameof(View.RightFocusableView), typeof(View), typeof(View), null, 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(nameof(View.UpFocusableView), typeof(View), typeof(View), null, 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(nameof(View.DownFocusableView), typeof(View), typeof(View), null, 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), null, propertyChanged: (bindable, oldValue, newValue) =>
+ ///
+ /// The Child property of FlexContainer.
+ /// The space around the flex item.
+ ///
+ /// 3
+ public Vector4 FlexMargin
{
- var view = (View)bindable;
- if (newValue != null)
+ get
{
- Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.SIZE, new Tizen.NUI.PropertyValue(new Size((Size2D)newValue)));
+ return (Vector4)GetValue(FlexMarginProperty);
}
- },
- 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)
+ set
{
- Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.OPACITY, new Tizen.NUI.PropertyValue((float)newValue));
+ SetValue(FlexMarginProperty, value);
+ NotifyPropertyChanged();
}
- },
- 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), null, propertyChanged: (bindable, oldValue, newValue) =>
+ }
+
+ ///
+ /// The top-left cell this child occupies, if not set, the first available cell is used.
+ ///
+ /// 3
+ public Vector2 CellIndex
{
- var view = (View)bindable;
- if (newValue != null)
+ get
{
- Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.POSITION, new Tizen.NUI.PropertyValue(new Position((Position2D)newValue)));
+ return (Vector2)GetValue(CellIndexProperty);
}
- },
- 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)
+ set
{
- Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.POSITION_USES_ANCHOR_POINT, new Tizen.NUI.PropertyValue((bool)newValue));
+ SetValue(CellIndexProperty, value);
+ NotifyPropertyChanged();
}
- },
- 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) =>
+ }
+
+ ///
+ /// The number of rows this child occupies, if not set, the default value is 1.
+ ///
+ /// 3
+ public float RowSpan
{
- var view = (View)bindable;
- int value;
- if (newValue != null)
+ get
{
- 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(); }
- }
- }
+ return (float)GetValue(RowSpanProperty);
}
- },
- defaultValueCreator: (bindable) =>
- {
- var view = (View)bindable;
- var parentChildren = view.GetParent()?.Children;
- int currentOrder = 0;
- if (parentChildren != null)
+ set
{
- currentOrder = parentChildren.IndexOf(view);
-
- if (currentOrder < 0) { return 0; }
- else if (currentOrder < parentChildren.Count) { return currentOrder; }
+ SetValue(RowSpanProperty, value);
+ NotifyPropertyChanged();
}
+ }
- 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), null, propertyChanged: (bindable, oldValue, newValue) =>
+ ///
+ /// The number of columns this child occupies, if not set, the default value is 1.
+ ///
+ /// 3
+ public float ColumnSpan
{
- var view = (View)bindable;
- if (newValue != null)
+ get
{
- Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.PARENT_ORIGIN, new Tizen.NUI.PropertyValue((Position)newValue));
+ return (float)GetValue(ColumnSpanProperty);
}
- },
- 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), null, propertyChanged: (bindable, oldValue, newValue) =>
- {
- var view = (View)bindable;
- if (newValue != null)
+ set
{
- Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.ANCHOR_POINT, new Tizen.NUI.PropertyValue((Position)newValue));
+ SetValue(ColumnSpanProperty, value);
+ NotifyPropertyChanged();
}
- },
- 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) =>
+ }
+
+ ///
+ /// The horizontal alignment of this child inside the cells, if not set, the default value is 'left'.
+ ///
+ /// 3
+ public Tizen.NUI.HorizontalAlignmentType CellHorizontalAlignment
{
- var view = (View)bindable;
- if (newValue != null)
+ get
{
- Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.SIZE_WIDTH, new Tizen.NUI.PropertyValue((float)newValue));
+ return (HorizontalAlignmentType)GetValue(CellHorizontalAlignmentProperty);
}
- },
- 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)
+ set
{
- Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.SIZE_HEIGHT, new Tizen.NUI.PropertyValue((float)newValue));
+ SetValue(CellHorizontalAlignmentProperty, value);
+ NotifyPropertyChanged();
}
- },
- 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), null, propertyChanged: (bindable, oldValue, newValue) =>
+ }
+
+ ///
+ /// The vertical alignment of this child inside the cells, if not set, the default value is 'top'.
+ ///
+ /// 3
+ public Tizen.NUI.VerticalAlignmentType CellVerticalAlignment
{
- var view = (View)bindable;
- if (newValue != null)
+ get
{
- Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.POSITION, new Tizen.NUI.PropertyValue((Position)newValue));
+ return (VerticalAlignmentType)GetValue(CellVerticalAlignmentProperty);
}
- },
- 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)
+ set
{
- Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.POSITION_X, new Tizen.NUI.PropertyValue((float)newValue));
+ SetValue(CellVerticalAlignmentProperty, value);
+ NotifyPropertyChanged();
}
- },
- 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) =>
+ }
+
+ ///
+ /// The left focusable view.
+ /// This will return null if not set.
+ /// This will also return null if the specified left focusable view is not on a window.
+ ///
+ /// 3
+ public View LeftFocusableView
{
- var view = (View)bindable;
- if (newValue != null)
+ // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
+ get
{
- Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.POSITION_Y, new Tizen.NUI.PropertyValue((float)newValue));
+ return (View)GetValue(LeftFocusableViewProperty);
}
- },
- 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)
+ set
{
- Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.POSITION_Z, new Tizen.NUI.PropertyValue((float)newValue));
+ SetValue(LeftFocusableViewProperty, value);
+ NotifyPropertyChanged();
}
- },
- 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), null, propertyChanged: (bindable, oldValue, newValue) =>
+ }
+
+ ///
+ /// The right focusable view.
+ /// This will return null if not set.
+ /// This will also return null if the specified right focusable view is not on a window.
+ ///
+ /// 3
+ public View RightFocusableView
{
- var view = (View)bindable;
- if (newValue != null)
+ // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
+ get
{
- Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.ORIENTATION, new Tizen.NUI.PropertyValue((Rotation)newValue));
+ return (View)GetValue(RightFocusableViewProperty);
}
- },
- 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), null, propertyChanged: (bindable, oldValue, newValue) =>
- {
- var view = (View)bindable;
- if (newValue != null)
+ set
{
- Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.SCALE, new Tizen.NUI.PropertyValue((Vector3)newValue));
+ SetValue(RightFocusableViewProperty, value);
+ NotifyPropertyChanged();
}
- },
- 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) =>
+ }
+
+ ///
+ /// The up focusable view.
+ /// This will return null if not set.
+ /// This will also return null if the specified up focusable view is not on a window.
+ ///
+ /// 3
+ public View UpFocusableView
{
- var view = (View)bindable;
- if (newValue != null)
+ // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
+ get
{
- Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.SCALE_X, new Tizen.NUI.PropertyValue((float)newValue));
+ return (View)GetValue(UpFocusableViewProperty);
}
- },
- 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)
+ set
{
- Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.SCALE_Y, new Tizen.NUI.PropertyValue((float)newValue));
+ SetValue(UpFocusableViewProperty, value);
+ NotifyPropertyChanged();
}
- },
- 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) =>
+ }
+
+ ///
+ /// The down focusable view.
+ /// This will return null if not set.
+ /// This will also return null if the specified down focusable view is not on a window.
+ ///
+ /// 3
+ public View DownFocusableView
{
- var view = (View)bindable;
- if (newValue != null)
+ // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
+ get
{
- Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.SCALE_Z, new Tizen.NUI.PropertyValue((float)newValue));
+ return (View)GetValue(DownFocusableViewProperty);
}
- },
- 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)
+ set
{
- Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.NAME, new Tizen.NUI.PropertyValue((string)newValue));
+ SetValue(DownFocusableViewProperty, value);
+ NotifyPropertyChanged();
}
- },
- 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) =>
+ }
+
+ ///
+ /// Whether the view should be focusable by keyboard navigation.
+ ///
+ /// 3
+ public bool Focusable
{
- var view = (View)bindable;
- if (newValue != null)
+ set
{
- Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.SENSITIVE, new Tizen.NUI.PropertyValue((bool)newValue));
+ SetValue(FocusableProperty, value);
+ NotifyPropertyChanged();
}
- },
- 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)
+ get
{
- Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.LEAVE_REQUIRED, new Tizen.NUI.PropertyValue((bool)newValue));
+ return (bool)GetValue(FocusableProperty);
}
- },
- 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) =>
+ }
+
+ ///
+ /// Retrieves the position of the view.
+ /// The coordinates are relative to the view's parent.
+ ///
+ /// 3
+ public Position CurrentPosition
{
- var view = (View)bindable;
- if (newValue != null)
+ get
{
- Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.INHERIT_ORIENTATION, new Tizen.NUI.PropertyValue((bool)newValue));
+ return GetCurrentPosition();
}
- },
- 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) =>
+ }
+
+ ///
+ /// Sets the size of a view for the width and the height.
+ /// Geometry can be scaled to fit within this area.
+ /// This does not interfere with the view's scale factor.
+ /// The views default depth is the minimum of width and height.
+ ///
+ ///
+ /// This NUI object (Size2D) typed property can be configured by multiple cascade setting.
+ /// For example, this code ( view.Size2D.Width = 100; view.Size2D.Height = 100; ) is equivalent to this ( view.Size2D = new Size2D(100, 100); ).
+ /// Please note that this multi-cascade setting is especially possible for this NUI object (Size2D).
+ /// This means by default others are impossible so it is recommended that NUI object typed properties are configured by their constructor with parameters.
+ /// For example, this code is working fine : view.Scale = new Vector3( 2.0f, 1.5f, 0.0f);
+ /// but this will not work! : view.Scale.X = 2.0f; view.Scale.Y = 1.5f;
+ /// It may not match the current value in some cases, i.e. when the animation is progressing or the maximum or minimum size is set.
+ ///
+ /// 3
+ public Size2D Size2D
{
- 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)
+ get
{
- case "NORMAL": return DrawModeType.Normal;
- case "OVERLAY_2D": return DrawModeType.Overlay2D;
-#pragma warning disable CS0618 // Disable deprecated warning as we do need to use the deprecated API here.
- case "STENCIL": return DrawModeType.Stencil;
-#pragma warning restore CS0618
- default: return DrawModeType.Normal;
+ Size2D temp = (Size2D)GetValue(Size2DProperty);
+ return new Size2D(OnSize2DChanged, temp.Width, temp.Height);
}
- });
- /// 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), null, propertyChanged: (bindable, oldValue, newValue) =>
- {
- var view = (View)bindable;
- if (newValue != null)
+ set
{
- Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.SIZE_MODE_FACTOR, new Tizen.NUI.PropertyValue((Vector3)newValue));
+ SetValue(Size2DProperty, value);
+ // Set Specification so when layouts measure this View it matches the value set here.
+ // All Views are currently Layouts.
+ MeasureSpecificationWidth = new MeasureSpecification(new LayoutLength(value.Width), MeasureSpecification.ModeType.Exactly);
+ MeasureSpecificationHeight = new MeasureSpecification(new LayoutLength(value.Height), MeasureSpecification.ModeType.Exactly);
+ _widthPolicy = value.Width;
+ _heightPolicy = value.Height;
+ _layout?.RequestLayout();
+ NotifyPropertyChanged();
}
- },
- 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) =>
+ }
+
+ ///
+ /// Retrieves the size of the view.
+ /// The coordinates are relative to the view's parent.
+ ///
+ /// 3
+ public Size2D CurrentSize
{
- var view = (View)bindable;
- if (newValue != null)
+ get
{
- Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.WIDTH_RESIZE_POLICY, new Tizen.NUI.PropertyValue((int)newValue));
+ return GetCurrentSize();
}
- },
- defaultValueCreator: (bindable) =>
+ }
+
+ ///
+ /// Retrieves and sets the view's opacity.
+ ///
+ /// 3
+ public float Opacity
{
- 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)
+ get
{
- 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 (float)GetValue(OpacityProperty);
}
- });
- /// 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)
+ set
{
- Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.HEIGHT_RESIZE_POLICY, new Tizen.NUI.PropertyValue((int)newValue));
+ SetValue(OpacityProperty, value);
+ NotifyPropertyChanged();
}
- },
- defaultValueCreator: (bindable) =>
+ }
+
+ ///
+ /// Sets the position of the view for X and Y.
+ /// By default, sets the position vector between the parent origin and the pivot point (default).
+ /// If the position inheritance is disabled, sets the world position.
+ ///
+ ///
+ /// This NUI object (Position2D) typed property can be configured by multiple cascade setting.
+ /// For example, this code ( view.Position2D.X = 100; view.Position2D.Y = 100; ) is equivalent to this ( view.Position2D = new Position2D(100, 100); ).
+ /// Please note that this multi-cascade setting is especially possible for this NUI object (Position2D).
+ /// This means by default others are impossible so it is recommended that NUI object typed properties are configured by their constructor with parameters.
+ /// For example, this code is working fine : view.Scale = new Vector3( 2.0f, 1.5f, 0.0f);
+ /// but this will not work! : view.Scale.X = 2.0f; view.Scale.Y = 1.5f;
+ ///
+ /// 3
+ public Position2D Position2D
{
- var view = (View)bindable;
- string temp;
- if (Tizen.NUI.Object.GetProperty(view.swigCPtr, View.Property.HEIGHT_RESIZE_POLICY).Get(out temp) == false)
+ get
{
- NUILog.Error("HeightResizePolicy get error!");
+ Position2D temp = (Position2D)GetValue(Position2DProperty);
+ return new Position2D(OnPosition2DChanged, temp.X, temp.Y);
}
- switch (temp)
+ set
{
- 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;
+ SetValue(Position2DProperty, value);
+ NotifyPropertyChanged();
}
- });
- /// 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) =>
+ }
+
+ ///
+ /// Retrieves the screen postion of the view.
+ ///
+ /// 3
+ public Vector2 ScreenPosition
{
- var view = (View)bindable;
- string valueToString = "";
- if (newValue != null)
+ get
{
- 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));
+ Vector2 temp = new Vector2(0.0f, 0.0f);
+ GetProperty(View.Property.SCREEN_POSITION).Get(temp);
+ return temp;
}
- },
- defaultValueCreator: (bindable) =>
+ }
+
+ ///
+ /// Determines whether the pivot point should be used to determine the position of the view.
+ /// This is true by default.
+ ///
+ /// If false, then the top-left of the view is used for the position.
+ /// Setting this to false will allow scaling or rotation around the pivot point without affecting the view's position.
+ ///
+ /// 3
+ public bool PositionUsesPivotPoint
{
- var view = (View)bindable;
- string temp;
- if (Tizen.NUI.Object.GetProperty(view.swigCPtr, View.Property.SIZE_SCALE_POLICY).Get(out temp) == false)
+ get
{
- NUILog.Error("SizeScalePolicy get error!");
+ return (bool)GetValue(PositionUsesPivotPointProperty);
}
- switch (temp)
+ set
{
- 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;
+ SetValue(PositionUsesPivotPointProperty, value);
+ NotifyPropertyChanged();
}
- });
- /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ }
+
+ ///
+ /// Deprecated in API5; Will be removed in API8. Please use PositionUsesPivotPoint instead!
+ ///
+ /// 3
+ [Obsolete("Deprecated in API5; Will be removed in API8. Please use PositionUsesPivotPoint instead! " +
+ "Like: " +
+ "View view = new View(); " +
+ "view.PivotPoint = PivotPoint.Center; " +
+ "view.PositionUsesPivotPoint = true;" +
+ " Deprecated in API5: Will be removed in API8")]
[EditorBrowsable(EditorBrowsableState.Never)]
- public static readonly BindableProperty WidthForHeightProperty = BindableProperty.Create("WidthForHeight", typeof(bool), typeof(View), false, propertyChanged: (bindable, oldValue, newValue) =>
+ public bool PositionUsesAnchorPoint
{
- var view = (View)bindable;
- if (newValue != null)
+ get
{
- Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.WIDTH_FOR_HEIGHT, new Tizen.NUI.PropertyValue((bool)newValue));
+ bool temp = false;
+ GetProperty(View.Property.POSITION_USES_ANCHOR_POINT).Get(out temp);
+ return temp;
}
- },
- 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)
+ set
{
- Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.HEIGHT_FOR_WIDTH, new Tizen.NUI.PropertyValue((bool)newValue));
+ SetProperty(View.Property.POSITION_USES_ANCHOR_POINT, new Tizen.NUI.PropertyValue(value));
+ NotifyPropertyChanged();
}
- },
- 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), null, propertyChanged: (bindable, oldValue, newValue) =>
+ }
+
+ ///
+ /// Queries whether the view is connected to the stage.
+ /// When a view is connected, it will be directly or indirectly parented to the root view.
+ ///
+ /// 3
+ public bool IsOnWindow
{
- var view = (View)bindable;
- if (newValue != null)
+ get
{
- Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.PADDING, new Tizen.NUI.PropertyValue((Extents)newValue));
+ return OnWindow();
}
- },
- 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), null, propertyChanged: (bindable, oldValue, newValue) =>
+ }
+
+ ///
+ /// Gets the depth in the hierarchy for the view.
+ ///
+ /// 3
+ public int HierarchyDepth
{
- var view = (View)bindable;
- if (newValue != null)
+ get
{
- Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.SIZE, new Tizen.NUI.PropertyValue((Size)newValue));
+ return GetHierarchyDepth();
}
- },
- 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), null, propertyChanged: (bindable, oldValue, newValue) =>
+ }
+
+ ///
+ /// Sets the sibling order of the view so the depth position can be defined within the same parent.
+ ///
+ ///
+ /// 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.
+ ///
+ /// 3
+ public int SiblingOrder
{
- var view = (View)bindable;
- if (newValue != null)
+ get
{
- Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.MINIMUM_SIZE, new Tizen.NUI.PropertyValue((Size2D)newValue));
+ return (int)GetValue(SiblingOrderProperty);
}
- },
- 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), null, propertyChanged: (bindable, oldValue, newValue) =>
- {
- var view = (View)bindable;
- if (newValue != null)
+ set
{
- Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.MAXIMUM_SIZE, new Tizen.NUI.PropertyValue((Size2D)newValue));
+ SetValue(SiblingOrderProperty, value);
+ NotifyPropertyChanged();
}
- },
- 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) =>
+ }
+
+ ///
+ /// Returns the natural size of the view.
+ ///
+ ///
+ /// Deriving classes stipulate the natural size and by default a view has a zero natural size.
+ ///
+ /// 5
+ public Vector3 NaturalSize
{
- var view = (View)bindable;
- if (newValue != null)
+ get
{
- Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.INHERIT_POSITION, new Tizen.NUI.PropertyValue((bool)newValue));
+ Vector3 ret = new Vector3(Interop.Actor.Actor_GetNaturalSize(swigCPtr), true);
+ if (NDalicPINVOKE.SWIGPendingException.Pending)
+ throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ return ret;
}
- },
- 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) =>
+ }
+
+ ///
+ /// Returns the natural size (Size2D) of the view.
+ ///
+ ///
+ /// Deriving classes stipulate the natural size and by default a view has a zero natural size.
+ ///
+ /// 4
+ public Size2D NaturalSize2D
{
- var view = (View)bindable;
- if (newValue != null)
+ get
{
- Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.CLIPPING_MODE, new Tizen.NUI.PropertyValue((int)newValue));
+ Vector3 temp = new Vector3(Interop.Actor.Actor_GetNaturalSize(swigCPtr), true);
+ if (NDalicPINVOKE.SWIGPendingException.Pending)
+ throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+
+ return new Size2D((int)temp.Width, (int)temp.Height);
}
- },
- defaultValueCreator: (bindable) =>
+ }
+
+ ///
+ /// Gets or sets the origin of a view within its parent's area.
+ /// This is expressed in unit coordinates, such that (0.0, 0.0, 0.5) is the top-left corner of the parent, and (1.0, 1.0, 0.5) is the bottom-right corner.
+ /// The default parent-origin is ParentOrigin.TopLeft (0.0, 0.0, 0.5).
+ /// A view's position is the distance between this origin and the view's anchor-point.
+ ///
+ ///
The view has been initialized.
+ /// 3
+ public Position ParentOrigin
{
- var view = (View)bindable;
- int temp = 0;
- if (Tizen.NUI.Object.GetProperty(view.swigCPtr, View.Property.CLIPPING_MODE).Get(out temp) == false)
+ get
{
- NUILog.Error("ClippingMode get error!");
+ Position tmp = (Position)GetValue(ParentOriginProperty);
+ return new Position(OnParentOriginChanged, tmp.X, tmp.Y, tmp.Z);
}
- 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)
+ set
{
- Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.INHERIT_LAYOUT_DIRECTION, new Tizen.NUI.PropertyValue((bool)newValue));
+ SetValue(ParentOriginProperty, value);
+ NotifyPropertyChanged();
}
- },
- 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), null, 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);
-
- ///
- /// Flag to indicate if layout set explicitly via API call or View was automatically given a Layout.
- ///
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
- public bool layoutSet = false;
-
- ///
- /// Flag to allow Layouting to be disabled for Views.
- /// Once a View has a Layout set then any children added to Views from then on will receive
- /// automatic Layouts.
- ///
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
- public static bool layoutingDisabled{get; set;} = true;
-
- internal readonly MergedStyle _mergedStyle;
- private global::System.Runtime.InteropServices.HandleRef swigCPtr;
- private LayoutItem _layout; // Exclusive layout assigned to this View.
- private int _widthPolicy = LayoutParamPolicies.WrapContent; // Layout width policy
- private int _heightPolicy = LayoutParamPolicies.WrapContent; // Layout height policy
- private float _weight = 0.0f; // Weighting of child View in a Layout
- private MeasureSpecification _measureSpecificationWidth; // Layout width and internal Mode
- private MeasureSpecification _measureSpecificationHeight; // Layout height and internal Mode
- private bool _backgroundImageSynchronosLoading = false;
- private EventHandler _offWindowEventHandler;
- private OffWindowEventCallbackType _offWindowEventCallback;
- private EventHandlerWithReturnType