2 * Copyright(c) 2019-2022 Samsung Electronics Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
19 using System.ComponentModel;
20 using Tizen.NUI.Binding;
22 namespace Tizen.NUI.BaseComponents
25 /// View is the base class for all views.
27 /// <since_tizen> 3 </since_tizen>
28 public partial class View
30 private float userSizeWidth = 0.0f;
31 private float userSizeHeight = 0.0f;
34 /// StyleNameProperty (DALi json)
36 [EditorBrowsable(EditorBrowsableState.Never)]
37 public static readonly BindableProperty StyleNameProperty = BindableProperty.Create(nameof(StyleName), typeof(string), typeof(View), string.Empty, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) =>
39 var view = (View)bindable;
42 string styleName = (string)newValue;
44 Object.InternalSetPropertyString(view.SwigCPtr, View.Property.StyleName, styleName);
46 view.styleName = styleName;
48 if (string.IsNullOrEmpty(styleName)) return;
50 var style = ThemeManager.GetUpdateStyleWithoutClone(styleName);
52 if (style == null) return;
54 view.ApplyStyle(style);
55 view.SetThemeApplied();
58 defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
60 var view = (View)bindable;
62 if (!string.IsNullOrEmpty(view.styleName)) return view.styleName;
64 return Object.InternalGetPropertyString(view.SwigCPtr, View.Property.StyleName);
68 /// KeyInputFocusProperty
70 [EditorBrowsable(EditorBrowsableState.Never)]
71 public static readonly BindableProperty KeyInputFocusProperty = BindableProperty.Create(nameof(KeyInputFocus), typeof(bool), typeof(View), false, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) =>
73 var view = (View)bindable;
76 Object.InternalSetPropertyBool(view.SwigCPtr, View.Property.KeyInputFocus, (bool)newValue);
79 defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
81 var view = (View)bindable;
82 return Object.InternalGetPropertyBool(view.SwigCPtr, View.Property.KeyInputFocus);
85 // BackgroundColorProperty
86 internal static void SetInternalBackgroundColorProperty(BindableObject bindable, object oldValue, object newValue)
88 var view = (View)bindable;
90 if (NUIApplication.IsUsingXaml)
92 view.themeData?.selectorData?.ClearBackground(view);
94 if (newValue is Selector<Color> selector)
96 if (selector.HasAll()) view.SetBackgroundColor(selector.All);
97 else view.EnsureSelectorData().BackgroundColor = new TriggerableSelector<Color>(view, selector, view.SetBackgroundColor, true);
101 view.SetBackgroundColor((Color)newValue);
107 view.SetBackgroundColor((Color)newValue);
111 internal static object GetInternalBackgroundColorProperty(BindableObject bindable)
113 var view = (View)bindable;
115 if (view.internalBackgroundColor == null)
117 view.internalBackgroundColor = new Color(view.OnBackgroundColorChanged, 0, 0, 0, 0);
120 int visualType = (int)Visual.Type.Invalid;
121 Interop.View.InternalRetrievingVisualPropertyInt(view.SwigCPtr, Property.BACKGROUND, Visual.Property.Type, out visualType);
122 if (visualType == (int)Visual.Type.Color)
124 Interop.View.InternalRetrievingVisualPropertyVector4(view.SwigCPtr, Property.BACKGROUND, ColorVisualProperty.MixColor, Color.getCPtr(view.internalBackgroundColor));
126 return view.internalBackgroundColor;
130 /// BackgroundColorProperty
132 [EditorBrowsable(EditorBrowsableState.Never)]
134 public static BindableProperty BackgroundColorProperty = null;
136 internal static BindableProperty GetBackgroundColorProperty()
138 if (BackgroundColorProperty == null)
140 BackgroundColorProperty = BindableProperty.Create(nameof(BackgroundColor), typeof(Color), typeof(View), null,
141 propertyChanged: SetInternalBackgroundColorProperty, defaultValueCreator: GetInternalBackgroundColorProperty);
143 return BackgroundColorProperty;
146 public static readonly BindableProperty BackgroundColorProperty = null;
150 internal static void SetInternalColorProperty(BindableObject bindable, object oldValue, object newValue)
152 var view = (View)bindable;
154 view.themeData?.selectorData?.Color?.Reset(view);
156 if (newValue is Selector<Color> selector)
158 if (selector.HasAll()) view.SetColor(selector.All);
159 else view.EnsureSelectorData().Color = new TriggerableSelector<Color>(view, selector, view.SetColor, true);
163 view.SetColor((Color)newValue);
167 internal static object GetInternalColorProperty(BindableObject bindable)
169 var view = (View)bindable;
171 if (view.internalColor == null)
173 view.internalColor = new Color(view.OnColorChanged, 0, 0, 0, 0);
175 Object.InternalRetrievingPropertyVector4(view.SwigCPtr, View.Property.COLOR, view.internalColor.SwigCPtr);
176 return view.internalColor;
182 [EditorBrowsable(EditorBrowsableState.Never)]
184 public static BindableProperty ColorProperty = null;
186 internal static BindableProperty GetColorProperty()
188 if (ColorProperty == null)
190 ColorProperty = BindableProperty.Create(nameof(Color), typeof(Color), typeof(View), null,
191 propertyChanged: SetInternalColorProperty, defaultValueCreator: GetInternalColorProperty);
193 return ColorProperty;
196 public static readonly BindableProperty ColorProperty = null;
200 internal static void SetInternalColorRedProperty(BindableObject bindable, object oldValue, object newValue)
202 var view = (View)bindable;
203 view.SetColorRed((float?)newValue);
206 internal static object GetInternalColorRedProperty(BindableObject bindable)
208 var view = (View)bindable;
209 return Object.InternalGetPropertyFloat(view.SwigCPtr, View.Property.ColorRed);
215 [EditorBrowsable(EditorBrowsableState.Never)]
217 public static BindableProperty ColorRedProperty = null;
219 internal static BindableProperty GetColorRedProperty()
221 if (ColorRedProperty == null)
223 ColorRedProperty = BindableProperty.Create(nameof(ColorRed), typeof(float), typeof(View), default(float),
224 propertyChanged: SetInternalColorRedProperty, defaultValueCreator: GetInternalColorRedProperty);
226 return ColorRedProperty;
229 public static readonly BindableProperty ColorRedProperty = null;
232 // ColorGreenProperty
233 internal static void SetInternalColorGreenProperty(BindableObject bindable, object oldValue, object newValue)
235 var view = (View)bindable;
236 view.SetColorGreen((float?)newValue);
240 internal static object GetInternalColorGreenProperty(BindableObject bindable)
242 var view = (View)bindable;
243 return Object.InternalGetPropertyFloat(view.SwigCPtr, View.Property.ColorGreen);
248 /// ColorGreenProperty
250 [EditorBrowsable(EditorBrowsableState.Never)]
252 public static BindableProperty ColorGreenProperty = null;
254 internal static BindableProperty GetColorGreenProperty()
256 if (ColorGreenProperty == null)
258 ColorGreenProperty = BindableProperty.Create(nameof(ColorGreen), typeof(float), typeof(View), default(float),
259 propertyChanged: SetInternalColorGreenProperty, defaultValueCreator: GetInternalColorGreenProperty);
261 return ColorGreenProperty;
264 public static readonly BindableProperty ColorGreenProperty = null;
268 internal static void SetInternalColorBlueProperty(BindableObject bindable, object oldValue, object newValue)
270 var view = (View)bindable;
271 view.SetColorBlue((float?)newValue);
275 internal static object GetInternalColorBlueProperty(BindableObject bindable)
277 var view = (View)bindable;
278 return Object.InternalGetPropertyFloat(view.SwigCPtr, View.Property.ColorBlue);
283 /// ColorBlueProperty
285 [EditorBrowsable(EditorBrowsableState.Never)]
287 public static BindableProperty ColorBlueProperty = null;
289 internal static BindableProperty GetColorBlueProperty()
291 if (ColorBlueProperty == null)
293 ColorBlueProperty = BindableProperty.Create(nameof(ColorBlue), typeof(float), typeof(View), default(float),
294 propertyChanged: SetInternalColorBlueProperty, defaultValueCreator: GetInternalColorBlueProperty);
296 return ColorBlueProperty;
299 public static readonly BindableProperty ColorBlueProperty = null;
302 /// <summary> BackgroundImageProperty </summary>
303 [EditorBrowsable(EditorBrowsableState.Never)]
304 public static readonly BindableProperty BackgroundImageProperty = BindableProperty.Create(nameof(BackgroundImage), typeof(string), typeof(View), default(string),
305 propertyChanged: (bindable, oldValue, newValue) =>
307 if (String.Equals(oldValue, newValue))
309 NUILog.Debug($"oldValue={oldValue} newValue={newValue} are same. just return here");
313 var view = (View)bindable;
315 if (view.themeData?.selectorData != null)
317 view.themeData.selectorData.BackgroundColor?.Reset(view);
318 view.themeData.selectorData.BackgroundImage?.Reset(view);
321 if (newValue is Selector<string> selector)
323 if (selector.HasAll()) view.SetBackgroundImage(selector.All);
324 else view.EnsureSelectorData().BackgroundImage = new TriggerableSelector<string>(view, selector, view.SetBackgroundImage, true);
328 view.SetBackgroundImage((string)newValue);
331 defaultValueCreator: (bindable) =>
333 var view = (View)bindable;
334 string backgroundImage = "";
336 Interop.View.InternalRetrievingVisualPropertyString(view.SwigCPtr, Property.BACKGROUND, ImageVisualProperty.URL, out backgroundImage);
338 return backgroundImage;
343 /// <summary>BackgroundImageBorderProperty</summary>
344 [EditorBrowsable(EditorBrowsableState.Never)]
345 public static readonly BindableProperty BackgroundImageBorderProperty = BindableProperty.Create(nameof(BackgroundImageBorder), typeof(Rectangle), typeof(View), default(Rectangle), propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) =>
347 var view = (View)bindable;
349 view.themeData?.selectorData?.BackgroundImageBorder?.Reset(view);
351 if (newValue is Selector<Rectangle> selector)
353 if (selector.HasAll()) view.SetBackgroundImageBorder(selector.All);
354 else view.EnsureSelectorData().BackgroundImageBorder = new TriggerableSelector<Rectangle>(view, selector, view.SetBackgroundImageBorder, true);
358 view.SetBackgroundImageBorder((Rectangle)newValue);
361 defaultValueCreator: (bindable) =>
363 var view = (View)bindable;
365 return view.backgroundExtraData?.BackgroundImageBorder;
369 /// BackgroundProperty
371 [EditorBrowsable(EditorBrowsableState.Never)]
372 public static readonly BindableProperty BackgroundProperty = BindableProperty.Create(nameof(Background), typeof(PropertyMap), typeof(View), null,
373 propertyChanged: (bindable, oldValue, newValue) =>
375 var view = (View)bindable;
376 if (newValue != null)
378 var propertyValue = new PropertyValue((PropertyMap)newValue);
379 Object.SetProperty(view.SwigCPtr, Property.BACKGROUND, propertyValue);
381 view.backgroundExtraData = null;
383 // Background extra data is not valid anymore. We should ignore lazy UpdateBackgroundExtraData
384 view.backgroundExtraDataUpdatedFlag = BackgroundExtraDataUpdatedFlag.None;
385 if (view.backgroundExtraDataUpdateProcessAttachedFlag)
387 ProcessorController.Instance.ProcessorOnceEvent -= view.UpdateBackgroundExtraData;
388 view.backgroundExtraDataUpdateProcessAttachedFlag = false;
391 propertyValue.Dispose();
392 propertyValue = null;
395 defaultValueCreator: (bindable) =>
397 var view = (View)bindable;
399 // Sync as current properties
400 view.UpdateBackgroundExtraData();
402 PropertyMap tmp = new PropertyMap();
403 var propertyValue = Object.GetProperty(view.SwigCPtr, Property.BACKGROUND);
404 propertyValue.Get(tmp);
405 propertyValue.Dispose();
406 propertyValue = null;
414 [EditorBrowsable(EditorBrowsableState.Never)]
415 public static readonly BindableProperty StateProperty = BindableProperty.Create(nameof(State), typeof(States), typeof(View), States.Normal, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) =>
417 var view = (View)bindable;
418 if (newValue != null)
420 Object.InternalSetPropertyInt(view.SwigCPtr, View.Property.STATE, (int)newValue);
423 defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
425 var view = (View)bindable;
427 temp = Object.InternalGetPropertyInt(view.SwigCPtr, View.Property.STATE);
430 case 0: return States.Normal;
431 case 1: return States.Focused;
432 case 2: return States.Disabled;
433 default: return States.Normal;
440 [EditorBrowsable(EditorBrowsableState.Never)]
441 public static readonly BindableProperty SubStateProperty = BindableProperty.Create(nameof(SubState), typeof(States), typeof(View), States.Normal, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) =>
443 var view = (View)bindable;
444 string valueToString = "";
445 if (newValue != null)
447 valueToString = ((States)newValue).GetDescription();
448 Object.InternalSetPropertyString(view.SwigCPtr, View.Property.SubState, valueToString);
451 defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
453 var view = (View)bindable;
455 temp = Object.InternalGetPropertyString(view.SwigCPtr, View.Property.SubState);
456 return temp.GetValueByDescription<States>();
462 [EditorBrowsable(EditorBrowsableState.Never)]
463 public static readonly BindableProperty TooltipProperty = BindableProperty.Create(nameof(Tooltip), typeof(PropertyMap), typeof(View), null, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) =>
465 var view = (View)bindable;
466 if (newValue != null)
468 Tizen.NUI.Object.SetProperty((System.Runtime.InteropServices.HandleRef)view.SwigCPtr, View.Property.TOOLTIP, new Tizen.NUI.PropertyValue((PropertyMap)newValue));
471 defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
473 var view = (View)bindable;
474 Tizen.NUI.PropertyMap temp = new Tizen.NUI.PropertyMap();
475 Tizen.NUI.Object.GetProperty((System.Runtime.InteropServices.HandleRef)view.SwigCPtr, View.Property.TOOLTIP).Get(temp);
482 [EditorBrowsable(EditorBrowsableState.Never)]
483 public static readonly BindableProperty FlexProperty = BindableProperty.Create(nameof(Flex), typeof(float), typeof(View), default(float), propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) =>
485 var view = (View)bindable;
486 if (newValue != null)
488 Object.InternalSetPropertyFloat(view.SwigCPtr, FlexContainer.ChildProperty.FLEX, (float)newValue);
491 defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
493 var view = (View)bindable;
494 return Object.InternalGetPropertyFloat(view.SwigCPtr, FlexContainer.ChildProperty.FLEX);
498 /// AlignSelfProperty
500 [EditorBrowsable(EditorBrowsableState.Never)]
501 public static readonly BindableProperty AlignSelfProperty = BindableProperty.Create(nameof(AlignSelf), typeof(int), typeof(View), default(int), propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) =>
503 var view = (View)bindable;
504 if (newValue != null)
506 Object.InternalSetPropertyInt(view.SwigCPtr, FlexContainer.ChildProperty.AlignSelf, (int)newValue);
509 defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
511 var view = (View)bindable;
512 return Object.InternalGetPropertyInt(view.SwigCPtr, FlexContainer.ChildProperty.AlignSelf);
516 /// FlexMarginProperty
518 [EditorBrowsable(EditorBrowsableState.Never)]
519 public static readonly BindableProperty FlexMarginProperty = BindableProperty.Create(nameof(FlexMargin), typeof(Vector4), typeof(View), null, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) =>
521 var view = (View)bindable;
522 if (newValue != null)
524 Object.InternalSetPropertyVector4(view.SwigCPtr, FlexContainer.ChildProperty.FlexMargin, ((Vector4)newValue).SwigCPtr);
527 defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
529 var view = (View)bindable;
530 Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f);
531 Object.InternalRetrievingPropertyVector4(view.SwigCPtr, FlexContainer.ChildProperty.FlexMargin, temp.SwigCPtr);
536 internal static void SetInternalCellIndexProperty(BindableObject bindable, object oldValue, object newValue)
538 var view = (View)bindable;
539 if (newValue != null)
541 Object.InternalSetPropertyVector2(view.SwigCPtr, TableView.ChildProperty.CellIndex, ((Vector2)newValue).SwigCPtr);
546 internal static object GetInternalCellIndexProperty(BindableObject bindable)
548 var view = (View)bindable;
549 if (view.internalCellIndex == null)
551 view.internalCellIndex = new Vector2(view.OnCellIndexChanged, 0, 0);
553 Object.InternalRetrievingPropertyVector2(view.SwigCPtr, TableView.ChildProperty.CellIndex, view.internalCellIndex.SwigCPtr);
554 return view.internalCellIndex;
559 /// CellIndexProperty
561 [EditorBrowsable(EditorBrowsableState.Never)]
563 internal static BindableProperty GetCellIndexProperty()
565 if (CellIndexProperty == null)
567 CellIndexProperty = BindableProperty.Create(nameof(CellIndex), typeof(Vector2), typeof(View), null,
568 propertyChanged: SetInternalCellIndexProperty, defaultValueCreator: GetInternalCellIndexProperty);
570 return CellIndexProperty;
573 public static BindableProperty CellIndexProperty = null;
575 public static readonly BindableProperty CellIndexProperty = null;
581 [EditorBrowsable(EditorBrowsableState.Never)]
582 public static readonly BindableProperty RowSpanProperty = BindableProperty.Create(nameof(RowSpan), typeof(float), typeof(View), default(float), propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) =>
584 var view = (View)bindable;
585 if (newValue != null)
587 Object.InternalSetPropertyFloat(view.SwigCPtr, TableView.ChildProperty.RowSpan, (float)newValue);
590 defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
592 var view = (View)bindable;
593 return Object.InternalGetPropertyFloat(view.SwigCPtr, TableView.ChildProperty.RowSpan);
597 /// ColumnSpanProperty
599 [EditorBrowsable(EditorBrowsableState.Never)]
600 public static readonly BindableProperty ColumnSpanProperty = BindableProperty.Create(nameof(ColumnSpan), typeof(float), typeof(View), default(float), propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) =>
602 var view = (View)bindable;
603 if (newValue != null)
605 Object.InternalSetPropertyFloat(view.SwigCPtr, TableView.ChildProperty.ColumnSpan, (float)newValue);
608 defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
610 var view = (View)bindable;
611 return Object.InternalGetPropertyFloat(view.SwigCPtr, TableView.ChildProperty.ColumnSpan);
615 /// CellHorizontalAlignmentProperty
617 [EditorBrowsable(EditorBrowsableState.Never)]
618 public static readonly BindableProperty CellHorizontalAlignmentProperty = BindableProperty.Create(nameof(CellHorizontalAlignment), typeof(HorizontalAlignmentType), typeof(View), HorizontalAlignmentType.Left, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) =>
620 var view = (View)bindable;
621 string valueToString = "";
623 if (newValue != null)
625 valueToString = ((HorizontalAlignmentType)newValue).GetDescription();
626 Object.InternalSetPropertyString(view.SwigCPtr, TableView.ChildProperty.CellHorizontalAlignment, valueToString);
629 defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
631 var view = (View)bindable;
633 temp = Object.InternalGetPropertyString(view.SwigCPtr, TableView.ChildProperty.CellHorizontalAlignment);
634 return temp.GetValueByDescription<HorizontalAlignmentType>();
638 /// CellVerticalAlignmentProperty
640 [EditorBrowsable(EditorBrowsableState.Never)]
641 public static readonly BindableProperty CellVerticalAlignmentProperty = BindableProperty.Create(nameof(CellVerticalAlignment), typeof(VerticalAlignmentType), typeof(View), VerticalAlignmentType.Top, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) =>
643 var view = (View)bindable;
644 string valueToString = "";
646 if (newValue != null)
648 valueToString = ((VerticalAlignmentType)newValue).GetDescription();
649 Object.InternalSetPropertyString(view.SwigCPtr, TableView.ChildProperty.CellVerticalAlignment, valueToString);
652 defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
654 var view = (View)bindable;
656 temp = Object.InternalGetPropertyString(view.SwigCPtr, TableView.ChildProperty.CellVerticalAlignment);
657 return temp.GetValueByDescription<VerticalAlignmentType>();
661 /// "DO not use this, that will be deprecated. Use 'View Weight' instead of BindableProperty"
662 /// This needs to be hidden as inhouse API until all applications using it have been updated. Do not make public.
664 [EditorBrowsable(EditorBrowsableState.Never)]
665 public static readonly BindableProperty WeightProperty = BindableProperty.Create(nameof(Weight), typeof(float), typeof(View), default(float), propertyChanged: (bindable, oldValue, newValue) =>
667 var view = (View)bindable;
668 if (newValue != null)
670 view.Weight = (float)newValue;
674 defaultValueCreator: (bindable) =>
676 var view = (View)bindable;
681 /// LeftFocusableViewProperty
683 [EditorBrowsable(EditorBrowsableState.Never)]
684 public static readonly BindableProperty LeftFocusableViewProperty = BindableProperty.Create(nameof(View.LeftFocusableView), typeof(View), typeof(View), null, propertyChanged: (bindable, oldValue, newValue) =>
686 var view = (View)bindable;
687 if (newValue != null) { view.LeftFocusableViewId = (int)(newValue as View)?.GetId(); }
688 else { view.LeftFocusableViewId = -1; }
690 defaultValueCreator: (bindable) =>
692 var view = (View)bindable;
693 if (view.LeftFocusableViewId >= 0) { return view.ConvertIdToView((uint)view.LeftFocusableViewId); }
698 /// RightFocusableViewProperty
700 [EditorBrowsable(EditorBrowsableState.Never)]
701 public static readonly BindableProperty RightFocusableViewProperty = BindableProperty.Create(nameof(View.RightFocusableView), typeof(View), typeof(View), null, propertyChanged: (bindable, oldValue, newValue) =>
703 var view = (View)bindable;
704 if (newValue != null) { view.RightFocusableViewId = (int)(newValue as View)?.GetId(); }
705 else { view.RightFocusableViewId = -1; }
707 defaultValueCreator: (bindable) =>
709 var view = (View)bindable;
710 if (view.RightFocusableViewId >= 0) { return view.ConvertIdToView((uint)view.RightFocusableViewId); }
715 /// UpFocusableViewProperty
717 [EditorBrowsable(EditorBrowsableState.Never)]
718 public static readonly BindableProperty UpFocusableViewProperty = BindableProperty.Create(nameof(View.UpFocusableView), typeof(View), typeof(View), null, propertyChanged: (bindable, oldValue, newValue) =>
720 var view = (View)bindable;
721 if (newValue != null) { view.UpFocusableViewId = (int)(newValue as View)?.GetId(); }
722 else { view.UpFocusableViewId = -1; }
724 defaultValueCreator: (bindable) =>
726 var view = (View)bindable;
727 if (view.UpFocusableViewId >= 0) { return view.ConvertIdToView((uint)view.UpFocusableViewId); }
732 /// DownFocusableViewProperty
734 [EditorBrowsable(EditorBrowsableState.Never)]
735 public static readonly BindableProperty DownFocusableViewProperty = BindableProperty.Create(nameof(View.DownFocusableView), typeof(View), typeof(View), null, propertyChanged: (bindable, oldValue, newValue) =>
737 var view = (View)bindable;
738 if (newValue != null) { view.DownFocusableViewId = (int)(newValue as View)?.GetId(); }
739 else { view.DownFocusableViewId = -1; }
741 defaultValueCreator: (bindable) =>
743 var view = (View)bindable;
744 if (view.DownFocusableViewId >= 0) { return view.ConvertIdToView((uint)view.DownFocusableViewId); }
749 /// ClockwiseFocusableViewProperty
751 [EditorBrowsable(EditorBrowsableState.Never)]
752 public static readonly BindableProperty ClockwiseFocusableViewProperty = BindableProperty.Create(nameof(View.ClockwiseFocusableView), typeof(View), typeof(View), null, propertyChanged: (bindable, oldValue, newValue) =>
754 var view = (View)bindable;
755 if (newValue != null && (newValue is View)) { view.ClockwiseFocusableViewId = (int)(newValue as View)?.GetId(); }
756 else { view.ClockwiseFocusableViewId = -1; }
758 defaultValueCreator: (bindable) =>
760 var view = (View)bindable;
761 if (view.ClockwiseFocusableViewId >= 0) { return view.ConvertIdToView((uint)view.ClockwiseFocusableViewId); }
766 /// CounterClockwiseFocusableViewProperty
768 [EditorBrowsable(EditorBrowsableState.Never)]
769 public static readonly BindableProperty CounterClockwiseFocusableViewProperty = BindableProperty.Create(nameof(View.CounterClockwiseFocusableView), typeof(View), typeof(View), null, propertyChanged: (bindable, oldValue, newValue) =>
771 var view = (View)bindable;
772 if (newValue != null && (newValue is View)) { view.CounterClockwiseFocusableViewId = (int)(newValue as View)?.GetId(); }
773 else { view.CounterClockwiseFocusableViewId = -1; }
775 defaultValueCreator: (bindable) =>
777 var view = (View)bindable;
778 if (view.CounterClockwiseFocusableViewId >= 0) { return view.ConvertIdToView((uint)view.CounterClockwiseFocusableViewId); }
783 /// FocusableProperty
785 [EditorBrowsable(EditorBrowsableState.Never)]
786 public static readonly BindableProperty FocusableProperty = BindableProperty.Create(nameof(Focusable), typeof(bool), typeof(View), false, propertyChanged: (bindable, oldValue, newValue) =>
788 var view = (View)bindable;
789 if (newValue != null) { view.SetKeyboardFocusable((bool)newValue); }
791 defaultValueCreator: (bindable) =>
793 var view = (View)bindable;
794 return view.IsKeyboardFocusable();
798 /// FocusableChildrenProperty
800 [EditorBrowsable(EditorBrowsableState.Never)]
801 public static readonly BindableProperty FocusableChildrenProperty = BindableProperty.Create(nameof(FocusableChildren), typeof(bool), typeof(View), true, propertyChanged: (bindable, oldValue, newValue) =>
803 var view = (View)bindable;
804 if (newValue != null) { view.SetKeyboardFocusableChildren((bool)newValue); }
806 defaultValueCreator: (bindable) =>
808 var view = (View)bindable;
809 return view.AreChildrenKeyBoardFocusable();
813 /// FocusableInTouchProperty
815 [EditorBrowsable(EditorBrowsableState.Never)]
816 public static readonly BindableProperty FocusableInTouchProperty = BindableProperty.Create(nameof(FocusableInTouch), typeof(bool), typeof(View), false, propertyChanged: (bindable, oldValue, newValue) =>
818 var view = (View)bindable;
819 if (newValue != null) { view.SetFocusableInTouch((bool)newValue); }
821 defaultValueCreator: (bindable) =>
823 var view = (View)bindable;
824 return view.IsFocusableInTouch();
828 internal static void SetInternalSize2DProperty(BindableObject bindable, object oldValue, object newValue)
830 var view = (View)bindable;
831 if (newValue != null)
833 // Size property setter is only used by user.
834 // Framework code uses SetSize() instead of Size property setter.
835 // Size set by user is returned by GetUserSize2D() for SuggestedMinimumWidth/Height.
836 // SuggestedMinimumWidth/Height is used by Layout calculation.
837 int width = ((Size2D)newValue).Width;
838 int height = ((Size2D)newValue).Height;
839 view.userSizeWidth = (float)width;
840 view.userSizeHeight = (float)height;
842 bool relayoutRequired = false;
843 // To avoid duplicated size setup, change internal policy directly.
844 if (view.widthPolicy != width)
846 view.widthPolicy = width;
847 relayoutRequired = true;
849 if (view.heightPolicy != height)
851 view.heightPolicy = height;
852 relayoutRequired = true;
854 if (relayoutRequired)
856 view.layout?.RequestLayout();
859 Object.InternalSetPropertyVector2ActualVector3(view.SwigCPtr, View.Property.SIZE, ((Size2D)newValue).SwigCPtr);
863 internal static object GetInternalSize2DProperty(BindableObject bindable)
865 var view = (View)bindable;
866 if (view.internalSize2D == null)
868 view.internalSize2D = new Size2D(view.OnSize2DChanged, 0, 0);
870 Object.InternalRetrievingPropertyVector2ActualVector3(view.SwigCPtr, View.Property.SIZE, view.internalSize2D.SwigCPtr);
872 return view.internalSize2D;
878 [EditorBrowsable(EditorBrowsableState.Never)]
880 internal static BindableProperty GetSize2DProperty()
882 if (Size2DProperty == null)
884 Size2DProperty = BindableProperty.Create(nameof(Size2D), typeof(Size2D), typeof(View), null,
885 propertyChanged: SetInternalSize2DProperty, defaultValueCreator: GetInternalSize2DProperty);
887 return Size2DProperty;
890 public static BindableProperty Size2DProperty = null;
892 public static readonly BindableProperty Size2DProperty = null;
898 [EditorBrowsable(EditorBrowsableState.Never)]
899 public static readonly BindableProperty OpacityProperty = BindableProperty.Create(nameof(Opacity), typeof(float), typeof(View), default(float), propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) =>
901 var view = (View)bindable;
903 view.themeData?.selectorData?.Opacity?.Reset(view);
905 if (newValue is Selector<float?> selector)
907 if (selector.HasAll()) view.SetOpacity(selector.All);
908 else view.EnsureSelectorData().Opacity = new TriggerableSelector<float?>(view, selector, view.SetOpacity, true);
912 view.SetOpacity((float?)newValue);
915 defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
917 var view = (View)bindable;
918 return Object.InternalGetPropertyFloat(view.SwigCPtr, View.Property.OPACITY);
921 // Position2DProperty
922 internal static void SetInternalPosition2DProperty(BindableObject bindable, object oldValue, object newValue)
924 var view = (View)bindable;
925 if (newValue != null)
927 Object.InternalSetPropertyVector2ActualVector3(view.SwigCPtr, View.Property.POSITION, ((Position2D)newValue).SwigCPtr);
931 internal static object GetInternalPosition2DProperty(BindableObject bindable)
933 var view = (View)bindable;
934 if (view.internalPosition2D == null)
936 view.internalPosition2D = new Position2D(view.OnPosition2DChanged, 0, 0);
938 Object.InternalRetrievingPropertyVector2ActualVector3(view.SwigCPtr, View.Property.POSITION, view.internalPosition2D.SwigCPtr);
939 return view.internalPosition2D;
943 /// Position2DProperty
945 [EditorBrowsable(EditorBrowsableState.Never)]
947 internal static BindableProperty GetPosition2DProperty()
949 if (Position2DProperty == null)
951 Position2DProperty = BindableProperty.Create(nameof(Position2D), typeof(Position2D), typeof(View), null,
952 propertyChanged: SetInternalPosition2DProperty, defaultValueCreator: GetInternalPosition2DProperty);
954 return Position2DProperty;
957 public static BindableProperty Position2DProperty = null;
959 public static readonly BindableProperty Position2DProperty = null;
963 /// PositionUsesPivotPointProperty
965 [EditorBrowsable(EditorBrowsableState.Never)]
966 public static readonly BindableProperty PositionUsesPivotPointProperty = BindableProperty.Create(nameof(PositionUsesPivotPoint), typeof(bool), typeof(View), true, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) =>
968 var view = (View)bindable;
969 if (newValue != null)
971 Object.InternalSetPropertyBool(view.SwigCPtr, View.Property.PositionUsesAnchorPoint, (bool)newValue);
974 defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
976 var view = (View)bindable;
977 return Object.InternalGetPropertyBool(view.SwigCPtr, View.Property.PositionUsesAnchorPoint);
981 /// SiblingOrderProperty
983 [EditorBrowsable(EditorBrowsableState.Never)]
984 public static readonly BindableProperty SiblingOrderProperty = BindableProperty.Create(nameof(SiblingOrder), typeof(int), typeof(View), default(int), propertyChanged: (bindable, oldValue, newValue) =>
986 var view = (View)bindable;
988 if (newValue != null)
990 value = (int)newValue;
993 NUILog.Error("SiblingOrder should be bigger than 0 or equal to 0.");
996 var siblings = view.GetParent()?.Children;
997 if (siblings != null)
999 int currentOrder = siblings.IndexOf(view);
1000 if (value != currentOrder)
1002 if (value == 0) { view.LowerToBottom(); }
1003 else if (value < siblings.Count - 1)
1005 if (value > currentOrder) { view.RaiseAbove(siblings[value]); }
1006 else { view.LowerBelow(siblings[value]); }
1008 else { view.RaiseToTop(); }
1013 defaultValueCreator: (bindable) =>
1015 var view = (View)bindable;
1016 var parentChildren = view.GetParent()?.Children;
1017 int currentOrder = 0;
1018 if (parentChildren != null)
1020 currentOrder = parentChildren.IndexOf(view);
1022 if (currentOrder < 0) { return 0; }
1023 else if (currentOrder < parentChildren.Count) { return currentOrder; }
1029 // ParentOriginProperty
1030 internal static void SetInternalParentOriginProperty(BindableObject bindable, object oldValue, object newValue)
1032 var view = (View)bindable;
1033 if (newValue != null)
1035 Object.InternalSetPropertyVector3(view.SwigCPtr, View.Property.ParentOrigin, ((Position)newValue).SwigCPtr);
1039 internal static object GetInternalParentOriginProperty(BindableObject bindable)
1041 var view = (View)bindable;
1042 Position temp = new Position(0.0f, 0.0f, 0.0f);
1043 Object.InternalRetrievingPropertyVector3(view.SwigCPtr, View.Property.ParentOrigin, temp.SwigCPtr);
1048 /// ParentOriginProperty
1050 [EditorBrowsable(EditorBrowsableState.Never)]
1052 internal static BindableProperty GetParentOriginProperty()
1054 if (ParentOriginProperty == null)
1056 ParentOriginProperty = BindableProperty.Create(nameof(ParentOrigin), typeof(Position), typeof(View), null,
1057 propertyChanged: SetInternalParentOriginProperty, defaultValueCreator: GetInternalParentOriginProperty);
1059 return ParentOriginProperty;
1062 public static BindableProperty ParentOriginProperty = null;
1064 public static readonly BindableProperty ParentOriginProperty = null;
1067 // PivotPointProperty
1068 internal static void SetInternalPivotPointProperty(BindableObject bindable, object oldValue, object newValue)
1070 var view = (View)bindable;
1071 if (newValue != null)
1073 view.SetAnchorPoint((Position)newValue);
1077 internal static object GetInternalPivotPointProperty(BindableObject bindable)
1079 var view = (View)bindable;
1080 if (view.internalPivotPoint == null)
1082 view.internalPivotPoint = new Position(view.OnPivotPointChanged, 0, 0, 0);
1084 Object.InternalRetrievingPropertyVector3(view.SwigCPtr, View.Property.AnchorPoint, view.internalPivotPoint.SwigCPtr);
1085 return view.internalPivotPoint;
1089 /// PivotPointProperty
1091 [EditorBrowsable(EditorBrowsableState.Never)]
1093 internal static BindableProperty GetPivotPointProperty()
1095 if (PivotPointProperty == null)
1097 PivotPointProperty = BindableProperty.Create(nameof(PivotPoint), typeof(Position), typeof(View), null,
1098 propertyChanged: SetInternalPivotPointProperty, defaultValueCreator: GetInternalPivotPointProperty);
1100 return PivotPointProperty;
1103 public static BindableProperty PivotPointProperty = null;
1105 public static readonly BindableProperty PivotPointProperty = null;
1108 // SizeWidthProperty
1109 internal static void SetInternalSizeWidthProperty(BindableObject bindable, object oldValue, object newValue)
1111 var view = (View)bindable;
1112 if (newValue != null)
1114 // Size property setter is only used by user.
1115 // Framework code uses SetSize() instead of Size property setter.
1116 // Size set by user is returned by GetUserSize2D() for SuggestedMinimumWidth/Height.
1117 // SuggestedMinimumWidth/Height is used by Layout calculation.
1118 float width = (float)newValue;
1119 view.userSizeWidth = width;
1121 // To avoid duplicated size setup, change internal policy directly.
1122 int widthPolicy = (int)System.Math.Ceiling(width);
1123 if (view.widthPolicy != widthPolicy)
1125 view.widthPolicy = widthPolicy;
1126 view.layout?.RequestLayout();
1129 Object.InternalSetPropertyFloat(view.SwigCPtr, View.Property.SizeWidth, width);
1133 internal static object GetInternalSizeWidthProperty(BindableObject bindable)
1135 var view = (View)bindable;
1136 return Object.InternalGetPropertyFloat(view.SwigCPtr, View.Property.SizeWidth);
1140 /// SizeWidthProperty
1142 [EditorBrowsable(EditorBrowsableState.Never)]
1144 internal static BindableProperty GetSizeWidthProperty()
1146 if (SizeWidthProperty == null)
1148 SizeWidthProperty = BindableProperty.Create(nameof(SizeWidth), typeof(float), typeof(View), default(float),
1149 propertyChanged: SetInternalSizeWidthProperty, defaultValueCreator: GetInternalSizeWidthProperty);
1151 return SizeWidthProperty;
1154 public static BindableProperty SizeWidthProperty = null;
1156 public static readonly BindableProperty SizeWidthProperty = null;
1159 // SizeHeightProperty
1160 internal static void SetInternalSizeHeightProperty(BindableObject bindable, object oldValue, object newValue)
1162 var view = (View)bindable;
1163 if (newValue != null)
1165 // Size property setter is only used by user.
1166 // Framework code uses SetSize() instead of Size property setter.
1167 // Size set by user is returned by GetUserSize2D() for SuggestedMinimumWidth/Height.
1168 // SuggestedMinimumWidth/Height is used by Layout calculation.
1169 float height = (float)newValue;
1170 view.userSizeHeight = height;
1172 // To avoid duplicated size setup, change internal policy directly.
1173 int heightPolicy = (int)System.Math.Ceiling(height);
1174 if (view.heightPolicy != heightPolicy)
1176 view.heightPolicy = heightPolicy;
1177 view.layout?.RequestLayout();
1180 Object.InternalSetPropertyFloat(view.SwigCPtr, View.Property.SizeHeight, height);
1184 internal static object GetInternalSizeHeightProperty(BindableObject bindable)
1186 var view = (View)bindable;
1187 return Object.InternalGetPropertyFloat(view.SwigCPtr, View.Property.SizeHeight);
1191 /// SizeHeightProperty
1193 [EditorBrowsable(EditorBrowsableState.Never)]
1195 internal static BindableProperty GetSizeHeightProperty()
1197 if (SizeHeightProperty == null)
1199 SizeHeightProperty = BindableProperty.Create(nameof(SizeHeight), typeof(float), typeof(View), default(float),
1200 propertyChanged: SetInternalSizeHeightProperty, defaultValueCreator: GetInternalSizeHeightProperty);
1202 return SizeHeightProperty;
1205 public static BindableProperty SizeHeightProperty = null;
1207 public static readonly BindableProperty SizeHeightProperty = null;
1211 internal static void SetInternalPositionProperty(BindableObject bindable, object oldValue, object newValue)
1213 var view = (View)bindable;
1214 if (newValue != null)
1216 Object.InternalSetPropertyVector3(view.SwigCPtr, View.Property.POSITION, ((Position)newValue).SwigCPtr);
1220 internal static object GetInternalPositionProperty(BindableObject bindable)
1222 var view = (View)bindable;
1223 if (view.internalPosition == null)
1225 view.internalPosition = new Position(view.OnPositionChanged, 0, 0, 0);
1227 Object.InternalRetrievingPropertyVector3(view.SwigCPtr, View.Property.POSITION, view.internalPosition.SwigCPtr);
1228 return view.internalPosition;
1232 /// PositionProperty
1234 [EditorBrowsable(EditorBrowsableState.Never)]
1236 internal static BindableProperty GetPositionProperty()
1238 if (PositionProperty == null)
1240 PositionProperty = BindableProperty.Create(nameof(Position), typeof(Position), typeof(View), null,
1241 propertyChanged: SetInternalPositionProperty, defaultValueCreator: GetInternalPositionProperty);
1243 return PositionProperty;
1246 public static BindableProperty PositionProperty = null;
1248 public static readonly BindableProperty PositionProperty = null;
1251 // PositionXProperty
1252 internal static void SetInternalPositionXProperty(BindableObject bindable, object oldValue, object newValue)
1254 var view = (View)bindable;
1255 if (newValue != null)
1257 Object.InternalSetPropertyFloat(view.SwigCPtr, View.Property.PositionX, (float)newValue);
1261 internal static object GetInternalPositionXProperty(BindableObject bindable)
1263 var view = (View)bindable;
1264 return Object.InternalGetPropertyFloat(view.SwigCPtr, View.Property.PositionX);
1268 /// PositionXProperty
1270 [EditorBrowsable(EditorBrowsableState.Never)]
1272 internal static BindableProperty GetPositionXProperty()
1274 if (PositionXProperty == null)
1276 PositionXProperty = BindableProperty.Create(nameof(PositionX), typeof(float), typeof(View), default(float),
1277 propertyChanged: SetInternalPositionXProperty, defaultValueCreator: GetInternalPositionXProperty);
1279 return PositionXProperty;
1282 public static BindableProperty PositionXProperty = null;
1284 public static readonly BindableProperty PositionXProperty = null;
1287 // PositionYProperty
1288 internal static void SetInternalPositionYProperty(BindableObject bindable, object oldValue, object newValue)
1290 var view = (View)bindable;
1291 if (newValue != null)
1293 Object.InternalSetPropertyFloat(view.SwigCPtr, View.Property.PositionY, (float)newValue);
1297 internal static object GetInternalPositionYProperty(BindableObject bindable)
1299 var view = (View)bindable;
1300 return Object.InternalGetPropertyFloat(view.SwigCPtr, View.Property.PositionY);
1304 /// PositionYProperty
1306 [EditorBrowsable(EditorBrowsableState.Never)]
1308 internal static BindableProperty GetPositionYProperty()
1310 if (PositionYProperty == null)
1312 PositionYProperty = BindableProperty.Create(nameof(PositionY), typeof(float), typeof(View), default(float),
1313 propertyChanged: SetInternalPositionYProperty, defaultValueCreator: GetInternalPositionYProperty);
1315 return PositionYProperty;
1318 public static BindableProperty PositionYProperty = null;
1320 public static readonly BindableProperty PositionYProperty = null;
1322 internal static void SetInternalPositionZProperty(BindableObject bindable, object oldValue, object newValue)
1324 var view = (View)bindable;
1325 if (newValue != null)
1327 Object.InternalSetPropertyFloat(view.SwigCPtr, View.Property.PositionZ, (float)newValue);
1332 // PositionZProperty
1333 internal static object GetInternalPositionZProperty(BindableObject bindable)
1335 var view = (View)bindable;
1336 return Object.InternalGetPropertyFloat(view.SwigCPtr, View.Property.PositionZ);
1340 /// PositionZProperty
1342 [EditorBrowsable(EditorBrowsableState.Never)]
1344 internal static BindableProperty GetPositionZProperty()
1346 if (PositionZProperty == null)
1348 PositionZProperty = BindableProperty.Create(nameof(PositionZ), typeof(float), typeof(View), default(float),
1349 propertyChanged: SetInternalPositionZProperty, defaultValueCreator: GetInternalPositionZProperty);
1351 return PositionZProperty;
1354 public static BindableProperty PositionZProperty = null;
1356 public static readonly BindableProperty PositionZProperty = null;
1359 /// OrientationProperty
1361 [EditorBrowsable(EditorBrowsableState.Never)]
1362 public static readonly BindableProperty OrientationProperty = BindableProperty.Create(nameof(Orientation), typeof(Rotation), typeof(View), null, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) =>
1364 var view = (View)bindable;
1365 if (newValue != null)
1367 Tizen.NUI.Object.SetProperty((System.Runtime.InteropServices.HandleRef)view.SwigCPtr, View.Property.ORIENTATION, new Tizen.NUI.PropertyValue((Rotation)newValue));
1370 defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
1372 var view = (View)bindable;
1373 Rotation temp = new Rotation();
1374 Tizen.NUI.Object.GetProperty((System.Runtime.InteropServices.HandleRef)view.SwigCPtr, View.Property.ORIENTATION).Get(temp);
1378 internal static void SetInternalScaleProperty(BindableObject bindable, object oldValue, object newValue)
1380 var view = (View)bindable;
1381 if (newValue != null)
1383 view.SetScale((Vector3)newValue);
1389 internal static object GetInternalScaleProperty(BindableObject bindable)
1391 var view = (View)bindable;
1392 if (view.internalScale == null)
1394 view.internalScale = new Vector3(view.OnScaleChanged, 0, 0, 0);
1396 Object.InternalRetrievingPropertyVector3(view.SwigCPtr, View.Property.SCALE, view.internalScale.SwigCPtr);
1397 return view.internalScale;
1403 [EditorBrowsable(EditorBrowsableState.Never)]
1405 internal static BindableProperty GetScaleProperty()
1407 if (ScaleProperty == null)
1409 ScaleProperty = BindableProperty.Create(nameof(Scale), typeof(Vector3), typeof(View), null,
1410 propertyChanged: SetInternalScaleProperty, defaultValueCreator: GetInternalScaleProperty);
1412 return ScaleProperty;
1415 public static BindableProperty ScaleProperty = null;
1417 public static readonly BindableProperty ScaleProperty = null;
1421 internal static void SetInternalScaleXProperty(BindableObject bindable, object oldValue, object newValue)
1423 var view = (View)bindable;
1424 if (newValue != null)
1426 Object.InternalSetPropertyFloat(view.SwigCPtr, View.Property.ScaleX, (float)newValue);
1430 internal static object GetInternalScaleXProperty(BindableObject bindable)
1432 var view = (View)bindable;
1433 return Object.InternalGetPropertyFloat(view.SwigCPtr, View.Property.ScaleX);
1439 [EditorBrowsable(EditorBrowsableState.Never)]
1441 internal static BindableProperty GetScaleXProperty()
1443 if (ScaleXProperty == null)
1445 ScaleXProperty = BindableProperty.Create(nameof(ScaleX), typeof(float), typeof(View), default(float),
1446 propertyChanged: SetInternalScaleXProperty, defaultValueCreator: GetInternalScaleXProperty);
1448 return ScaleXProperty;
1451 public static BindableProperty ScaleXProperty = null;
1453 public static readonly BindableProperty ScaleXProperty = null;
1457 internal static void SetInternalScaleYProperty(BindableObject bindable, object oldValue, object newValue)
1459 var view = (View)bindable;
1460 if (newValue != null)
1462 Object.InternalSetPropertyFloat(view.SwigCPtr, View.Property.ScaleY, (float)newValue);
1466 internal static object GetInternalScaleYProperty(BindableObject bindable)
1468 var view = (View)bindable;
1469 return Object.InternalGetPropertyFloat(view.SwigCPtr, View.Property.ScaleY);
1475 [EditorBrowsable(EditorBrowsableState.Never)]
1477 internal static BindableProperty GetScaleYProperty()
1479 if (ScaleYProperty == null)
1481 ScaleYProperty = BindableProperty.Create(nameof(ScaleY), typeof(float), typeof(View), default(float),
1482 propertyChanged: SetInternalScaleYProperty, defaultValueCreator: GetInternalScaleYProperty);
1484 return ScaleYProperty;
1487 public static BindableProperty ScaleYProperty = null;
1489 public static readonly BindableProperty ScaleYProperty = null;
1493 internal static void SetInternalScaleZProperty(BindableObject bindable, object oldValue, object newValue)
1495 var view = (View)bindable;
1496 if (newValue != null)
1498 Object.InternalSetPropertyFloat(view.SwigCPtr, View.Property.ScaleZ, (float)newValue);
1502 internal static object GetInternalScaleZProperty(BindableObject bindable)
1504 var view = (View)bindable;
1505 return Object.InternalGetPropertyFloat(view.SwigCPtr, View.Property.ScaleZ);
1511 [EditorBrowsable(EditorBrowsableState.Never)]
1513 internal static BindableProperty GetScaleZProperty()
1515 if (ScaleZProperty == null)
1517 ScaleZProperty = BindableProperty.Create(nameof(ScaleZ), typeof(float), typeof(View), default(float),
1518 propertyChanged: SetInternalScaleZProperty, defaultValueCreator: GetInternalScaleZProperty);
1520 return ScaleZProperty;
1523 public static BindableProperty ScaleZProperty = null;
1525 public static readonly BindableProperty ScaleZProperty = null;
1529 internal static void SetInternalNameProperty(BindableObject bindable, object oldValue, object newValue)
1531 var view = (View)bindable;
1532 if (newValue != null)
1534 view.internalName = (string)newValue;
1535 Object.InternalSetPropertyString(view.SwigCPtr, View.Property.NAME, (string)newValue);
1539 internal static object GetInternalNameProperty(BindableObject bindable)
1541 var view = (View)bindable;
1542 return view.internalName;
1548 [EditorBrowsable(EditorBrowsableState.Never)]
1550 internal static BindableProperty GetNameProperty()
1552 if (NameProperty == null)
1554 NameProperty = BindableProperty.Create(nameof(Name), typeof(string), typeof(View), string.Empty,
1555 propertyChanged: SetInternalNameProperty, defaultValueCreator: GetInternalNameProperty);
1557 return NameProperty;
1560 public static BindableProperty NameProperty = null;
1562 public static readonly BindableProperty NameProperty = null;
1565 /// SensitiveProperty
1567 [EditorBrowsable(EditorBrowsableState.Never)]
1568 public static readonly BindableProperty SensitiveProperty = BindableProperty.Create(nameof(Sensitive), typeof(bool), typeof(View), false, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) =>
1570 var view = (View)bindable;
1571 if (newValue != null)
1573 Object.InternalSetPropertyBool(view.SwigCPtr, View.Property.SENSITIVE, (bool)newValue);
1576 defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
1578 var view = (View)bindable;
1579 return Object.InternalGetPropertyBool(view.SwigCPtr, View.Property.SENSITIVE);
1583 /// IsEnabledProperty
1585 [EditorBrowsable(EditorBrowsableState.Never)]
1586 public static readonly BindableProperty IsEnabledProperty = BindableProperty.Create(nameof(IsEnabled), typeof(bool), typeof(View), false, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) =>
1588 var view = (View)bindable;
1589 if (newValue != null)
1591 Object.InternalSetPropertyBool(view.SwigCPtr, View.Property.UserInteractionEnabled, (bool)newValue);
1592 view.OnEnabled((bool)newValue);
1595 defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
1597 var view = (View)bindable;
1598 return Object.InternalGetPropertyBool(view.SwigCPtr, View.Property.UserInteractionEnabled);
1602 /// DispatchKeyEventsProperty
1604 [EditorBrowsable(EditorBrowsableState.Never)]
1605 public static readonly BindableProperty DispatchKeyEventsProperty = BindableProperty.Create(nameof(DispatchKeyEvents), typeof(bool), typeof(View), false, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) =>
1607 var view = (View)bindable;
1608 if (newValue != null)
1610 Object.InternalSetPropertyBool(view.SwigCPtr, View.Property.DispatchKeyEvents, (bool)newValue);
1613 defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
1615 var view = (View)bindable;
1616 return Object.InternalGetPropertyBool(view.SwigCPtr, View.Property.DispatchKeyEvents);
1620 /// LeaveRequiredProperty
1622 [EditorBrowsable(EditorBrowsableState.Never)]
1623 public static readonly BindableProperty LeaveRequiredProperty = BindableProperty.Create(nameof(LeaveRequired), typeof(bool), typeof(View), false, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) =>
1625 var view = (View)bindable;
1626 if (newValue != null)
1628 Object.InternalSetPropertyBool(view.SwigCPtr, View.Property.LeaveRequired, (bool)newValue);
1631 defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
1633 var view = (View)bindable;
1634 return Object.InternalGetPropertyBool(view.SwigCPtr, View.Property.LeaveRequired);
1638 /// InheritOrientationProperty
1640 [EditorBrowsable(EditorBrowsableState.Never)]
1641 public static readonly BindableProperty InheritOrientationProperty = BindableProperty.Create(nameof(InheritOrientation), typeof(bool), typeof(View), false, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) =>
1643 var view = (View)bindable;
1644 if (newValue != null)
1646 Object.InternalSetPropertyBool(view.SwigCPtr, View.Property.InheritOrientation, (bool)newValue);
1649 defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
1651 var view = (View)bindable;
1652 return Object.InternalGetPropertyBool(view.SwigCPtr, View.Property.InheritOrientation);
1656 /// InheritScaleProperty
1658 [EditorBrowsable(EditorBrowsableState.Never)]
1659 public static readonly BindableProperty InheritScaleProperty = BindableProperty.Create(nameof(InheritScale), typeof(bool), typeof(View), false, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) =>
1661 var view = (View)bindable;
1662 if (newValue != null)
1664 Object.InternalSetPropertyBool(view.SwigCPtr, View.Property.InheritScale, (bool)newValue);
1667 defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
1669 var view = (View)bindable;
1670 return Object.InternalGetPropertyBool(view.SwigCPtr, View.Property.InheritScale);
1674 /// DrawModeProperty
1676 [EditorBrowsable(EditorBrowsableState.Never)]
1677 public static readonly BindableProperty DrawModeProperty = BindableProperty.Create(nameof(DrawMode), typeof(DrawModeType), typeof(View), DrawModeType.Normal, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) =>
1679 var view = (View)bindable;
1680 if (newValue != null)
1682 Object.InternalSetPropertyInt(view.SwigCPtr, View.Property.DrawMode, (int)newValue);
1685 defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
1687 var view = (View)bindable;
1688 return (DrawModeType)Object.InternalGetPropertyInt(view.SwigCPtr, View.Property.DrawMode);
1691 internal static void SetInternalSizeModeFactorProperty(BindableObject bindable, object oldValue, object newValue)
1693 var view = (View)bindable;
1694 if (newValue != null)
1696 Object.InternalSetPropertyVector3(view.SwigCPtr, View.Property.SizeModeFactor, ((Vector3)newValue).SwigCPtr);
1701 // SizeModeFactorProperty
1702 internal static object GetInternalSizeModeFactorProperty(BindableObject bindable)
1704 var view = (View)bindable;
1705 if (view.internalSizeModeFactor == null)
1707 view.internalSizeModeFactor = new Vector3(view.OnSizeModeFactorChanged, 0, 0, 0);
1709 Object.InternalRetrievingPropertyVector3(view.SwigCPtr, View.Property.SizeModeFactor, view.internalSizeModeFactor.SwigCPtr);
1710 return view.internalSizeModeFactor;
1714 /// SizeModeFactorProperty
1716 [EditorBrowsable(EditorBrowsableState.Never)]
1718 internal static BindableProperty GetSizeModeFactorProperty()
1720 if (SizeModeFactorProperty == null)
1722 SizeModeFactorProperty = BindableProperty.Create(nameof(SizeModeFactor), typeof(Vector3), typeof(View), null,
1723 propertyChanged: SetInternalSizeModeFactorProperty, defaultValueCreator: GetInternalSizeModeFactorProperty);
1725 return SizeModeFactorProperty;
1728 public static BindableProperty SizeModeFactorProperty = null;
1730 public static readonly BindableProperty SizeModeFactorProperty = null;
1733 /// WidthResizePolicyProperty
1735 [EditorBrowsable(EditorBrowsableState.Never)]
1736 public static readonly BindableProperty WidthResizePolicyProperty = BindableProperty.Create(nameof(WidthResizePolicy), typeof(ResizePolicyType), typeof(View), ResizePolicyType.Fixed, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) =>
1738 var view = (View)bindable;
1739 if (newValue != null)
1741 if ((ResizePolicyType)newValue == ResizePolicyType.KeepSizeFollowingParent)
1743 if (view.widthConstraint == null)
1745 view.widthConstraint = new EqualConstraintWithParentFloat((System.Runtime.InteropServices.HandleRef)view.SwigCPtr, View.Property.SizeWidth, View.Property.SizeWidth);
1746 view.widthConstraint.Apply();
1748 Object.InternalSetPropertyInt(view.SwigCPtr, View.Property.WidthResizePolicy, (int)ResizePolicyType.FillToParent);
1752 view.widthConstraint?.Remove();
1753 view.widthConstraint?.Dispose();
1754 view.widthConstraint = null;
1756 Object.InternalSetPropertyInt(view.SwigCPtr, View.Property.WidthResizePolicy, (int)newValue);
1758 // Match ResizePolicy to new Layouting.
1759 // Parent relative policies can not be mapped at this point as parent size unknown.
1760 switch ((ResizePolicyType)newValue)
1762 case ResizePolicyType.UseNaturalSize:
1764 view.WidthSpecification = LayoutParamPolicies.WrapContent;
1767 case ResizePolicyType.FillToParent:
1769 view.WidthSpecification = LayoutParamPolicies.MatchParent;
1772 case ResizePolicyType.FitToChildren:
1774 view.WidthSpecification = LayoutParamPolicies.WrapContent;
1782 defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
1784 var view = (View)bindable;
1787 temp = Object.InternalGetPropertyString(view.SwigCPtr, View.Property.WidthResizePolicy);
1788 return temp.GetValueByDescription<ResizePolicyType>();
1792 /// HeightResizePolicyProperty
1794 [EditorBrowsable(EditorBrowsableState.Never)]
1795 public static readonly BindableProperty HeightResizePolicyProperty = BindableProperty.Create(nameof(HeightResizePolicy), typeof(ResizePolicyType), typeof(View), ResizePolicyType.Fixed, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) =>
1797 var view = (View)bindable;
1798 if (newValue != null)
1800 if ((ResizePolicyType)newValue == ResizePolicyType.KeepSizeFollowingParent)
1802 if (view.heightConstraint == null)
1804 view.heightConstraint = new EqualConstraintWithParentFloat((System.Runtime.InteropServices.HandleRef)view.SwigCPtr, View.Property.SizeHeight, View.Property.SizeHeight);
1805 view.heightConstraint.Apply();
1808 Object.InternalSetPropertyInt(view.SwigCPtr, View.Property.HeightResizePolicy, (int)ResizePolicyType.FillToParent);
1812 view.heightConstraint?.Remove();
1813 view.heightConstraint?.Dispose();
1814 view.heightConstraint = null;
1816 Object.InternalSetPropertyInt(view.SwigCPtr, View.Property.HeightResizePolicy, (int)newValue);
1818 // Match ResizePolicy to new Layouting.
1819 // Parent relative policies can not be mapped at this point as parent size unknown.
1820 switch ((ResizePolicyType)newValue)
1822 case ResizePolicyType.UseNaturalSize:
1824 view.HeightSpecification = LayoutParamPolicies.WrapContent;
1827 case ResizePolicyType.FillToParent:
1829 view.HeightSpecification = LayoutParamPolicies.MatchParent;
1832 case ResizePolicyType.FitToChildren:
1834 view.HeightSpecification = LayoutParamPolicies.WrapContent;
1842 defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
1844 var view = (View)bindable;
1847 temp = Object.InternalGetPropertyString(view.SwigCPtr, View.Property.HeightResizePolicy);
1848 return temp.GetValueByDescription<ResizePolicyType>();
1852 /// SizeScalePolicyProperty
1854 [EditorBrowsable(EditorBrowsableState.Never)]
1855 public static readonly BindableProperty SizeScalePolicyProperty = BindableProperty.Create(nameof(SizeScalePolicy), typeof(SizeScalePolicyType), typeof(View), SizeScalePolicyType.UseSizeSet, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) =>
1857 var view = (View)bindable;
1858 string valueToString = "";
1859 if (newValue != null)
1861 valueToString = ((SizeScalePolicyType)newValue).GetDescription();
1863 Object.InternalSetPropertyString(view.SwigCPtr, View.Property.SizeScalePolicy, valueToString);
1866 defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
1868 var view = (View)bindable;
1870 return (SizeScalePolicyType)Object.InternalGetPropertyInt(view.SwigCPtr, View.Property.SizeScalePolicy);
1874 /// WidthForHeightProperty
1876 [EditorBrowsable(EditorBrowsableState.Never)]
1877 public static readonly BindableProperty WidthForHeightProperty = BindableProperty.Create(nameof(WidthForHeight), typeof(bool), typeof(View), false, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) =>
1879 var view = (View)bindable;
1880 if (newValue != null)
1882 Object.InternalSetPropertyBool(view.SwigCPtr, View.Property.WidthForHeight, (bool)newValue);
1885 defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
1887 var view = (View)bindable;
1889 return Object.InternalGetPropertyBool(view.SwigCPtr, View.Property.WidthForHeight);
1893 /// HeightForWidthProperty
1895 [EditorBrowsable(EditorBrowsableState.Never)]
1896 public static readonly BindableProperty HeightForWidthProperty = BindableProperty.Create(nameof(HeightForWidth), typeof(bool), typeof(View), false, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) =>
1898 var view = (View)bindable;
1899 if (newValue != null)
1902 Object.InternalSetPropertyBool(view.SwigCPtr, View.Property.HeightForWidth, (bool)newValue);
1905 defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
1907 var view = (View)bindable;
1909 return Object.InternalGetPropertyBool(view.SwigCPtr, View.Property.HeightForWidth);
1913 internal static void SetInternalPaddingProperty(BindableObject bindable, object oldValue, object newValue)
1915 var view = (View)bindable;
1916 if (newValue != null)
1918 if (view.Layout != null)
1920 view.Layout.Padding = new Extents((Extents)newValue);
1921 if ((view.Padding.Start != 0) || (view.Padding.End != 0) || (view.Padding.Top != 0) || (view.Padding.Bottom != 0))
1923 var tmp = new PropertyValue(new Extents(0, 0, 0, 0));
1924 Object.SetProperty(view.SwigCPtr, Property.PADDING, tmp);
1927 view.Layout.RequestLayout();
1931 var tmp = new PropertyValue((Extents)newValue);
1932 Object.SetProperty(view.SwigCPtr, Property.PADDING, tmp);
1938 internal static object GetInternalPaddingProperty(BindableObject bindable)
1940 var view = (View)bindable;
1941 if ((view.internalPadding == null) || (view.Layout != null))
1943 ushort start = 0, end = 0, top = 0, bottom = 0;
1944 if (view.Layout != null)
1946 if (view.Layout.Padding != null)
1948 start = view.Layout.Padding.Start;
1949 end = view.Layout.Padding.End;
1950 top = view.Layout.Padding.Top;
1951 bottom = view.Layout.Padding.Bottom;
1954 view.internalPadding = new Extents(view.OnPaddingChanged, start, end, top, bottom);
1957 if (view.Layout == null)
1959 var tmp = Object.GetProperty(view.SwigCPtr, Property.PADDING);
1960 tmp?.Get(view.internalPadding);
1964 return view.internalPadding;
1970 [EditorBrowsable(EditorBrowsableState.Never)]
1972 internal static BindableProperty GetPaddingProperty()
1974 if (PaddingProperty == null)
1976 PaddingProperty = BindableProperty.Create(nameof(Padding), typeof(Extents), typeof(View), null,
1977 propertyChanged: SetInternalPaddingProperty, defaultValueCreator: GetInternalPaddingProperty);
1979 return PaddingProperty;
1982 public static BindableProperty PaddingProperty = null;
1984 public static readonly BindableProperty PaddingProperty = null;
1988 internal static void SetInternalSizeProperty(BindableObject bindable, object oldValue, object newValue)
1990 var view = (View)bindable;
1991 if (newValue != null)
1993 // Size property setter is only used by user.
1994 // Framework code uses SetSize() instead of Size property setter.
1995 // Size set by user is returned by GetUserSize2D() for SuggestedMinimumWidth/Height.
1996 // SuggestedMinimumWidth/Height is used by Layout calculation.
1997 float width = ((Size)newValue).Width;
1998 float height = ((Size)newValue).Height;
1999 float depth = ((Size)newValue).Depth;
2001 view.userSizeWidth = width;
2002 view.userSizeHeight = height;
2004 // Set Specification so when layouts measure this View it matches the value set here.
2005 // All Views are currently Layouts.
2006 int widthPolicy = (int)System.Math.Ceiling(width);
2007 int heightPolicy = (int)System.Math.Ceiling(height);
2009 bool relayoutRequired = false;
2010 // To avoid duplicated size setup, change internal policy directly.
2011 if (view.widthPolicy != widthPolicy)
2013 view.widthPolicy = widthPolicy;
2014 relayoutRequired = true;
2016 if (view.heightPolicy != heightPolicy)
2018 view.heightPolicy = heightPolicy;
2019 relayoutRequired = true;
2021 if (relayoutRequired)
2023 view.layout?.RequestLayout();
2026 view.SetSize(width, height, depth);
2030 internal static object GetInternalSizeProperty(BindableObject bindable)
2032 var view = (View)bindable;
2034 if (view.internalSize == null)
2036 view.internalSize = new Size(view.OnSizeChanged, 0, 0, 0);
2038 Object.InternalRetrievingPropertyVector3(view.SwigCPtr, View.Property.SIZE, view.internalSize.SwigCPtr);
2040 return view.internalSize;
2046 [EditorBrowsable(EditorBrowsableState.Never)]
2048 internal static BindableProperty GetSizeProperty()
2050 if (SizeProperty == null)
2052 SizeProperty = BindableProperty.Create(nameof(Size), typeof(Size), typeof(View), null,
2053 propertyChanged: SetInternalSizeProperty, defaultValueCreator: GetInternalSizeProperty);
2055 return SizeProperty;
2058 public static BindableProperty SizeProperty = null;
2060 public static readonly BindableProperty SizeProperty = null;
2063 // MinimumSizeProperty
2064 internal static void SetInternalMinimumSizeProperty(BindableObject bindable, object oldValue, object newValue)
2066 var view = (View)bindable;
2067 if (newValue != null)
2070 Object.InternalSetPropertyVector2(view.SwigCPtr, View.Property.MinimumSize, ((Size2D)newValue).SwigCPtr);
2074 internal static object GetInternalMinimumSizeProperty(BindableObject bindable)
2077 var view = (View)bindable;
2078 if (view.internalMinimumSize == null)
2080 view.internalMinimumSize = new Size2D(view.OnMinimumSizeChanged, 0, 0);
2082 Object.InternalRetrievingPropertyVector2(view.SwigCPtr, View.Property.MinimumSize, view.internalMinimumSize.SwigCPtr);
2083 return view.internalMinimumSize;
2087 /// MinimumSizeProperty
2089 [EditorBrowsable(EditorBrowsableState.Never)]
2091 internal static BindableProperty GetMinimumSizeProperty()
2093 if (MinimumSizeProperty == null)
2095 MinimumSizeProperty = BindableProperty.Create(nameof(MinimumSize), typeof(Size2D), typeof(View), null,
2096 propertyChanged: SetInternalMinimumSizeProperty, defaultValueCreator: GetInternalMinimumSizeProperty);
2098 return MinimumSizeProperty;
2101 public static BindableProperty MinimumSizeProperty = null;
2103 public static readonly BindableProperty MinimumSizeProperty = null;
2106 // MaximumSizeProperty
2107 internal static void SetInternalMaximumSizeProperty(BindableObject bindable, object oldValue, object newValue)
2109 var view = (View)bindable;
2110 if (newValue != null)
2113 Object.InternalSetPropertyVector2(view.SwigCPtr, View.Property.MaximumSize, ((Size2D)newValue).SwigCPtr);
2117 internal static object GetInternalMaximumSizeProperty(BindableObject bindable)
2119 var view = (View)bindable;
2121 if (view.internalMaximumSize == null)
2123 view.internalMaximumSize = new Size2D(view.OnMaximumSizeChanged, 0, 0);
2125 Object.InternalRetrievingPropertyVector2(view.SwigCPtr, View.Property.MaximumSize, view.internalMaximumSize.SwigCPtr);
2126 return view.internalMaximumSize;
2130 /// MaximumSizeProperty
2132 [EditorBrowsable(EditorBrowsableState.Never)]
2134 internal static BindableProperty GetMaximumSizeProperty()
2136 if (MaximumSizeProperty == null)
2138 MaximumSizeProperty = BindableProperty.Create(nameof(MaximumSize), typeof(Size2D), typeof(View), null,
2139 propertyChanged: SetInternalMaximumSizeProperty, defaultValueCreator: GetInternalMaximumSizeProperty);
2141 return MaximumSizeProperty;
2144 public static BindableProperty MaximumSizeProperty = null;
2146 public static readonly BindableProperty MaximumSizeProperty = null;
2150 /// InheritPositionProperty
2152 [EditorBrowsable(EditorBrowsableState.Never)]
2153 public static readonly BindableProperty InheritPositionProperty = BindableProperty.Create(nameof(InheritPosition), typeof(bool), typeof(View), false, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) =>
2155 var view = (View)bindable;
2156 if (newValue != null)
2158 Object.InternalSetPropertyBool(view.SwigCPtr, View.Property.InheritPosition, (bool)newValue);
2161 defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
2163 var view = (View)bindable;
2165 return Object.InternalGetPropertyBool(view.SwigCPtr, View.Property.InheritPosition);
2169 /// ClippingModeProperty
2171 [EditorBrowsable(EditorBrowsableState.Never)]
2172 public static readonly BindableProperty ClippingModeProperty = BindableProperty.Create(nameof(ClippingMode), typeof(ClippingModeType), typeof(View), ClippingModeType.Disabled, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) =>
2174 var view = (View)bindable;
2175 if (newValue != null)
2178 Object.InternalSetPropertyInt(view.SwigCPtr, View.Property.ClippingMode, (int)newValue);
2181 defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
2183 var view = (View)bindable;
2185 return (ClippingModeType)Object.InternalGetPropertyInt(view.SwigCPtr, View.Property.ClippingMode);
2189 /// InheritLayoutDirectionProperty
2191 [EditorBrowsable(EditorBrowsableState.Never)]
2192 public static readonly BindableProperty InheritLayoutDirectionProperty = BindableProperty.Create(nameof(InheritLayoutDirection), typeof(bool), typeof(View), false, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) =>
2194 var view = (View)bindable;
2195 if (newValue != null)
2198 Object.InternalSetPropertyBool(view.SwigCPtr, View.Property.InheritLayoutDirection, (bool)newValue);
2201 defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
2203 var view = (View)bindable;
2205 return Object.InternalGetPropertyBool(view.SwigCPtr, View.Property.InheritLayoutDirection);
2209 /// LayoutDirectionProperty
2211 [EditorBrowsable(EditorBrowsableState.Never)]
2212 public static readonly BindableProperty LayoutDirectionProperty = BindableProperty.Create(nameof(LayoutDirection), typeof(ViewLayoutDirectionType), typeof(View), ViewLayoutDirectionType.LTR, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) =>
2214 var view = (View)bindable;
2215 if (newValue != null)
2218 Object.InternalSetPropertyInt(view.SwigCPtr, View.Property.LayoutDirection, (int)newValue);
2221 defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
2223 var view = (View)bindable;
2225 return (ViewLayoutDirectionType)Object.InternalGetPropertyInt(view.SwigCPtr, View.Property.LayoutDirection);
2229 internal static void SetInternalMarginProperty(BindableObject bindable, object oldValue, object newValue)
2231 var view = (View)bindable;
2232 if (newValue != null)
2234 if (view.Layout != null)
2236 view.Layout.Margin = new Extents((Extents)newValue);
2237 if ((view.Margin.Start != 0) || (view.Margin.End != 0) || (view.Margin.Top != 0) || (view.Margin.Bottom != 0))
2239 var tmp = new PropertyValue(new Extents(0, 0, 0, 0));
2240 Object.SetProperty(view.SwigCPtr, Property.MARGIN, tmp);
2243 view.Layout.RequestLayout();
2247 var tmp = new PropertyValue((Extents)newValue);
2248 Object.SetProperty(view.SwigCPtr, Property.MARGIN, tmp);
2254 internal static object GetInternalMarginProperty(BindableObject bindable)
2256 var view = (View)bindable;
2257 if ((view.internalMargin == null) || (view.Layout != null))
2259 ushort start = 0, end = 0, top = 0, bottom = 0;
2260 if (view.Layout != null)
2262 if (view.Layout.Margin != null)
2264 start = view.Layout.Margin.Start;
2265 end = view.Layout.Margin.End;
2266 top = view.Layout.Margin.Top;
2267 bottom = view.Layout.Margin.Bottom;
2270 view.internalMargin = new Extents(view.OnMarginChanged, start, end, top, bottom);
2273 if (view.Layout == null)
2276 var tmp = Object.GetProperty(view.SwigCPtr, Property.MARGIN);
2277 tmp?.Get(view.internalMargin);
2281 return view.internalMargin;
2287 [EditorBrowsable(EditorBrowsableState.Never)]
2289 internal static BindableProperty GetMarginProperty()
2291 if (MarginProperty == null)
2293 MarginProperty = BindableProperty.Create(nameof(Margin), typeof(Extents), typeof(View), null,
2294 propertyChanged: SetInternalMarginProperty, defaultValueCreator: GetInternalMarginProperty);
2296 return MarginProperty;
2299 public static BindableProperty MarginProperty = null;
2301 public static readonly BindableProperty MarginProperty = null;
2305 /// UpdateAreaHintProperty
2307 [EditorBrowsable(EditorBrowsableState.Never)]
2308 public static readonly BindableProperty UpdateAreaHintProperty = BindableProperty.Create(nameof(UpdateAreaHint), typeof(Vector4), typeof(View), null, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) =>
2310 var view = (View)bindable;
2311 if (newValue != null)
2314 Object.InternalSetPropertyVector4(view.SwigCPtr, Interop.ActorProperty.UpdateAreaHintGet(), ((Vector4)newValue).SwigCPtr);
2317 defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
2319 var view = (View)bindable;
2320 Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f);
2322 Object.InternalRetrievingPropertyVector4(view.SwigCPtr, Interop.ActorProperty.UpdateAreaHintGet(), temp.SwigCPtr);
2327 /// ImageShadow Property
2329 [EditorBrowsable(EditorBrowsableState.Never)]
2330 public static readonly BindableProperty ImageShadowProperty = BindableProperty.Create(nameof(ImageShadow), typeof(ImageShadow), typeof(View), null, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) =>
2332 var view = (View)bindable;
2334 view.themeData?.selectorData?.ClearShadow(view);
2336 if (newValue is Selector<ImageShadow> selector)
2338 if (selector.HasAll()) view.SetShadow(selector.All);
2339 else view.EnsureSelectorData().ImageShadow = new TriggerableSelector<ImageShadow>(view, selector, view.SetShadow, true);
2343 view.SetShadow((ImageShadow)newValue);
2346 defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
2348 var view = (View)bindable;
2350 // Sync as current properties
2351 view.UpdateBackgroundExtraData();
2353 PropertyMap map = new PropertyMap();
2354 Tizen.NUI.Object.GetProperty((System.Runtime.InteropServices.HandleRef)view.SwigCPtr, View.Property.SHADOW).Get(map);
2356 var shadow = new ImageShadow(map);
2357 return shadow.IsEmpty() ? null : shadow;
2363 [EditorBrowsable(EditorBrowsableState.Never)]
2364 public static readonly BindableProperty BoxShadowProperty = BindableProperty.Create(nameof(BoxShadow), typeof(Shadow), typeof(View), null, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) =>
2366 var view = (View)bindable;
2368 view.themeData?.selectorData?.ClearShadow(view);
2370 if (newValue is Selector<Shadow> selector)
2372 if (selector.HasAll()) view.SetShadow(selector.All);
2373 else view.EnsureSelectorData().BoxShadow = new TriggerableSelector<Shadow>(view, selector, view.SetShadow, true);
2377 view.SetShadow((Shadow)newValue);
2380 defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
2382 var view = (View)bindable;
2384 // Sync as current properties
2385 view.UpdateBackgroundExtraData();
2387 PropertyMap map = new PropertyMap();
2388 Tizen.NUI.Object.GetProperty((System.Runtime.InteropServices.HandleRef)view.SwigCPtr, View.Property.SHADOW).Get(map);
2390 var shadow = new Shadow(map);
2391 return shadow.IsEmpty() ? null : shadow;
2395 /// CornerRadius Property
2397 [EditorBrowsable(EditorBrowsableState.Never)]
2398 public static readonly BindableProperty CornerRadiusProperty = BindableProperty.Create(nameof(CornerRadius), typeof(Vector4), typeof(View), null, propertyChanged: (bindable, oldValue, newValue) =>
2400 var view = (View)bindable;
2401 (view.backgroundExtraData ?? (view.backgroundExtraData = new BackgroundExtraData())).CornerRadius = (Vector4)newValue;
2402 view.UpdateBackgroundExtraData(BackgroundExtraDataUpdatedFlag.CornerRadius);
2404 defaultValueCreator: (bindable) =>
2406 var view = (View)bindable;
2407 return view.backgroundExtraData == null ? 0.0f : view.backgroundExtraData.CornerRadius;
2411 /// CornerRadiusPolicy Property
2413 [EditorBrowsable(EditorBrowsableState.Never)]
2414 public static readonly BindableProperty CornerRadiusPolicyProperty = BindableProperty.Create(nameof(CornerRadiusPolicy), typeof(VisualTransformPolicyType), typeof(View), VisualTransformPolicyType.Absolute, propertyChanged: (bindable, oldValue, newValue) =>
2416 var view = (View)bindable;
2417 (view.backgroundExtraData ?? (view.backgroundExtraData = new BackgroundExtraData())).CornerRadiusPolicy = (VisualTransformPolicyType)newValue;
2419 if (view.backgroundExtraData.CornerRadius != null)
2421 view.UpdateBackgroundExtraData(BackgroundExtraDataUpdatedFlag.CornerRadius);
2424 defaultValueCreator: (bindable) =>
2426 var view = (View)bindable;
2427 return view.backgroundExtraData == null ? VisualTransformPolicyType.Absolute : view.backgroundExtraData.CornerRadiusPolicy;
2431 /// BorderlineWidth Property
2433 [EditorBrowsable(EditorBrowsableState.Never)]
2434 public static readonly BindableProperty BorderlineWidthProperty = BindableProperty.Create(nameof(BorderlineWidth), typeof(float), typeof(View), default(float), propertyChanged: (bindable, oldValue, newValue) =>
2436 var view = (View)bindable;
2437 (view.backgroundExtraData ?? (view.backgroundExtraData = new BackgroundExtraData())).BorderlineWidth = (float)newValue;
2438 view.UpdateBackgroundExtraData(BackgroundExtraDataUpdatedFlag.Borderline);
2440 defaultValueCreator: (bindable) =>
2442 var view = (View)bindable;
2443 return view.backgroundExtraData == null ? 0.0f : view.backgroundExtraData.BorderlineWidth;
2447 /// BorderlineColor Property
2449 [EditorBrowsable(EditorBrowsableState.Never)]
2450 public static readonly BindableProperty BorderlineColorProperty = BindableProperty.Create(nameof(BorderlineColor), typeof(Color), typeof(View), null,
2451 propertyChanged: (bindable, oldValue, newValue) =>
2453 var view = (View)bindable;
2455 view.themeData?.selectorData?.BorderlineColor?.Reset(view);
2457 if (newValue is Selector<Color> selector)
2459 if (selector.HasAll()) view.SetBorderlineColor(selector.All);
2460 else view.EnsureSelectorData().BorderlineColor = new TriggerableSelector<Color>(view, selector, view.SetBorderlineColor, true);
2464 view.SetBorderlineColor((Color)newValue);
2467 defaultValueCreator: (bindable) =>
2469 var view = (View)bindable;
2470 return view.backgroundExtraData == null ? Color.Black : view.backgroundExtraData.BorderlineColor;
2475 /// BorderlineColorSelector Property
2476 /// Like BackgroundColor, color selector typed BorderlineColor should be used in ViewStyle only.
2477 /// So this API is internally used only.
2479 internal static readonly BindableProperty BorderlineColorSelectorProperty = BindableProperty.Create(nameof(BorderlineColorSelector), typeof(Selector<Color>), typeof(View), null,
2480 propertyChanged: (bindable, oldValue, newValue) =>
2482 var view = (View)bindable;
2484 view.themeData?.selectorData?.BorderlineColor?.Reset(view);
2486 if (newValue is Selector<Color> selector)
2488 if (selector.HasAll()) view.SetBorderlineColor(selector.All);
2489 else view.EnsureSelectorData().BorderlineColor = new TriggerableSelector<Color>(view, selector, view.SetBorderlineColor, true);
2493 view.SetBorderlineColor((Color)newValue);
2496 defaultValueCreator: (bindable) =>
2498 var view = (View)bindable;
2499 var selector = view.themeData?.selectorData?.BorderlineColor?.Get();
2500 return (null != selector) ? selector : new Selector<Color>();
2505 /// BorderlineOffset Property
2507 [EditorBrowsable(EditorBrowsableState.Never)]
2508 public static readonly BindableProperty BorderlineOffsetProperty = BindableProperty.Create(nameof(BorderlineOffset), typeof(float), typeof(View), default(float), propertyChanged: (bindable, oldValue, newValue) =>
2510 var view = (View)bindable;
2511 (view.backgroundExtraData ?? (view.backgroundExtraData = new BackgroundExtraData())).BorderlineOffset = (float)newValue;
2512 view.UpdateBackgroundExtraData(BackgroundExtraDataUpdatedFlag.Borderline);
2514 defaultValueCreator: (bindable) =>
2516 var view = (View)bindable;
2517 return view.backgroundExtraData == null ? 0.0f : view.backgroundExtraData.BorderlineOffset;
2521 /// EnableControlState property
2523 [EditorBrowsable(EditorBrowsableState.Never)]
2524 public static readonly BindableProperty EnableControlStateProperty = BindableProperty.Create(nameof(EnableControlState), typeof(bool), typeof(View), false, propertyChanged: (bindable, oldValue, newValue) =>
2526 var view = (View)bindable;
2527 bool prev = view.enableControlState;
2528 view.enableControlState = (bool)newValue;
2530 if (prev != view.enableControlState)
2534 view.TouchEvent -= view.EmptyOnTouch;
2538 view.TouchEvent += view.EmptyOnTouch;
2542 defaultValueCreator: (bindable) =>
2544 return ((View)bindable).enableControlState;
2548 /// ThemeChangeSensitive property
2550 [EditorBrowsable(EditorBrowsableState.Never)]
2551 public static readonly BindableProperty ThemeChangeSensitiveProperty = BindableProperty.Create(nameof(ThemeChangeSensitive), typeof(bool), typeof(View), false, propertyChanged: (bindable, oldValue, newValue) =>
2553 var view = (View)bindable;
2555 if (view.ThemeChangeSensitive == (bool)newValue) return;
2557 if (view.themeData == null) view.themeData = new ThemeData();
2559 view.themeData.ThemeChangeSensitive = (bool)newValue;
2561 if (view.themeData.ThemeChangeSensitive && !view.themeData.ListeningThemeChangeEvent)
2563 view.themeData.ListeningThemeChangeEvent = true;
2564 ThemeManager.ThemeChangedInternal.Add(view.OnThemeChanged);
2566 else if (!view.themeData.ThemeChangeSensitive && view.themeData.ListeningThemeChangeEvent)
2568 view.themeData.ListeningThemeChangeEvent = false;
2569 ThemeManager.ThemeChangedInternal.Remove(view.OnThemeChanged);
2572 defaultValueCreator: (bindable) =>
2574 return ((View)bindable).themeData?.ThemeChangeSensitive ?? ThemeManager.ApplicationThemeChangeSensitive;
2578 /// AccessibilityNameProperty
2580 [EditorBrowsable(EditorBrowsableState.Never)]
2581 public static readonly BindableProperty AccessibilityNameProperty = BindableProperty.Create(nameof(AccessibilityName), typeof(string), typeof(View), string.Empty, propertyChanged: (bindable, oldValue, newValue) =>
2583 var view = (View)bindable;
2584 if (newValue != null)
2587 Object.InternalSetPropertyString(view.SwigCPtr, View.Property.AccessibilityName, (string)newValue);
2590 defaultValueCreator: (bindable) =>
2592 var view = (View)bindable;
2594 return Object.InternalGetPropertyString(view.SwigCPtr, View.Property.AccessibilityName);
2598 /// AccessibilityDescriptionProperty
2600 [EditorBrowsable(EditorBrowsableState.Never)]
2601 public static readonly BindableProperty AccessibilityDescriptionProperty = BindableProperty.Create(nameof(AccessibilityDescription), typeof(string), typeof(View), string.Empty, propertyChanged: (bindable, oldValue, newValue) =>
2603 var view = (View)bindable;
2604 if (newValue != null)
2607 Object.InternalSetPropertyString(view.SwigCPtr, View.Property.AccessibilityDescription, (string)newValue);
2610 defaultValueCreator: (bindable) =>
2612 var view = (View)bindable;
2614 return Object.InternalGetPropertyString(view.SwigCPtr, View.Property.AccessibilityDescription);
2618 /// AccessibilityTranslationDomainProperty
2620 [EditorBrowsable(EditorBrowsableState.Never)]
2621 public static readonly BindableProperty AccessibilityTranslationDomainProperty = BindableProperty.Create(nameof(AccessibilityTranslationDomain), typeof(string), typeof(View), string.Empty, propertyChanged: (bindable, oldValue, newValue) =>
2623 var view = (View)bindable;
2624 if (newValue != null)
2627 Object.InternalSetPropertyString(view.SwigCPtr, View.Property.AccessibilityTranslationDomain, (string)newValue);
2630 defaultValueCreator: (bindable) =>
2632 var view = (View)bindable;
2634 return Object.InternalGetPropertyString(view.SwigCPtr, View.Property.AccessibilityTranslationDomain);
2638 /// AccessibilityRoleProperty
2640 [EditorBrowsable(EditorBrowsableState.Never)]
2641 public static readonly BindableProperty AccessibilityRoleProperty = BindableProperty.Create(nameof(AccessibilityRole), typeof(Role), typeof(View), default(Role), propertyChanged: (bindable, oldValue, newValue) =>
2643 var view = (View)bindable;
2644 if (newValue != null)
2647 Object.InternalSetPropertyInt(view.SwigCPtr, View.Property.AccessibilityRole, (int)newValue);
2650 defaultValueCreator: (bindable) =>
2652 var view = (View)bindable;
2654 return (Role)Object.InternalGetPropertyInt(view.SwigCPtr, View.Property.AccessibilityRole);
2658 /// AccessibilityHighlightableProperty
2660 [EditorBrowsable(EditorBrowsableState.Never)]
2661 public static readonly BindableProperty AccessibilityHighlightableProperty = BindableProperty.Create(nameof(AccessibilityHighlightable), typeof(bool), typeof(View), false, propertyChanged: (bindable, oldValue, newValue) =>
2663 var view = (View)bindable;
2664 if (newValue != null)
2667 Object.InternalSetPropertyBool(view.SwigCPtr, View.Property.AccessibilityHighlightable, (bool)newValue);
2670 defaultValueCreator: (bindable) =>
2672 var view = (View)bindable;
2674 return Object.InternalGetPropertyBool(view.SwigCPtr, View.Property.AccessibilityHighlightable);
2678 /// AccessibilityHiddenProperty
2680 [EditorBrowsable(EditorBrowsableState.Never)]
2681 public static readonly BindableProperty AccessibilityHiddenProperty = BindableProperty.Create(nameof(AccessibilityHidden), typeof(bool), typeof(View), false, propertyChanged: (bindable, oldValue, newValue) =>
2683 var view = (View)bindable;
2684 if (newValue != null)
2687 Object.InternalSetPropertyBool(view.SwigCPtr, View.Property.AccessibilityHidden, (bool)newValue);
2690 defaultValueCreator: (bindable) =>
2692 var view = (View)bindable;
2694 return Object.InternalGetPropertyBool(view.SwigCPtr, View.Property.AccessibilityHidden);
2698 /// ExcludeLayoutingProperty
2700 [EditorBrowsable(EditorBrowsableState.Never)]
2701 public static readonly BindableProperty ExcludeLayoutingProperty = BindableProperty.Create(nameof(ExcludeLayouting), typeof(bool), typeof(View), false, propertyChanged: (bindable, oldValue, newValue) =>
2703 var instance = (Tizen.NUI.BaseComponents.View)bindable;
2704 if (newValue != null)
2706 instance.InternalExcludeLayouting = (bool)newValue;
2709 defaultValueCreator: (bindable) =>
2711 var instance = (Tizen.NUI.BaseComponents.View)bindable;
2712 return instance.InternalExcludeLayouting;
2716 /// TooltipTextProperty
2718 [EditorBrowsable(EditorBrowsableState.Never)]
2719 public static readonly BindableProperty TooltipTextProperty = BindableProperty.Create(nameof(TooltipText), typeof(string), typeof(View), string.Empty, propertyChanged: (bindable, oldValue, newValue) =>
2721 var instance = (Tizen.NUI.BaseComponents.View)bindable;
2722 if (newValue != null)
2724 instance.InternalTooltipText = (string)newValue;
2727 defaultValueCreator: (bindable) =>
2729 var instance = (Tizen.NUI.BaseComponents.View)bindable;
2730 return instance.InternalTooltipText;
2734 /// PositionUsesAnchorPointProperty
2736 [EditorBrowsable(EditorBrowsableState.Never)]
2737 public static readonly BindableProperty PositionUsesAnchorPointProperty = BindableProperty.Create(nameof(PositionUsesAnchorPoint), typeof(bool), typeof(View), false, propertyChanged: (bindable, oldValue, newValue) =>
2739 var instance = (Tizen.NUI.BaseComponents.View)bindable;
2740 if (newValue != null)
2742 instance.InternalPositionUsesAnchorPoint = (bool)newValue;
2745 defaultValueCreator: (bindable) =>
2747 var instance = (Tizen.NUI.BaseComponents.View)bindable;
2748 return instance.InternalPositionUsesAnchorPoint;
2751 // AnchorPointProperty
2752 internal static void SetInternalAnchorPointProperty(BindableObject bindable, object oldValue, object newValue)
2754 var instance = (Tizen.NUI.BaseComponents.View)bindable;
2755 if (newValue != null)
2757 instance.InternalAnchorPoint = (Tizen.NUI.Position)newValue;
2761 internal static object GetInternalAnchorPointProperty(BindableObject bindable)
2763 var instance = (Tizen.NUI.BaseComponents.View)bindable;
2764 return instance.InternalAnchorPoint;
2768 /// AnchorPointProperty
2770 [EditorBrowsable(EditorBrowsableState.Never)]
2772 internal static BindableProperty GetAnchorPointProperty()
2774 if (AnchorPointProperty == null)
2776 AnchorPointProperty = BindableProperty.Create(nameof(AnchorPoint), typeof(Tizen.NUI.Position), typeof(View), null,
2777 propertyChanged: SetInternalAnchorPointProperty, defaultValueCreator: GetInternalAnchorPointProperty);
2779 return AnchorPointProperty;
2782 public static BindableProperty AnchorPointProperty = null;
2784 public static readonly BindableProperty AnchorPointProperty = null;
2788 /// WidthSpecificationProperty
2790 [EditorBrowsable(EditorBrowsableState.Never)]
2791 public static readonly BindableProperty WidthSpecificationProperty = BindableProperty.Create(nameof(WidthSpecification), typeof(int), typeof(View), 0, propertyChanged: (bindable, oldValue, newValue) =>
2793 var instance = (Tizen.NUI.BaseComponents.View)bindable;
2794 if (newValue != null)
2796 instance.InternalWidthSpecification = (int)newValue;
2799 defaultValueCreator: (bindable) =>
2801 var instance = (Tizen.NUI.BaseComponents.View)bindable;
2802 return instance.InternalWidthSpecification;
2806 /// HeightSpecificationProperty
2808 [EditorBrowsable(EditorBrowsableState.Never)]
2809 public static readonly BindableProperty HeightSpecificationProperty = BindableProperty.Create(nameof(HeightSpecification), typeof(int), typeof(View), 0, propertyChanged: (bindable, oldValue, newValue) =>
2811 var instance = (Tizen.NUI.BaseComponents.View)bindable;
2812 if (newValue != null)
2814 instance.InternalHeightSpecification = (int)newValue;
2817 defaultValueCreator: (bindable) =>
2819 var instance = (Tizen.NUI.BaseComponents.View)bindable;
2820 return instance.InternalHeightSpecification;
2824 /// LayoutTransitionProperty
2826 [EditorBrowsable(EditorBrowsableState.Never)]
2827 public static readonly BindableProperty LayoutTransitionProperty = BindableProperty.Create(nameof(LayoutTransition), typeof(Tizen.NUI.LayoutTransition), typeof(View), null, propertyChanged: (bindable, oldValue, newValue) =>
2829 var instance = (Tizen.NUI.BaseComponents.View)bindable;
2830 if (newValue != null)
2832 instance.InternalLayoutTransition = (Tizen.NUI.LayoutTransition)newValue;
2835 defaultValueCreator: (bindable) =>
2837 var instance = (Tizen.NUI.BaseComponents.View)bindable;
2838 return instance.InternalLayoutTransition;
2842 /// PaddingEXProperty
2844 [EditorBrowsable(EditorBrowsableState.Never)]
2845 public static readonly BindableProperty PaddingEXProperty = BindableProperty.Create(nameof(PaddingEX), typeof(Tizen.NUI.Extents), typeof(View), null, propertyChanged: (bindable, oldValue, newValue) =>
2847 var instance = (Tizen.NUI.BaseComponents.View)bindable;
2848 if (newValue != null)
2850 instance.InternalPaddingEX = (Tizen.NUI.Extents)newValue;
2853 defaultValueCreator: (bindable) =>
2855 var instance = (Tizen.NUI.BaseComponents.View)bindable;
2856 return instance.InternalPaddingEX;
2862 [EditorBrowsable(EditorBrowsableState.Never)]
2863 public static readonly BindableProperty LayoutProperty = BindableProperty.Create(nameof(Layout), typeof(Tizen.NUI.LayoutItem), typeof(View), null, propertyChanged: (bindable, oldValue, newValue) =>
2865 var instance = (Tizen.NUI.BaseComponents.View)bindable;
2866 if (newValue != null)
2868 instance.InternalLayout = (Tizen.NUI.LayoutItem)newValue;
2871 defaultValueCreator: (bindable) =>
2873 var instance = (Tizen.NUI.BaseComponents.View)bindable;
2874 return instance.InternalLayout;
2878 /// BackgroundImageSynchronosLoadingProperty
2880 [EditorBrowsable(EditorBrowsableState.Never)]
2881 public static readonly BindableProperty BackgroundImageSynchronosLoadingProperty = BindableProperty.Create(nameof(BackgroundImageSynchronosLoading), typeof(bool), typeof(View), false, propertyChanged: (bindable, oldValue, newValue) =>
2883 var instance = (Tizen.NUI.BaseComponents.View)bindable;
2884 if (newValue != null)
2886 instance.InternalBackgroundImageSynchronosLoading = (bool)newValue;
2889 defaultValueCreator: (bindable) =>
2891 var instance = (Tizen.NUI.BaseComponents.View)bindable;
2892 return instance.InternalBackgroundImageSynchronosLoading;
2896 /// BackgroundImageSynchronousLoadingProperty
2898 [EditorBrowsable(EditorBrowsableState.Never)]
2899 public static readonly BindableProperty BackgroundImageSynchronousLoadingProperty = BindableProperty.Create(nameof(BackgroundImageSynchronousLoading), typeof(bool), typeof(View), false, propertyChanged: (bindable, oldValue, newValue) =>
2901 var instance = (Tizen.NUI.BaseComponents.View)bindable;
2902 if (newValue != null)
2904 instance.InternalBackgroundImageSynchronousLoading = (bool)newValue;
2907 defaultValueCreator: (bindable) =>
2909 var instance = (Tizen.NUI.BaseComponents.View)bindable;
2910 return instance.InternalBackgroundImageSynchronousLoading;
2914 /// EnableControlStatePropagationProperty
2916 [EditorBrowsable(EditorBrowsableState.Never)]
2917 public static readonly BindableProperty EnableControlStatePropagationProperty = BindableProperty.Create(nameof(EnableControlStatePropagation), typeof(bool), typeof(View), false, propertyChanged: (bindable, oldValue, newValue) =>
2919 var instance = (Tizen.NUI.BaseComponents.View)bindable;
2920 if (newValue != null)
2922 instance.InternalEnableControlStatePropagation = (bool)newValue;
2925 defaultValueCreator: (bindable) =>
2927 var instance = (Tizen.NUI.BaseComponents.View)bindable;
2928 return instance.InternalEnableControlStatePropagation;
2932 /// PropagatableControlStatesProperty
2934 [EditorBrowsable(EditorBrowsableState.Never)]
2935 public static readonly BindableProperty PropagatableControlStatesProperty = BindableProperty.Create(nameof(PropagatableControlStates), typeof(ControlState), typeof(View), ControlState.All, propertyChanged: (bindable, oldValue, newValue) =>
2937 var instance = (Tizen.NUI.BaseComponents.View)bindable;
2938 if (newValue != null)
2940 instance.InternalPropagatableControlStates = (ControlState)newValue;
2943 defaultValueCreator: (bindable) =>
2945 var instance = (Tizen.NUI.BaseComponents.View)bindable;
2946 return instance.InternalPropagatableControlStates;
2950 /// GrabTouchAfterLeaveProperty
2952 [EditorBrowsable(EditorBrowsableState.Never)]
2953 public static readonly BindableProperty GrabTouchAfterLeaveProperty = BindableProperty.Create(nameof(GrabTouchAfterLeave), typeof(bool), typeof(View), false, propertyChanged: (bindable, oldValue, newValue) =>
2955 var instance = (Tizen.NUI.BaseComponents.View)bindable;
2956 if (newValue != null)
2958 instance.InternalGrabTouchAfterLeave = (bool)newValue;
2961 defaultValueCreator: (bindable) =>
2963 var instance = (Tizen.NUI.BaseComponents.View)bindable;
2964 return instance.InternalGrabTouchAfterLeave;
2968 /// AllowOnlyOwnTouchProperty
2970 [EditorBrowsable(EditorBrowsableState.Never)]
2971 public static readonly BindableProperty AllowOnlyOwnTouchProperty = BindableProperty.Create(nameof(AllowOnlyOwnTouch), typeof(bool), typeof(View), false, propertyChanged: (bindable, oldValue, newValue) =>
2973 var instance = (Tizen.NUI.BaseComponents.View)bindable;
2974 if (newValue != null)
2976 instance.InternalAllowOnlyOwnTouch = (bool)newValue;
2979 defaultValueCreator: (bindable) =>
2981 var instance = (Tizen.NUI.BaseComponents.View)bindable;
2982 return instance.InternalAllowOnlyOwnTouch;
2987 /// BlendEquationProperty
2989 [EditorBrowsable(EditorBrowsableState.Never)]
2990 public static readonly BindableProperty BlendEquationProperty = BindableProperty.Create(nameof(BlendEquation), typeof(BlendEquationType), typeof(View), default(BlendEquationType), propertyChanged: (bindable, oldValue, newValue) =>
2992 var instance = (Tizen.NUI.BaseComponents.View)bindable;
2993 if (newValue != null)
2995 instance.InternalBlendEquation = (Tizen.NUI.BlendEquationType)newValue;
2998 defaultValueCreator: (bindable) =>
3000 var instance = (Tizen.NUI.BaseComponents.View)bindable;
3001 return instance.InternalBlendEquation;
3005 /// TransitionOptionsProperty
3007 [EditorBrowsable(EditorBrowsableState.Never)]
3008 public static readonly BindableProperty TransitionOptionsProperty = BindableProperty.Create(nameof(TransitionOptions), typeof(TransitionOptions), typeof(View), default(TransitionOptions), propertyChanged: (bindable, oldValue, newValue) =>
3010 var instance = (Tizen.NUI.BaseComponents.View)bindable;
3011 if (newValue != null)
3013 instance.InternalTransitionOptions = (Tizen.NUI.TransitionOptions)newValue;
3016 defaultValueCreator: (bindable) =>
3018 var instance = (Tizen.NUI.BaseComponents.View)bindable;
3019 return instance.InternalTransitionOptions;
3023 /// AutomationIdProperty
3025 [EditorBrowsable(EditorBrowsableState.Never)]
3026 public static readonly BindableProperty AutomationIdProperty = BindableProperty.Create(nameof(AutomationId), typeof(string), typeof(View), string.Empty, propertyChanged: (bindable, oldValue, newValue) =>
3028 var instance = (Tizen.NUI.BaseComponents.View)bindable;
3029 if (newValue != null)
3032 Object.InternalSetPropertyString(instance.SwigCPtr, View.Property.AutomationId, (string)newValue);
3035 defaultValueCreator: (bindable) =>
3037 var instance = (Tizen.NUI.BaseComponents.View)bindable;
3039 return Object.InternalGetPropertyString(instance.SwigCPtr, View.Property.AutomationId);
3043 /// TouchAreaOffsetProperty
3045 [EditorBrowsable(EditorBrowsableState.Never)]
3046 public static readonly BindableProperty TouchAreaOffsetProperty = BindableProperty.Create(nameof(TouchAreaOffset), typeof(Offset), typeof(View), default(Offset), propertyChanged: (bindable, oldValue, newValue) =>
3048 var instance = (Tizen.NUI.BaseComponents.View)bindable;
3049 if (newValue != null)
3051 instance.InternalTouchAreaOffset = (Tizen.NUI.Offset)newValue;
3054 defaultValueCreator: (bindable) =>
3056 var instance = (Tizen.NUI.BaseComponents.View)bindable;
3057 return instance.InternalTouchAreaOffset;
3061 /// DispatchTouchMotionProperty
3063 [EditorBrowsable(EditorBrowsableState.Never)]
3064 public static readonly BindableProperty DispatchTouchMotionProperty = BindableProperty.Create(nameof(DispatchTouchMotion), typeof(bool), typeof(View), false, propertyChanged: (bindable, oldValue, newValue) =>
3066 var instance = (Tizen.NUI.BaseComponents.View)bindable;
3067 if (newValue != null)
3069 instance.InternalDispatchTouchMotion = (bool)newValue;
3072 defaultValueCreator: (bindable) =>
3074 var instance = (Tizen.NUI.BaseComponents.View)bindable;
3075 return instance.InternalDispatchTouchMotion;
3079 /// DispatchHoverMotionProperty
3081 [EditorBrowsable(EditorBrowsableState.Never)]
3082 public static readonly BindableProperty DispatchHoverMotionProperty = BindableProperty.Create(nameof(DispatchHoverMotion), typeof(bool), typeof(View), false, propertyChanged: (bindable, oldValue, newValue) =>
3084 var instance = (Tizen.NUI.BaseComponents.View)bindable;
3085 if (newValue != null)
3087 instance.InternalDispatchHoverMotion = (bool)newValue;
3090 defaultValueCreator: (bindable) =>
3092 var instance = (Tizen.NUI.BaseComponents.View)bindable;
3093 return instance.InternalDispatchHoverMotion;
3097 /// Gets View's Size2D set by user.
3099 internal Size2D GetUserSize2D()
3101 return new Size2D((int)userSizeWidth, (int)userSizeHeight);
3105 internal static void CreateBindableProperties()
3107 _ = GetBackgroundColorProperty();
3108 _ = GetColorProperty();
3109 _ = GetColorRedProperty();
3110 _ = GetColorGreenProperty();
3111 _ = GetColorBlueProperty();
3112 _ = GetCellIndexProperty();
3113 _ = GetSize2DProperty();
3114 _ = GetPosition2DProperty();
3115 _ = GetParentOriginProperty();
3116 _ = GetPivotPointProperty();
3117 _ = GetSizeWidthProperty();
3118 _ = GetSizeHeightProperty();
3119 _ = GetPositionProperty();
3120 _ = GetPositionXProperty();
3121 _ = GetPositionYProperty();
3122 _ = GetPositionZProperty();
3123 _ = GetScaleProperty();
3124 _ = GetScaleXProperty();
3125 _ = GetScaleYProperty();
3126 _ = GetScaleZProperty();
3127 _ = GetNameProperty();
3128 _ = GetSizeModeFactorProperty();
3129 _ = GetPaddingProperty();
3130 _ = GetSizeProperty();
3131 _ = GetMinimumSizeProperty();
3132 _ = GetMaximumSizeProperty();
3133 _ = GetMarginProperty();
3134 _ = GetAnchorPointProperty();
3138 private void SetBackgroundImage(string value)
3140 if (string.IsNullOrEmpty(value))
3142 backgroundExtraDataUpdatedFlag &= ~BackgroundExtraDataUpdatedFlag.Background;
3144 var empty = new PropertyValue();
3146 Object.SetProperty(SwigCPtr, Property.BACKGROUND, empty);
3151 if (value.StartsWith("*Resource*"))
3153 string resource = Tizen.Applications.Application.Current.DirectoryInfo.Resource;
3154 value = value.Replace("*Resource*", resource);
3157 if (backgroundExtraData == null)
3160 Object.InternalSetPropertyString(SwigCPtr, View.Property.BACKGROUND, value);
3161 BackgroundImageSynchronousLoading = backgroundImageSynchronousLoading;
3165 var map = new PropertyMap();
3166 var url = new PropertyValue(value);
3167 var cornerRadiusValue = backgroundExtraData.CornerRadius == null ? new PropertyValue() : new PropertyValue(backgroundExtraData.CornerRadius);
3168 var cornerRadius = new PropertyValue(cornerRadiusValue);
3169 var cornerRadiusPolicy = new PropertyValue((int)(backgroundExtraData.CornerRadiusPolicy));
3170 var borderlineWidth = new PropertyValue(backgroundExtraData.BorderlineWidth);
3171 var borderlineColorValue = backgroundExtraData.BorderlineColor == null ? new PropertyValue(Color.Black) : new PropertyValue(backgroundExtraData.BorderlineColor);
3172 var borderlineColor = new PropertyValue(borderlineColorValue);
3173 var borderlineOffset = new PropertyValue(backgroundExtraData.BorderlineOffset);
3174 var synchronousLoading = new PropertyValue(backgroundImageSynchronousLoading);
3175 var npatchType = new PropertyValue((int)Visual.Type.NPatch);
3176 var border = (backgroundExtraData.BackgroundImageBorder != null) ? new PropertyValue(backgroundExtraData.BackgroundImageBorder) : null;
3177 var imageType = new PropertyValue((int)Visual.Type.Image);
3179 map.Add(ImageVisualProperty.URL, url)
3180 .Add(Visual.Property.CornerRadius, cornerRadius)
3181 .Add(Visual.Property.CornerRadiusPolicy, cornerRadiusPolicy)
3182 .Add(Visual.Property.BorderlineWidth, borderlineWidth)
3183 .Add(Visual.Property.BorderlineColor, borderlineColor)
3184 .Add(Visual.Property.BorderlineOffset, borderlineOffset)
3185 .Add(ImageVisualProperty.SynchronousLoading, synchronousLoading);
3187 if (backgroundExtraData.BackgroundImageBorder != null)
3189 map.Add(Visual.Property.Type, npatchType)
3190 .Add(NpatchImageVisualProperty.Border, border);
3194 map.Add(Visual.Property.Type, imageType);
3197 backgroundExtraDataUpdatedFlag &= ~BackgroundExtraDataUpdatedFlag.Background;
3199 var mapValue = new PropertyValue(map);
3200 Object.SetProperty(SwigCPtr, Property.BACKGROUND, mapValue);
3202 imageType?.Dispose();
3204 npatchType?.Dispose();
3205 synchronousLoading?.Dispose();
3206 borderlineOffset?.Dispose();
3207 borderlineColor?.Dispose();
3208 borderlineColorValue?.Dispose();
3209 borderlineWidth?.Dispose();
3210 cornerRadiusPolicy?.Dispose();
3211 cornerRadius?.Dispose();
3212 cornerRadiusValue?.Dispose();
3215 mapValue?.Dispose();
3218 private void SetBackgroundImageBorder(Rectangle value)
3220 bool isEmptyValue = Rectangle.IsNullOrZero(value);
3222 var backgroundImageBorder = isEmptyValue ? null : value;
3224 (backgroundExtraData ?? (backgroundExtraData = new BackgroundExtraData())).BackgroundImageBorder = backgroundImageBorder;
3231 PropertyMap map = Background;
3238 map[NpatchImageVisualProperty.Border] = new PropertyValue(backgroundImageBorder);
3242 map.Find(Visual.Property.Type)?.Get(out visualType);
3244 if (visualType == (int)Visual.Type.Image)
3246 map[Visual.Property.Type] = new PropertyValue((int)Visual.Type.NPatch);
3249 // Background extra data flag is not meanful anymore.
3250 backgroundExtraDataUpdatedFlag &= ~BackgroundExtraDataUpdatedFlag.Background;
3252 Tizen.NUI.Object.SetProperty((System.Runtime.InteropServices.HandleRef)SwigCPtr, View.Property.BACKGROUND, new PropertyValue(map));
3255 private void SetBorderlineColor(Color value)
3262 (backgroundExtraData ?? (backgroundExtraData = new BackgroundExtraData())).BorderlineColor = value;
3264 UpdateBackgroundExtraData(BackgroundExtraDataUpdatedFlag.Borderline);
3267 private void SetBackgroundColor(Color value)
3274 if (backgroundExtraData == null)
3277 Object.InternalSetPropertyVector4(SwigCPtr, View.Property.BACKGROUND, ((Color)value).SwigCPtr);
3281 var map = new PropertyMap();
3282 var colorType = new PropertyValue((int)Visual.Type.Color);
3283 var mixColor = new PropertyValue(value);
3284 var cornerRadiusValue = backgroundExtraData.CornerRadius == null ? new PropertyValue() : new PropertyValue(backgroundExtraData.CornerRadius);
3285 var cornerRadius = new PropertyValue(cornerRadiusValue);
3286 var cornerRadiusPolicy = new PropertyValue((int)(backgroundExtraData.CornerRadiusPolicy));
3287 var borderlineWidth = new PropertyValue(backgroundExtraData.BorderlineWidth);
3288 var borderlineColorValue = backgroundExtraData.BorderlineColor == null ? new PropertyValue(Color.Black) : new PropertyValue(backgroundExtraData.BorderlineColor);
3289 var borderlineColor = new PropertyValue(borderlineColorValue);
3290 var borderlineOffset = new PropertyValue(backgroundExtraData.BorderlineOffset);
3292 map.Add(Visual.Property.Type, colorType)
3293 .Add(ColorVisualProperty.MixColor, mixColor)
3294 .Add(Visual.Property.CornerRadius, cornerRadius)
3295 .Add(Visual.Property.CornerRadiusPolicy, cornerRadiusPolicy)
3296 .Add(Visual.Property.BorderlineWidth, borderlineWidth)
3297 .Add(Visual.Property.BorderlineColor, borderlineColor)
3298 .Add(Visual.Property.BorderlineOffset, borderlineOffset);
3300 backgroundExtraDataUpdatedFlag &= ~BackgroundExtraDataUpdatedFlag.Background;
3302 var mapValue = new PropertyValue(map);
3303 Object.SetProperty(SwigCPtr, Property.BACKGROUND, mapValue);
3305 borderlineOffset?.Dispose();
3306 borderlineColor?.Dispose();
3307 borderlineColorValue?.Dispose();
3308 borderlineWidth?.Dispose();
3309 cornerRadiusPolicy?.Dispose();
3310 cornerRadius?.Dispose();
3311 cornerRadiusValue?.Dispose();
3312 mixColor?.Dispose();
3313 colorType?.Dispose();
3315 mapValue?.Dispose();
3318 private void SetColor(Color value)
3325 Interop.ActorInternal.SetColor(SwigCPtr, value.SwigCPtr);
3326 if (NDalicPINVOKE.SWIGPendingException.Pending)
3327 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
3330 private void SetColorRed(float? value)
3337 Object.InternalSetPropertyFloat(SwigCPtr, View.Property.ColorRed, (float)value);
3338 if (NDalicPINVOKE.SWIGPendingException.Pending)
3339 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
3342 private void SetColorGreen(float? value)
3349 Object.InternalSetPropertyFloat(SwigCPtr, View.Property.ColorGreen, (float)value);
3350 if (NDalicPINVOKE.SWIGPendingException.Pending)
3351 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
3354 private void SetColorBlue(float? value)
3361 Object.InternalSetPropertyFloat(SwigCPtr, View.Property.ColorBlue, (float)value);
3362 if (NDalicPINVOKE.SWIGPendingException.Pending)
3363 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
3366 private void SetOpacity(float? value)
3373 Object.InternalSetPropertyFloat(SwigCPtr, View.Property.OPACITY, (float)value);
3376 private void SetShadow(ShadowBase value)
3378 backgroundExtraDataUpdatedFlag &= ~BackgroundExtraDataUpdatedFlag.Shadow;
3379 Tizen.NUI.Object.SetProperty((System.Runtime.InteropServices.HandleRef)SwigCPtr, View.Property.SHADOW, value == null ? new PropertyValue() : value.ToPropertyValue(this));