2 * Copyright(c) 2021 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.Collections.Generic;
20 using System.ComponentModel;
21 using System.Diagnostics;
22 using System.Runtime.CompilerServices;
23 using Tizen.NUI.Binding;
25 namespace Tizen.NUI.BaseComponents
28 /// View is the base class for all views.
30 /// <since_tizen> 3 </since_tizen>
31 public partial class View
33 private MergedStyle mergedStyle = null;
35 // Ignore WidthResizePolicy and HeightResizePolicy when Layout is set.
36 // Restore WidthResizePolicy and HeightResizePolicy when Layout is unset.
37 // See also IgnoreResizePolicy() and RestoreResizePolicy().
38 private ResizePolicyType widthResizePolicy = ResizePolicyType.Fixed;
39 private ResizePolicyType heightResizePolicy = ResizePolicyType.Fixed;
40 private bool isIgnoredResizePolicy = false;
42 internal string styleName;
44 internal MergedStyle MergedStyle
48 if (null == mergedStyle)
50 mergedStyle = new MergedStyle(GetType(), this);
56 internal virtual LayoutItem CreateDefaultLayout()
58 return new AbsoluteLayout();
61 internal class ThemeData
64 private enum States : byte
67 ControlStatePropagation = 1 << 0,
68 ThemeChangeSensitive = 1 << 1,
69 ThemeApplied = 1 << 2, // It is true when the view has valid style name or the platform theme has a component style for this view type.
70 // That indicates the view can have different styles by theme.
71 // Hence if the current state has ThemeApplied and ThemeChangeSensitive, the view will change its style by theme changing.
72 ListeningThemeChangeEvent = 1 << 3,
75 private States states = ThemeManager.ApplicationThemeChangeSensitive ? States.ThemeChangeSensitive : States.None;
76 public ViewStyle viewStyle;
77 public ControlState controlStates = ControlState.Normal;
78 public ViewSelectorData selectorData;
80 public bool ControlStatePropagation
82 get => ((states & States.ControlStatePropagation) != 0);
83 set => SetOption(States.ControlStatePropagation, value);
86 public bool ThemeChangeSensitive
88 get => ((states & States.ThemeChangeSensitive) != 0);
89 set => SetOption(States.ThemeChangeSensitive, value);
92 public bool ThemeApplied
94 get => ((states & States.ThemeApplied) != 0);
95 set => SetOption(States.ThemeApplied, value);
98 public bool ListeningThemeChangeEvent
100 get => ((states & States.ListeningThemeChangeEvent) != 0);
101 set => SetOption(States.ListeningThemeChangeEvent, value);
104 private void SetOption(States option, bool value)
106 if (value) states |= option;
107 else states &= ~option;
112 /// The color mode of View.
113 /// This specifies whether the View uses its own color, or inherits its parent color.
114 /// The default is ColorMode.UseOwnMultiplyParentColor.
116 internal ColorMode ColorMode
124 return GetColorMode();
128 internal LayoutLength SuggestedMinimumWidth
132 float result = Interop.Actor.GetSuggestedMinimumWidth(SwigCPtr);
133 if (NDalicPINVOKE.SWIGPendingException.Pending)
134 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
135 return new LayoutLength(result);
139 internal LayoutLength SuggestedMinimumHeight
143 float result = Interop.Actor.GetSuggestedMinimumHeight(SwigCPtr);
144 if (NDalicPINVOKE.SWIGPendingException.Pending)
145 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
146 return new LayoutLength(result);
150 internal float WorldPositionX
154 float returnValue = 0.0f;
155 PropertyValue wordPositionX = GetProperty(View.Property.WorldPositionX);
156 wordPositionX?.Get(out returnValue);
157 wordPositionX?.Dispose();
162 internal float WorldPositionY
166 float returnValue = 0.0f;
167 PropertyValue wordPositionY = GetProperty(View.Property.WorldPositionY);
168 wordPositionY?.Get(out returnValue);
169 wordPositionY?.Dispose();
174 internal float WorldPositionZ
178 float returnValue = 0.0f;
179 PropertyValue wordPositionZ = GetProperty(View.Property.WorldPositionZ);
180 wordPositionZ?.Get(out returnValue);
181 wordPositionZ?.Dispose();
186 internal bool FocusState
190 return IsKeyboardFocusable();
194 SetKeyboardFocusable(value);
198 internal void SetLayout(LayoutItem layout)
200 // ResizePolicy is restored when Layout is unset and it is considered when View size is calculated.
203 RestoreResizePolicy();
205 // ResizePolicy is stored when Layout is set and it is ignored when View size is calculated.
208 IgnoreResizePolicy();
211 Window.Instance.LayoutController.CreateProcessCallback();
212 this.layout = layout;
213 this.layout?.AttachToOwner(this);
214 this.layout?.RequestLayout();
217 internal void AttachTransitionsToChildren(LayoutTransition transition)
219 // Iterate children, adding the transition unless a transition
220 // for the same condition and property has already been
222 foreach (View view in Children)
224 LayoutTransitionsHelper.AddTransitionForCondition(view.LayoutTransitions, transition.Condition, transition, false);
228 internal float ParentOriginX
232 float returnValue = 0.0f;
233 PropertyValue parentOriginX = GetProperty(View.Property.ParentOriginX);
234 parentOriginX?.Get(out returnValue);
235 parentOriginX?.Dispose();
240 PropertyValue setValue = new Tizen.NUI.PropertyValue(value);
241 SetProperty(View.Property.ParentOriginX, setValue);
243 NotifyPropertyChanged();
247 internal float ParentOriginY
251 float returnValue = 0.0f;
252 PropertyValue parentOriginY = GetProperty(View.Property.ParentOriginY);
253 parentOriginY?.Get(out returnValue);
254 parentOriginY?.Dispose();
259 PropertyValue setValue = new Tizen.NUI.PropertyValue(value);
260 SetProperty(View.Property.ParentOriginY, setValue);
262 NotifyPropertyChanged();
266 internal float ParentOriginZ
270 float returnValue = 0.0f;
271 PropertyValue parentOriginZ = GetProperty(View.Property.ParentOriginZ);
272 parentOriginZ?.Get(out returnValue);
273 parentOriginZ?.Dispose();
278 PropertyValue setValue = new Tizen.NUI.PropertyValue(value);
279 SetProperty(View.Property.ParentOriginZ, setValue);
281 NotifyPropertyChanged();
285 internal float PivotPointX
289 float returnValue = 0.0f;
290 PropertyValue anchorPointX = GetProperty(View.Property.AnchorPointX);
291 anchorPointX?.Get(out returnValue);
292 anchorPointX?.Dispose();
297 PropertyValue setValue = new Tizen.NUI.PropertyValue(value);
298 SetProperty(View.Property.AnchorPointX, setValue);
303 internal float PivotPointY
307 float returnValue = 0.0f;
308 PropertyValue anchorPointY = GetProperty(View.Property.AnchorPointY);
309 anchorPointY?.Get(out returnValue);
310 anchorPointY?.Dispose();
315 PropertyValue setValue = new Tizen.NUI.PropertyValue(value);
316 SetProperty(View.Property.AnchorPointY, setValue);
321 internal float PivotPointZ
325 float returnValue = 0.0f;
326 PropertyValue anchorPointZ = GetProperty(View.Property.AnchorPointZ);
327 anchorPointZ?.Get(out returnValue);
328 anchorPointZ?.Dispose();
333 PropertyValue setValue = new Tizen.NUI.PropertyValue(value);
334 SetProperty(View.Property.AnchorPointZ, setValue);
339 internal Matrix WorldMatrix
343 Matrix returnValue = new Matrix();
344 PropertyValue wordMatrix = GetProperty(View.Property.WorldMatrix);
345 wordMatrix?.Get(returnValue);
346 wordMatrix?.Dispose();
352 /// Indicates that this View should listen Touch event to handle its ControlState.
354 private bool enableControlState = false;
356 private int LeftFocusableViewId
361 PropertyValue leftFocusableViewId = GetProperty(View.Property.LeftFocusableViewId);
362 leftFocusableViewId?.Get(out returnValue);
363 leftFocusableViewId?.Dispose();
368 PropertyValue setValue = new Tizen.NUI.PropertyValue(value);
369 SetProperty(View.Property.LeftFocusableViewId, setValue);
374 private int RightFocusableViewId
379 PropertyValue rightFocusableViewId = GetProperty(View.Property.RightFocusableViewId);
380 rightFocusableViewId?.Get(out returnValue);
381 rightFocusableViewId?.Dispose();
386 PropertyValue setValue = new Tizen.NUI.PropertyValue(value);
387 SetProperty(View.Property.RightFocusableViewId, setValue);
392 private int UpFocusableViewId
397 PropertyValue upFocusableViewId = GetProperty(View.Property.UpFocusableViewId);
398 upFocusableViewId?.Get(out returnValue);
399 upFocusableViewId?.Dispose();
404 PropertyValue setValue = new Tizen.NUI.PropertyValue(value);
405 SetProperty(View.Property.UpFocusableViewId, setValue);
410 private int DownFocusableViewId
415 PropertyValue downFocusableViewId = GetProperty(View.Property.DownFocusableViewId);
416 downFocusableViewId?.Get(out returnValue);
417 downFocusableViewId?.Dispose();
422 PropertyValue setValue = new Tizen.NUI.PropertyValue(value);
423 SetProperty(View.Property.DownFocusableViewId, setValue);
428 internal string GetName()
430 string ret = Interop.Actor.GetName(SwigCPtr);
431 if (NDalicPINVOKE.SWIGPendingException.Pending)
432 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
436 internal void SetName(string name)
438 Interop.Actor.SetName(SwigCPtr, name);
439 if (NDalicPINVOKE.SWIGPendingException.Pending)
440 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
443 internal uint GetId()
445 uint ret = Interop.Actor.GetId(SwigCPtr);
446 if (NDalicPINVOKE.SWIGPendingException.Pending)
447 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
451 internal bool IsRoot()
453 bool ret = Interop.ActorInternal.IsRoot(SwigCPtr);
454 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
458 internal bool OnWindow()
460 bool ret = Interop.Actor.OnStage(SwigCPtr);
461 if (NDalicPINVOKE.SWIGPendingException.Pending)
462 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
466 internal View FindChildById(uint id)
468 //to fix memory leak issue, match the handle count with native side.
469 IntPtr cPtr = Interop.Actor.FindChildById(SwigCPtr, id);
470 View ret = this.GetInstanceSafely<View>(cPtr);
471 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
475 internal override View FindCurrentChildById(uint id)
477 return FindChildById(id);
480 internal void SetParentOrigin(Vector3 origin)
482 Interop.ActorInternal.SetParentOrigin(SwigCPtr, Vector3.getCPtr(origin));
483 if (NDalicPINVOKE.SWIGPendingException.Pending)
484 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
487 internal Vector3 GetCurrentParentOrigin()
489 Vector3 ret = new Vector3(Interop.ActorInternal.GetCurrentParentOrigin(SwigCPtr), true);
490 if (NDalicPINVOKE.SWIGPendingException.Pending)
491 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
495 internal void SetAnchorPoint(Vector3 anchorPoint)
497 Interop.Actor.SetAnchorPoint(SwigCPtr, Vector3.getCPtr(anchorPoint));
498 if (NDalicPINVOKE.SWIGPendingException.Pending)
499 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
502 internal Vector3 GetCurrentAnchorPoint()
504 Vector3 ret = new Vector3(Interop.ActorInternal.GetCurrentAnchorPoint(SwigCPtr), true);
505 if (NDalicPINVOKE.SWIGPendingException.Pending)
506 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
510 internal void SetSize(float width, float height)
512 Interop.ActorInternal.SetSize(SwigCPtr, width, height);
513 if (NDalicPINVOKE.SWIGPendingException.Pending)
514 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
517 internal void SetSize(float width, float height, float depth)
519 Interop.ActorInternal.SetSize(SwigCPtr, width, height, depth);
520 if (NDalicPINVOKE.SWIGPendingException.Pending)
521 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
524 internal void SetSize(Vector2 size)
526 Interop.ActorInternal.SetSizeVector2(SwigCPtr, Vector2.getCPtr(size));
527 if (NDalicPINVOKE.SWIGPendingException.Pending)
528 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
531 internal void SetSize(Vector3 size)
533 Interop.ActorInternal.SetSizeVector3(SwigCPtr, Vector3.getCPtr(size));
534 if (NDalicPINVOKE.SWIGPendingException.Pending)
535 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
538 internal Vector3 GetTargetSize()
540 Vector3 ret = new Vector3(Interop.ActorInternal.GetTargetSize(SwigCPtr), true);
541 if (NDalicPINVOKE.SWIGPendingException.Pending)
542 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
546 internal Size2D GetCurrentSize()
548 Size ret = new Size(Interop.Actor.GetCurrentSize(SwigCPtr), true);
549 if (NDalicPINVOKE.SWIGPendingException.Pending)
550 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
551 Size2D size = new Size2D((int)ret.Width, (int)ret.Height);
556 internal Size2D GetCurrentSizeFloat()
558 Size ret = new Size(Interop.Actor.GetCurrentSize(SwigCPtr), true);
559 if (NDalicPINVOKE.SWIGPendingException.Pending)
560 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
564 internal Vector3 GetNaturalSize()
566 Vector3 ret = new Vector3(Interop.Actor.GetNaturalSize(SwigCPtr), true);
567 if (NDalicPINVOKE.SWIGPendingException.Pending)
568 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
572 internal void SetPosition(float x, float y)
574 Interop.ActorInternal.SetPosition(SwigCPtr, x, y);
575 if (NDalicPINVOKE.SWIGPendingException.Pending)
576 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
579 internal void SetPosition(float x, float y, float z)
581 Interop.ActorInternal.SetPosition(SwigCPtr, x, y, z);
582 if (NDalicPINVOKE.SWIGPendingException.Pending)
583 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
586 internal void SetPosition(Vector3 position)
588 Interop.ActorInternal.SetPosition(SwigCPtr, Vector3.getCPtr(position));
589 if (NDalicPINVOKE.SWIGPendingException.Pending)
590 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
593 internal void SetX(float x)
595 Interop.ActorInternal.SetX(SwigCPtr, x);
596 if (NDalicPINVOKE.SWIGPendingException.Pending)
597 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
600 internal void SetY(float y)
602 Interop.ActorInternal.SetY(SwigCPtr, y);
603 if (NDalicPINVOKE.SWIGPendingException.Pending)
604 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
607 internal void SetZ(float z)
609 Interop.ActorInternal.SetZ(SwigCPtr, z);
610 if (NDalicPINVOKE.SWIGPendingException.Pending)
611 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
614 internal void TranslateBy(Vector3 distance)
616 Interop.ActorInternal.TranslateBy(SwigCPtr, Vector3.getCPtr(distance));
617 if (NDalicPINVOKE.SWIGPendingException.Pending)
618 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
621 internal Position GetCurrentPosition()
623 Position ret = new Position(Interop.Actor.GetCurrentPosition(SwigCPtr), true);
624 if (NDalicPINVOKE.SWIGPendingException.Pending)
625 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
629 internal Vector3 GetCurrentWorldPosition()
631 Vector3 ret = new Vector3(Interop.ActorInternal.GetCurrentWorldPosition(SwigCPtr), true);
632 if (NDalicPINVOKE.SWIGPendingException.Pending)
633 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
637 internal void SetInheritPosition(bool inherit)
639 Interop.ActorInternal.SetInheritPosition(SwigCPtr, inherit);
640 if (NDalicPINVOKE.SWIGPendingException.Pending)
641 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
644 internal bool IsPositionInherited()
646 bool ret = Interop.ActorInternal.IsPositionInherited(SwigCPtr);
647 if (NDalicPINVOKE.SWIGPendingException.Pending)
648 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
652 internal void SetOrientation(Degree angle, Vector3 axis)
654 Interop.ActorInternal.SetOrientationDegree(SwigCPtr, Degree.getCPtr(angle), Vector3.getCPtr(axis));
655 if (NDalicPINVOKE.SWIGPendingException.Pending)
656 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
659 internal void SetOrientation(Radian angle, Vector3 axis)
661 Interop.ActorInternal.SetOrientationRadian(SwigCPtr, Radian.getCPtr(angle), Vector3.getCPtr(axis));
662 if (NDalicPINVOKE.SWIGPendingException.Pending)
663 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
666 internal void SetOrientation(Rotation orientation)
668 Interop.ActorInternal.SetOrientationQuaternion(SwigCPtr, Rotation.getCPtr(orientation));
669 if (NDalicPINVOKE.SWIGPendingException.Pending)
670 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
673 internal Rotation GetCurrentOrientation()
675 Rotation ret = new Rotation(Interop.ActorInternal.GetCurrentOrientation(SwigCPtr), true);
676 if (NDalicPINVOKE.SWIGPendingException.Pending)
677 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
681 internal void SetInheritOrientation(bool inherit)
683 Interop.ActorInternal.SetInheritOrientation(SwigCPtr, inherit);
684 if (NDalicPINVOKE.SWIGPendingException.Pending)
685 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
688 internal bool IsOrientationInherited()
690 bool ret = Interop.ActorInternal.IsOrientationInherited(SwigCPtr);
691 if (NDalicPINVOKE.SWIGPendingException.Pending)
692 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
696 internal Rotation GetCurrentWorldOrientation()
698 Rotation ret = new Rotation(Interop.ActorInternal.GetCurrentWorldOrientation(SwigCPtr), true);
699 if (NDalicPINVOKE.SWIGPendingException.Pending)
700 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
704 internal void SetScale(float scale)
706 Interop.ActorInternal.SetScale(SwigCPtr, scale);
707 if (NDalicPINVOKE.SWIGPendingException.Pending)
708 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
711 internal void SetScale(float scaleX, float scaleY, float scaleZ)
713 Interop.ActorInternal.SetScale(SwigCPtr, scaleX, scaleY, scaleZ);
714 if (NDalicPINVOKE.SWIGPendingException.Pending)
715 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
718 internal void SetScale(Vector3 scale)
720 Interop.ActorInternal.SetScale(SwigCPtr, Vector3.getCPtr(scale));
721 if (NDalicPINVOKE.SWIGPendingException.Pending)
722 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
725 internal Vector3 GetCurrentScale()
727 Vector3 ret = new Vector3(Interop.ActorInternal.GetCurrentScale(SwigCPtr), true);
728 if (NDalicPINVOKE.SWIGPendingException.Pending)
729 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
733 internal Vector3 GetCurrentWorldScale()
735 Vector3 ret = new Vector3(Interop.ActorInternal.GetCurrentWorldScale(SwigCPtr), true);
736 if (NDalicPINVOKE.SWIGPendingException.Pending)
737 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
741 internal void SetInheritScale(bool inherit)
743 Interop.ActorInternal.SetInheritScale(SwigCPtr, inherit);
744 if (NDalicPINVOKE.SWIGPendingException.Pending)
745 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
748 internal bool IsScaleInherited()
750 bool ret = Interop.ActorInternal.IsScaleInherited(SwigCPtr);
751 if (NDalicPINVOKE.SWIGPendingException.Pending)
752 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
756 internal Matrix GetCurrentWorldMatrix()
758 Matrix ret = new Matrix(Interop.ActorInternal.GetCurrentWorldMatrix(SwigCPtr), true);
759 if (NDalicPINVOKE.SWIGPendingException.Pending)
760 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
764 internal void SetVisible(bool visible)
766 Interop.Actor.SetVisible(SwigCPtr, visible);
767 if (NDalicPINVOKE.SWIGPendingException.Pending)
768 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
771 internal bool IsVisible()
773 bool ret = Interop.ActorInternal.IsVisible(SwigCPtr);
774 if (NDalicPINVOKE.SWIGPendingException.Pending)
775 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
779 internal void SetOpacity(float opacity)
781 Interop.ActorInternal.SetOpacity(SwigCPtr, opacity);
782 if (NDalicPINVOKE.SWIGPendingException.Pending)
783 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
786 internal float GetCurrentOpacity()
788 float ret = Interop.ActorInternal.GetCurrentOpacity(SwigCPtr);
789 if (NDalicPINVOKE.SWIGPendingException.Pending)
790 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
794 internal Vector4 GetCurrentColor()
796 Vector4 ret = new Vector4(Interop.ActorInternal.GetCurrentColor(SwigCPtr), true);
797 if (NDalicPINVOKE.SWIGPendingException.Pending)
798 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
801 internal ColorMode GetColorMode()
803 ColorMode ret = (ColorMode)Interop.ActorInternal.GetColorMode(SwigCPtr);
804 if (NDalicPINVOKE.SWIGPendingException.Pending)
805 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
809 internal Vector4 GetCurrentWorldColor()
811 Vector4 ret = new Vector4(Interop.ActorInternal.GetCurrentWorldColor(SwigCPtr), true);
812 if (NDalicPINVOKE.SWIGPendingException.Pending)
813 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
817 internal void SetDrawMode(DrawModeType drawMode)
819 Interop.ActorInternal.SetDrawMode(SwigCPtr, (int)drawMode);
820 if (NDalicPINVOKE.SWIGPendingException.Pending)
821 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
824 internal DrawModeType GetDrawMode()
826 DrawModeType ret = (DrawModeType)Interop.ActorInternal.GetDrawMode(SwigCPtr);
827 if (NDalicPINVOKE.SWIGPendingException.Pending)
828 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
832 internal void SetKeyboardFocusable(bool focusable)
834 Interop.ActorInternal.SetKeyboardFocusable(SwigCPtr, focusable);
835 if (NDalicPINVOKE.SWIGPendingException.Pending)
836 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
839 internal bool IsKeyboardFocusable()
841 bool ret = Interop.ActorInternal.IsKeyboardFocusable(SwigCPtr);
842 if (NDalicPINVOKE.SWIGPendingException.Pending)
843 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
847 internal void SetKeyboardFocusableChildren(bool focusable)
849 Interop.ActorInternal.SetKeyboardFocusableChildren(SwigCPtr, focusable);
850 if (NDalicPINVOKE.SWIGPendingException.Pending)
851 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
854 internal bool AreChildrenKeyBoardFocusable()
856 bool ret = Interop.ActorInternal.AreChildrenKeyBoardFocusable(SwigCPtr);
857 if (NDalicPINVOKE.SWIGPendingException.Pending)
858 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
862 internal void SetFocusableInTouch(bool enabled)
864 Interop.ActorInternal.SetFocusableInTouch(SwigCPtr, enabled);
865 if (NDalicPINVOKE.SWIGPendingException.Pending)
866 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
869 internal bool IsFocusableInTouch()
871 bool ret = Interop.ActorInternal.IsFocusableInTouch(SwigCPtr);
872 if (NDalicPINVOKE.SWIGPendingException.Pending)
873 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
877 internal void SetResizePolicy(ResizePolicyType policy, DimensionType dimension)
879 Interop.Actor.SetResizePolicy(SwigCPtr, (int)policy, (int)dimension);
880 if (NDalicPINVOKE.SWIGPendingException.Pending)
881 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
884 internal ResizePolicyType GetResizePolicy(DimensionType dimension)
886 ResizePolicyType ret = (ResizePolicyType)Interop.Actor.GetResizePolicy(SwigCPtr, (int)dimension);
887 if (NDalicPINVOKE.SWIGPendingException.Pending)
888 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
892 internal Vector3 GetSizeModeFactor()
894 Vector3 ret = new Vector3(Interop.Actor.GetSizeModeFactor(SwigCPtr), true);
895 if (NDalicPINVOKE.SWIGPendingException.Pending)
896 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
900 internal void SetMinimumSize(Vector2 size)
902 Interop.ActorInternal.SetMinimumSize(SwigCPtr, Vector2.getCPtr(size));
903 if (NDalicPINVOKE.SWIGPendingException.Pending)
904 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
907 internal Vector2 GetMinimumSize()
909 Vector2 ret = new Vector2(Interop.ActorInternal.GetMinimumSize(SwigCPtr), true);
910 if (NDalicPINVOKE.SWIGPendingException.Pending)
911 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
915 internal void SetMaximumSize(Vector2 size)
917 Interop.ActorInternal.SetMaximumSize(SwigCPtr, Vector2.getCPtr(size));
918 if (NDalicPINVOKE.SWIGPendingException.Pending)
919 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
922 internal Vector2 GetMaximumSize()
924 Vector2 ret = new Vector2(Interop.ActorInternal.GetMaximumSize(SwigCPtr), true);
925 if (NDalicPINVOKE.SWIGPendingException.Pending)
926 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
930 internal int GetHierarchyDepth()
932 int ret = Interop.Actor.GetHierarchyDepth(SwigCPtr);
933 if (NDalicPINVOKE.SWIGPendingException.Pending)
934 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
938 internal uint GetRendererCount()
940 uint ret = Interop.Actor.GetRendererCount(SwigCPtr);
941 if (NDalicPINVOKE.SWIGPendingException.Pending)
942 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
946 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(View obj)
948 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.SwigCPtr;
951 internal bool IsTopLevelView()
953 if (GetParent() is Layer)
960 internal void SetKeyInputFocus()
962 Interop.ViewInternal.SetKeyInputFocus(SwigCPtr);
963 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
966 internal void ClearKeyInputFocus()
968 Interop.ViewInternal.ClearKeyInputFocus(SwigCPtr);
969 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
972 internal PinchGestureDetector GetPinchGestureDetector()
974 PinchGestureDetector ret = new PinchGestureDetector(Interop.ViewInternal.GetPinchGestureDetector(SwigCPtr), true);
975 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
979 internal PanGestureDetector GetPanGestureDetector()
981 PanGestureDetector ret = new PanGestureDetector(Interop.ViewInternal.GetPanGestureDetector(SwigCPtr), true);
982 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
986 internal TapGestureDetector GetTapGestureDetector()
988 TapGestureDetector ret = new TapGestureDetector(Interop.ViewInternal.GetTapGestureDetector(SwigCPtr), true);
989 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
993 internal LongPressGestureDetector GetLongPressGestureDetector()
995 LongPressGestureDetector ret = new LongPressGestureDetector(Interop.ViewInternal.GetLongPressGestureDetector(SwigCPtr), true);
996 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1000 internal IntPtr GetPtrfromView()
1002 return (IntPtr)SwigCPtr;
1005 internal void RemoveChild(View child)
1007 // Do actual child removal
1008 Interop.Actor.Remove(SwigCPtr, View.getCPtr(child));
1009 if (NDalicPINVOKE.SWIGPendingException.Pending)
1010 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1012 Children.Remove(child);
1013 child.InternalParent = null;
1015 RemoveChildBindableObject(child);
1017 if (ChildRemoved != null)
1019 ChildRemovedEventArgs e = new ChildRemovedEventArgs
1023 ChildRemoved(this, e);
1028 /// Removes the layout from this View.
1030 internal void ResetLayout()
1032 // ResizePolicy is restored when Layout is unset and it is considered when View size is calculated.
1033 RestoreResizePolicy();
1037 internal ResourceLoadingStatusType GetBackgroundResourceStatus()
1039 return (ResourceLoadingStatusType)Interop.View.GetVisualResourceStatus(this.SwigCPtr, Property.BACKGROUND);
1042 /// TODO open as a protected level
1043 internal virtual void ApplyCornerRadius()
1045 if (backgroundExtraData == null) return;
1047 var cornerRadius = backgroundExtraData.CornerRadius == null ? new PropertyValue() : new PropertyValue(backgroundExtraData.CornerRadius);
1049 // Apply to the background visual
1050 PropertyMap backgroundMap = new PropertyMap();
1051 PropertyValue background = Tizen.NUI.Object.GetProperty(SwigCPtr, View.Property.BACKGROUND);
1053 if (background.Get(backgroundMap) && !backgroundMap.Empty())
1055 backgroundMap[Visual.Property.CornerRadius] = cornerRadius;
1056 backgroundMap[Visual.Property.CornerRadiusPolicy] = new PropertyValue((int)backgroundExtraData.CornerRadiusPolicy);
1057 var temp = new PropertyValue(backgroundMap);
1058 Tizen.NUI.Object.SetProperty(SwigCPtr, View.Property.BACKGROUND, temp);
1061 backgroundMap.Dispose();
1062 background.Dispose();
1064 // Apply to the shadow visual
1065 PropertyMap shadowMap = new PropertyMap();
1066 PropertyValue shadow = Tizen.NUI.Object.GetProperty(SwigCPtr, View.Property.SHADOW);
1067 if (shadow.Get(shadowMap) && !shadowMap.Empty())
1069 shadowMap[Visual.Property.CornerRadius] = cornerRadius;
1070 shadowMap[Visual.Property.CornerRadiusPolicy] = new PropertyValue((int)backgroundExtraData.CornerRadiusPolicy);
1071 var temp = new PropertyValue(shadowMap);
1072 Tizen.NUI.Object.SetProperty(SwigCPtr, View.Property.SHADOW, temp);
1075 shadowMap.Dispose();
1077 cornerRadius.Dispose();
1080 /// TODO open as a protected level
1081 internal virtual void ApplyBorderline()
1083 if (backgroundExtraData == null) return;
1085 var borderlineColor = backgroundExtraData.BorderlineColor == null ? new PropertyValue(Color.Black) : new PropertyValue(backgroundExtraData.BorderlineColor);
1087 // Apply to the background visual
1088 PropertyMap backgroundMap = new PropertyMap();
1089 PropertyValue background = Tizen.NUI.Object.GetProperty(SwigCPtr, View.Property.BACKGROUND);
1090 if (background.Get(backgroundMap) && !backgroundMap.Empty())
1092 backgroundMap[Visual.Property.BorderlineWidth] = new PropertyValue(backgroundExtraData.BorderlineWidth);
1093 backgroundMap[Visual.Property.BorderlineColor] = borderlineColor;
1094 backgroundMap[Visual.Property.BorderlineOffset] = new PropertyValue(backgroundExtraData.BorderlineOffset);
1095 var temp = new PropertyValue(backgroundMap);
1096 Tizen.NUI.Object.SetProperty(SwigCPtr, View.Property.BACKGROUND, temp);
1099 backgroundMap.Dispose();
1100 background.Dispose();
1101 borderlineColor.Dispose();
1105 /// Get selector value from the triggerable selector or related property.
1107 internal Selector<T> GetSelector<T>(TriggerableSelector<T> triggerableSelector, NUI.Binding.BindableProperty relatedProperty)
1109 var selector = triggerableSelector?.Get();
1110 if (selector != null)
1115 var value = (T)GetValue(relatedProperty);
1116 return value == null ? null : new Selector<T>(value);
1119 internal void SetThemeApplied()
1121 if (themeData == null) themeData = new ThemeData();
1122 themeData.ThemeApplied = true;
1124 if (ThemeChangeSensitive && !themeData.ListeningThemeChangeEvent)
1126 themeData.ListeningThemeChangeEvent = true;
1127 ThemeManager.ThemeChangedInternal.Add(OnThemeChanged);
1132 /// you can override it to clean-up your own resources.
1134 /// <param name="type">DisposeTypes</param>
1135 /// <since_tizen> 3 </since_tizen>
1136 protected override void Dispose(DisposeTypes type)
1144 NUILog.Debug($"[Dispose] View.Dispose({type}) START");
1145 NUILog.Debug($"[Dispose] type:{GetType()} copyNativeHandle:{GetBaseHandleCPtrHandleRef.Handle.ToString("X8")}");
1148 NUILog.Debug($"[Dispose] ID:{Interop.Actor.GetId(GetBaseHandleCPtrHandleRef)} Name:{Interop.Actor.GetName(GetBaseHandleCPtrHandleRef)}");
1152 NUILog.Debug($"has no native body!");
1157 //_mergedStyle = null;
1159 internalMaximumSize?.Dispose();
1160 internalMaximumSize = null;
1161 internalMinimumSize?.Dispose();
1162 internalMinimumSize = null;
1163 internalMargin?.Dispose();
1164 internalMargin = null;
1165 internalPadding?.Dispose();
1166 internalPadding = null;
1167 internalSizeModeFactor?.Dispose();
1168 internalSizeModeFactor = null;
1169 internalCellIndex?.Dispose();
1170 internalCellIndex = null;
1171 internalBackgroundColor?.Dispose();
1172 internalBackgroundColor = null;
1173 internalColor?.Dispose();
1174 internalColor = null;
1175 internalPivotPoint?.Dispose();
1176 internalPivotPoint = null;
1177 internalPosition?.Dispose();
1178 internalPosition = null;
1179 internalPosition2D?.Dispose();
1180 internalPosition2D = null;
1181 internalScale?.Dispose();
1182 internalScale = null;
1183 internalSize?.Dispose();
1184 internalSize = null;
1185 internalSize2D?.Dispose();
1186 internalSize2D = null;
1188 if (type == DisposeTypes.Explicit)
1191 //Release your own managed resources here.
1192 //You should release all of your own disposable objects here.
1193 if (themeData != null)
1195 themeData.selectorData?.Reset(this);
1196 if (themeData.ListeningThemeChangeEvent)
1198 ThemeManager.ThemeChangedInternal.Remove(OnThemeChanged);
1201 if(widthConstraint != null)
1203 widthConstraint.Remove();
1204 widthConstraint.Dispose();
1206 if(heightConstraint != null)
1208 heightConstraint.Remove();
1209 heightConstraint.Dispose();
1213 //Release your own unmanaged resources here.
1214 //You should not access any managed member here except static instance.
1215 //because the execution order of Finalizes is non-deterministic.
1217 DisConnectFromSignals();
1219 foreach (View view in Children)
1221 view.InternalParent = null;
1224 NUILog.Debug($"[Dispose] View.Dispose({type}) END");
1225 NUILog.Debug($"=============================");
1230 /// This will not be public opened.
1231 [EditorBrowsable(EditorBrowsableState.Never)]
1232 protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
1234 Interop.View.DeleteView(swigCPtr);
1238 /// The touch event handler for ControlState.
1239 /// Please change ControlState value by touch state if needed.
1241 /// <exception cref="ArgumentNullException"> Thrown when touch is null. </exception>
1242 [EditorBrowsable(EditorBrowsableState.Never)]
1243 protected virtual bool HandleControlStateOnTouch(Touch touch)
1247 throw new global::System.ArgumentNullException(nameof(touch));
1250 switch (touch.GetState(0))
1252 case PointStateType.Down:
1253 ControlState += ControlState.Pressed;
1255 case PointStateType.Interrupted:
1256 case PointStateType.Up:
1257 if (ControlState.Contains(ControlState.Pressed))
1259 ControlState -= ControlState.Pressed;
1268 private void DisConnectFromSignals()
1270 if (HasBody() == false)
1272 NUILog.Debug($"[Dispose] DisConnectFromSignals() No native body! No need to Disconnect Signals!");
1275 NUILog.Debug($"[Dispose] DisConnectFromSignals START");
1276 NUILog.Debug($"[Dispose] View.DisConnectFromSignals() type:{GetType()} copyNativeHandle:{GetBaseHandleCPtrHandleRef.Handle.ToString("X8")}");
1277 NUILog.Debug($"[Dispose] ID:{Interop.Actor.GetId(GetBaseHandleCPtrHandleRef)} Name:{Interop.Actor.GetName(GetBaseHandleCPtrHandleRef)}");
1279 if (onRelayoutEventCallback != null)
1281 NUILog.Debug($"[Dispose] onRelayoutEventCallback");
1283 using ViewSignal signal = new ViewSignal(Interop.ActorSignal.ActorOnRelayoutSignal(GetBaseHandleCPtrHandleRef), false);
1284 signal?.Disconnect(onRelayoutEventCallback);
1285 onRelayoutEventCallback = null;
1288 if (offWindowEventCallback != null)
1290 NUILog.Debug($"[Dispose] offWindowEventCallback");
1292 using ViewSignal signal = new ViewSignal(Interop.ActorSignal.ActorOffSceneSignal(GetBaseHandleCPtrHandleRef), false);
1293 signal?.Disconnect(offWindowEventCallback);
1294 offWindowEventCallback = null;
1297 if (onWindowEventCallback != null)
1299 NUILog.Debug($"[Dispose] onWindowEventCallback");
1301 using ViewSignal signal = new ViewSignal(Interop.ActorSignal.ActorOnSceneSignal(GetBaseHandleCPtrHandleRef), false);
1302 signal?.Disconnect(onWindowEventCallback);
1303 onWindowEventCallback = null;
1306 if (wheelEventCallback != null)
1308 NUILog.Debug($"[Dispose] wheelEventCallback");
1310 using WheelSignal signal = new WheelSignal(Interop.ActorSignal.ActorWheelEventSignal(GetBaseHandleCPtrHandleRef), false);
1311 signal?.Disconnect(wheelEventCallback);
1312 wheelEventCallback = null;
1315 if (WindowWheelEventHandler != null)
1317 NUILog.Debug($"[Dispose] WindowWheelEventHandler");
1319 NUIApplication.GetDefaultWindow().WheelEvent -= OnWindowWheelEvent;
1320 WindowWheelEventHandler = null;
1323 if (hoverEventCallback != null)
1325 NUILog.Debug($"[Dispose] hoverEventCallback");
1327 using HoverSignal signal = new HoverSignal(Interop.ActorSignal.ActorHoveredSignal(GetBaseHandleCPtrHandleRef), false);
1328 signal?.Disconnect(hoverEventCallback);
1329 hoverEventCallback = null;
1332 if (interceptTouchDataCallback != null)
1334 NUILog.Debug($"[Dispose] interceptTouchDataCallback");
1336 using TouchDataSignal signal = new TouchDataSignal(Interop.ActorSignal.ActorInterceptTouchSignal(GetBaseHandleCPtrHandleRef), false);
1337 signal?.Disconnect(interceptTouchDataCallback);
1338 interceptTouchDataCallback = null;
1341 if (touchDataCallback != null)
1343 NUILog.Debug($"[Dispose] touchDataCallback");
1345 using TouchDataSignal signal = new TouchDataSignal(Interop.ActorSignal.ActorTouchSignal(GetBaseHandleCPtrHandleRef), false);
1346 signal?.Disconnect(touchDataCallback);
1347 touchDataCallback = null;
1350 if (ResourcesLoadedCallback != null)
1352 NUILog.Debug($"[Dispose] ResourcesLoadedCallback");
1354 using ViewSignal signal = new ViewSignal(Interop.View.ResourceReadySignal(GetBaseHandleCPtrHandleRef), false);
1355 signal?.Disconnect(ResourcesLoadedCallback);
1356 ResourcesLoadedCallback = null;
1359 if (keyCallback != null)
1361 NUILog.Debug($"[Dispose] keyCallback");
1363 using ControlKeySignal signal = new ControlKeySignal(Interop.ViewSignal.KeyEventSignal(GetBaseHandleCPtrHandleRef), false);
1364 signal?.Disconnect(keyCallback);
1368 if (keyInputFocusLostCallback != null)
1370 NUILog.Debug($"[Dispose] keyInputFocusLostCallback");
1372 using KeyInputFocusSignal signal = new KeyInputFocusSignal(Interop.ViewSignal.KeyInputFocusLostSignal(GetBaseHandleCPtrHandleRef), false);
1373 signal?.Disconnect(keyInputFocusLostCallback);
1374 keyInputFocusLostCallback = null;
1377 if (keyInputFocusGainedCallback != null)
1379 NUILog.Debug($"[Dispose] keyInputFocusGainedCallback");
1381 using KeyInputFocusSignal signal = new KeyInputFocusSignal(Interop.ViewSignal.KeyInputFocusGainedSignal(GetBaseHandleCPtrHandleRef), false);
1382 signal?.Disconnect(keyInputFocusGainedCallback);
1383 keyInputFocusGainedCallback = null;
1386 if (backgroundResourceLoadedCallback != null)
1388 NUILog.Debug($"[Dispose] backgroundResourceLoadedCallback");
1390 using ViewSignal signal = new ViewSignal(Interop.View.ResourceReadySignal(GetBaseHandleCPtrHandleRef), false);
1391 signal?.Disconnect(backgroundResourceLoadedCallback);
1392 backgroundResourceLoadedCallback = null;
1395 if (onWindowSendEventCallback != null)
1397 NUILog.Debug($"[Dispose] onWindowSendEventCallback");
1399 using ViewSignal signal = new ViewSignal(Interop.ActorSignal.ActorOnSceneSignal(GetBaseHandleCPtrHandleRef), false);
1400 signal?.Disconnect(onWindowSendEventCallback);
1401 onWindowSendEventCallback = null;
1403 NUILog.Debug($"[Dispose] DisConnectFromSignals END");
1407 /// Apply initial style to the view.
1409 [EditorBrowsable(EditorBrowsableState.Never)]
1410 protected virtual void InitializeStyle(ViewStyle style = null)
1412 var initialStyle = ThemeManager.GetInitialStyleWithoutClone(GetType());
1415 ApplyStyle(initialStyle);
1419 var refinedStyle = style;
1420 if (style.IncludeDefaultStyle)
1422 refinedStyle = initialStyle?.Merge(style);
1424 ApplyStyle(refinedStyle);
1427 // Listen theme change event if needs.
1428 if (ThemeManager.PlatformThemeEnabled && initialStyle != null)
1434 private View ConvertIdToView(uint id)
1436 View view = GetParent()?.FindCurrentChildById(id);
1438 //If we can't find the parent's children, find in the top layer.
1441 Container parent = GetParent();
1442 while ((parent is View) && (parent != null))
1444 parent = parent.GetParent();
1445 if (parent is Layer)
1447 view = parent.FindCurrentChildById(id);
1456 private void OnScaleChanged(float x, float y, float z)
1458 Scale = new Vector3(x, y, z);
1461 private void OnBackgroundColorChanged(float r, float g, float b, float a)
1463 BackgroundColor = new Color(r, g, b, a);
1466 private void OnPaddingChanged(ushort start, ushort end, ushort top, ushort bottom)
1468 Padding = new Extents(start, end, top, bottom);
1471 private void OnMarginChanged(ushort start, ushort end, ushort top, ushort bottom)
1473 Margin = new Extents(start, end, top, bottom);
1476 private void OnAnchorPointChanged(float x, float y, float z)
1478 AnchorPoint = new Position(x, y, z);
1481 private void OnCellIndexChanged(float x, float y)
1483 CellIndex = new Vector2(x, y);
1486 private void OnFlexMarginChanged(float x, float y, float z, float w)
1488 FlexMargin = new Vector4(x, y, z, w);
1491 private void OnPaddingEXChanged(ushort start, ushort end, ushort top, ushort bottom)
1493 PaddingEX = new Extents(start, end, top, bottom);
1496 private void OnSizeModeFactorChanged(float x, float y, float z)
1498 SizeModeFactor = new Vector3(x, y, z);
1501 private bool EmptyOnTouch(object target, TouchEventArgs args)
1506 private ViewSelectorData EnsureSelectorData()
1508 if (themeData == null) themeData = new ThemeData();
1510 return themeData.selectorData ?? (themeData.selectorData = new ViewSelectorData());
1513 // ResizePolicy is stored when Layout is set and it is ignored when View size is calculated.
1514 private void IgnoreResizePolicy()
1516 if (isIgnoredResizePolicy) return;
1517 isIgnoredResizePolicy = true;
1519 widthResizePolicy = WidthResizePolicy;
1520 heightResizePolicy = HeightResizePolicy;
1522 // Set bindable property directly not to store width/heightResizePolicy duplicately.
1523 SetValue(WidthResizePolicyProperty, ResizePolicyType.Fixed);
1524 SetValue(HeightResizePolicyProperty, ResizePolicyType.Fixed);
1525 NotifyPropertyChanged();
1528 // ResizePolicy is restored when Layout is unset and it is considered when View size is calculated.
1529 private void RestoreResizePolicy()
1531 if (!isIgnoredResizePolicy) return;
1532 isIgnoredResizePolicy = false;
1534 // Set bindable property directly not to store width/heightResizePolicy duplicately.
1535 SetValue(WidthResizePolicyProperty, widthResizePolicy);
1536 SetValue(HeightResizePolicyProperty, heightResizePolicy);
1537 NotifyPropertyChanged();