2 * Copyright(c) 2019 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.Runtime.InteropServices;
21 namespace Tizen.NUI.BaseComponents
24 /// View is the base class for all views.
26 /// <since_tizen> 3 </since_tizen>
27 public partial class View
29 private EventHandler _offWindowEventHandler;
30 private OffWindowEventCallbackType _offWindowEventCallback;
31 private EventHandlerWithReturnType<object, WheelEventArgs, bool> _wheelEventHandler;
32 private WheelEventCallbackType _wheelEventCallback;
33 private EventHandlerWithReturnType<object, KeyEventArgs, bool> _keyEventHandler;
34 private KeyCallbackType _keyCallback;
35 private EventHandlerWithReturnType<object, TouchEventArgs, bool> _touchDataEventHandler;
36 private TouchDataCallbackType _touchDataCallback;
37 private EventHandlerWithReturnType<object, HoverEventArgs, bool> _hoverEventHandler;
38 private HoverEventCallbackType _hoverEventCallback;
39 private EventHandler<VisibilityChangedEventArgs> _visibilityChangedEventHandler;
40 private VisibilityChangedEventCallbackType _visibilityChangedEventCallback;
41 private EventHandler _keyInputFocusGainedEventHandler;
42 private KeyInputFocusGainedCallbackType _keyInputFocusGainedCallback;
43 private EventHandler _keyInputFocusLostEventHandler;
44 private KeyInputFocusLostCallbackType _keyInputFocusLostCallback;
45 private EventHandler _onRelayoutEventHandler;
46 private OnRelayoutEventCallbackType _onRelayoutEventCallback;
47 private EventHandler _onWindowEventHandler;
48 private OnWindowEventCallbackType _onWindowEventCallback;
49 private EventHandler<LayoutDirectionChangedEventArgs> _layoutDirectionChangedEventHandler;
50 private LayoutDirectionChangedEventCallbackType _layoutDirectionChangedEventCallback;
51 // Resource Ready Signal
52 private EventHandler _resourcesLoadedEventHandler;
53 private ResourcesLoadedCallbackType _ResourcesLoadedCallback;
54 private EventHandler<BackgroundResourceLoadedEventArgs> _backgroundResourceLoadedEventHandler;
55 private _backgroundResourceLoadedCallbackType _backgroundResourceLoadedCallback;
57 private OnWindowEventCallbackType _onWindowSendEventCallback;
59 private void SendViewAddedEventToWindow(IntPtr data)
61 Window.Instance?.SendViewAdded(this);
64 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
65 private delegate void OffWindowEventCallbackType(IntPtr control);
66 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
67 private delegate bool WheelEventCallbackType(IntPtr view, IntPtr wheelEvent);
68 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
69 private delegate bool KeyCallbackType(IntPtr control, IntPtr keyEvent);
70 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
71 private delegate bool TouchDataCallbackType(IntPtr view, IntPtr touchData);
72 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
73 private delegate bool HoverEventCallbackType(IntPtr view, IntPtr hoverEvent);
74 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
75 private delegate void VisibilityChangedEventCallbackType(IntPtr data, bool visibility, VisibilityChangeType type);
76 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
77 private delegate void ResourcesLoadedCallbackType(IntPtr control);
78 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
79 private delegate void _backgroundResourceLoadedCallbackType(IntPtr view);
80 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
81 private delegate void KeyInputFocusGainedCallbackType(IntPtr control);
82 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
83 private delegate void KeyInputFocusLostCallbackType(IntPtr control);
84 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
85 private delegate void OnRelayoutEventCallbackType(IntPtr control);
86 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
87 private delegate void OnWindowEventCallbackType(IntPtr control);
88 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
89 private delegate void LayoutDirectionChangedEventCallbackType(IntPtr data, ViewLayoutDirectionType type);
92 /// Event when a child is removed.
94 /// <since_tizen> 5 </since_tizen>
95 public new event EventHandler<ChildRemovedEventArgs> ChildRemoved;
97 /// Event when a child is added.
99 /// <since_tizen> 5 </since_tizen>
100 public new event EventHandler<ChildAddedEventArgs> ChildAdded;
103 /// An event for the KeyInputFocusGained signal which can be used to subscribe or unsubscribe the event handler provided by the user.<br />
104 /// The KeyInputFocusGained signal is emitted when the control gets the key input focus.<br />
106 /// <since_tizen> 3 </since_tizen>
107 public event EventHandler FocusGained
111 if (_keyInputFocusGainedEventHandler == null)
113 _keyInputFocusGainedCallback = OnKeyInputFocusGained;
114 this.KeyInputFocusGainedSignal().Connect(_keyInputFocusGainedCallback);
117 _keyInputFocusGainedEventHandler += value;
122 _keyInputFocusGainedEventHandler -= value;
124 if (_keyInputFocusGainedEventHandler == null && KeyInputFocusGainedSignal().Empty() == false)
126 this.KeyInputFocusGainedSignal().Disconnect(_keyInputFocusGainedCallback);
132 /// An event for the KeyInputFocusLost signal which can be used to subscribe or unsubscribe the event handler provided by the user.<br />
133 /// The KeyInputFocusLost signal is emitted when the control loses the key input focus.<br />
135 /// <since_tizen> 3 </since_tizen>
136 public event EventHandler FocusLost
140 if (_keyInputFocusLostEventHandler == null)
142 _keyInputFocusLostCallback = OnKeyInputFocusLost;
143 this.KeyInputFocusLostSignal().Connect(_keyInputFocusLostCallback);
146 _keyInputFocusLostEventHandler += value;
151 _keyInputFocusLostEventHandler -= value;
153 if (_keyInputFocusLostEventHandler == null && KeyInputFocusLostSignal().Empty() == false)
155 this.KeyInputFocusLostSignal().Disconnect(_keyInputFocusLostCallback);
161 /// An event for the KeyPressed signal which can be used to subscribe or unsubscribe the event handler provided by the user.<br />
162 /// The KeyPressed signal is emitted when the key event is received.<br />
164 /// <since_tizen> 3 </since_tizen>
165 public event EventHandlerWithReturnType<object, KeyEventArgs, bool> KeyEvent
169 if (_keyEventHandler == null)
171 _keyCallback = OnKeyEvent;
172 this.KeyEventSignal().Connect(_keyCallback);
175 _keyEventHandler += value;
180 _keyEventHandler -= value;
182 if (_keyEventHandler == null && KeyEventSignal().Empty() == false)
184 this.KeyEventSignal().Disconnect(_keyCallback);
190 /// An event for the OnRelayout signal which can be used to subscribe or unsubscribe the event handler.<br />
191 /// The OnRelayout signal is emitted after the size has been set on the view during relayout.<br />
193 /// <since_tizen> 3 </since_tizen>
194 public event EventHandler Relayout
198 if (_onRelayoutEventHandler == null)
200 _onRelayoutEventCallback = OnRelayout;
201 this.OnRelayoutSignal().Connect(_onRelayoutEventCallback);
204 _onRelayoutEventHandler += value;
209 _onRelayoutEventHandler -= value;
211 if (_onRelayoutEventHandler == null && OnRelayoutSignal().Empty() == false)
213 this.OnRelayoutSignal().Disconnect(_onRelayoutEventCallback);
220 /// An event for the touched signal which can be used to subscribe or unsubscribe the event handler provided by the user.<br />
221 /// The touched signal is emitted when the touch input is received.<br />
223 /// <since_tizen> 3 </since_tizen>
224 public event EventHandlerWithReturnType<object, TouchEventArgs, bool> TouchEvent
228 if (_touchDataEventHandler == null)
230 _touchDataCallback = OnTouch;
231 this.TouchSignal().Connect(_touchDataCallback);
234 _touchDataEventHandler += value;
239 _touchDataEventHandler -= value;
241 if (_touchDataEventHandler == null && TouchSignal().Empty() == false)
243 this.TouchSignal().Disconnect(_touchDataCallback);
250 /// An event for the hovered signal which can be used to subscribe or unsubscribe the event handler provided by the user.<br />
251 /// The hovered signal is emitted when the hover input is received.<br />
253 /// <since_tizen> 3 </since_tizen>
254 public event EventHandlerWithReturnType<object, HoverEventArgs, bool> HoverEvent
258 if (_hoverEventHandler == null)
260 _hoverEventCallback = OnHoverEvent;
261 this.HoveredSignal().Connect(_hoverEventCallback);
264 _hoverEventHandler += value;
269 _hoverEventHandler -= value;
271 if (_hoverEventHandler == null && HoveredSignal().Empty() == false)
273 this.HoveredSignal().Disconnect(_hoverEventCallback);
280 /// An event for the WheelMoved signal which can be used to subscribe or unsubscribe the event handler provided by the user.<br />
281 /// The WheelMoved signal is emitted when the wheel event is received.<br />
283 /// <since_tizen> 3 </since_tizen>
284 public event EventHandlerWithReturnType<object, WheelEventArgs, bool> WheelEvent
288 if (_wheelEventHandler == null)
290 _wheelEventCallback = OnWheelEvent;
291 this.WheelEventSignal().Connect(_wheelEventCallback);
293 _wheelEventHandler += value;
295 if (WindowWheelEventHandler == null)
297 Window.Instance.WheelEvent += OnWindowWheelEvent;
299 WindowWheelEventHandler += value;
304 _wheelEventHandler -= value;
305 if (_wheelEventHandler == null && WheelEventSignal().Empty() == false)
307 this.WheelEventSignal().Disconnect(_wheelEventCallback);
310 WindowWheelEventHandler -= value;
311 if (WindowWheelEventHandler == null)
313 Window.Instance.WheelEvent -= OnWindowWheelEvent;
319 /// An event for the OnWindow signal which can be used to subscribe or unsubscribe the event handler.<br />
320 /// The OnWindow signal is emitted after the view has been connected to the window.<br />
322 /// <since_tizen> 3 </since_tizen>
323 public event EventHandler AddedToWindow
327 if (_onWindowEventHandler == null)
329 _onWindowEventCallback = OnWindow;
330 this.OnWindowSignal().Connect(_onWindowEventCallback);
333 _onWindowEventHandler += value;
338 _onWindowEventHandler -= value;
340 if (_onWindowEventHandler == null && OnWindowSignal().Empty() == false)
342 this.OnWindowSignal().Disconnect(_onWindowEventCallback);
348 /// An event for the OffWindow signal, which can be used to subscribe or unsubscribe the event handler.<br />
349 /// OffWindow signal is emitted after the view has been disconnected from the window.<br />
351 /// <since_tizen> 3 </since_tizen>
352 public event EventHandler RemovedFromWindow
356 if (_offWindowEventHandler == null)
358 _offWindowEventCallback = OffWindow;
359 this.OffWindowSignal().Connect(_offWindowEventCallback);
362 _offWindowEventHandler += value;
367 _offWindowEventHandler -= value;
369 if (_offWindowEventHandler == null && OffWindowSignal().Empty() == false)
371 this.OffWindowSignal().Disconnect(_offWindowEventCallback);
377 /// An event for visibility change which can be used to subscribe or unsubscribe the event handler.<br />
378 /// This signal is emitted when the visible property of this or a parent view is changed.<br />
380 /// <since_tizen> 3 </since_tizen>
381 public event EventHandler<VisibilityChangedEventArgs> VisibilityChanged
385 if (_visibilityChangedEventHandler == null)
387 _visibilityChangedEventCallback = OnVisibilityChanged;
388 VisibilityChangedSignal(this).Connect(_visibilityChangedEventCallback);
391 _visibilityChangedEventHandler += value;
396 _visibilityChangedEventHandler -= value;
398 if (_visibilityChangedEventHandler == null && VisibilityChangedSignal(this).Empty() == false)
400 VisibilityChangedSignal(this).Disconnect(_visibilityChangedEventCallback);
406 /// Event for layout direction change which can be used to subscribe/unsubscribe the event handler.<br />
407 /// This signal is emitted when the layout direction property of this or a parent view is changed.<br />
409 /// <since_tizen> 4 </since_tizen>
410 public event EventHandler<LayoutDirectionChangedEventArgs> LayoutDirectionChanged
414 if (_layoutDirectionChangedEventHandler == null)
416 _layoutDirectionChangedEventCallback = OnLayoutDirectionChanged;
417 LayoutDirectionChangedSignal(this).Connect(_layoutDirectionChangedEventCallback);
420 _layoutDirectionChangedEventHandler += value;
425 _layoutDirectionChangedEventHandler -= value;
427 if (_layoutDirectionChangedEventHandler == null && LayoutDirectionChangedSignal(this).Empty() == false)
429 LayoutDirectionChangedSignal(this).Disconnect(_layoutDirectionChangedEventCallback);
435 /// An event for the ResourcesLoadedSignal signal which can be used to subscribe or unsubscribe the event handler provided by the user.<br />
436 /// This signal is emitted after all resources required by a view are loaded and ready.<br />
438 /// <since_tizen> 3 </since_tizen>
439 public event EventHandler ResourcesLoaded
443 if (_resourcesLoadedEventHandler == null)
445 _ResourcesLoadedCallback = OnResourcesLoaded;
446 this.ResourcesLoadedSignal().Connect(_ResourcesLoadedCallback);
449 _resourcesLoadedEventHandler += value;
454 _resourcesLoadedEventHandler -= value;
456 if (_resourcesLoadedEventHandler == null && ResourcesLoadedSignal().Empty() == false)
458 this.ResourcesLoadedSignal().Disconnect(_ResourcesLoadedCallback);
463 internal event EventHandler<BackgroundResourceLoadedEventArgs> BackgroundResourceLoaded
467 if (_backgroundResourceLoadedEventHandler == null)
469 _backgroundResourceLoadedCallback = OnBackgroundResourceLoaded;
470 this.ResourcesLoadedSignal().Connect(_backgroundResourceLoadedCallback);
473 _backgroundResourceLoadedEventHandler += value;
477 _backgroundResourceLoadedEventHandler -= value;
479 if (_backgroundResourceLoadedEventHandler == null && ResourcesLoadedSignal().Empty() == false)
481 this.ResourcesLoadedSignal().Disconnect(_backgroundResourceLoadedCallback);
486 internal TouchDataSignal TouchSignal()
488 TouchDataSignal ret = new TouchDataSignal(Interop.ActorSignal.Actor_TouchSignal(swigCPtr), false);
489 if (NDalicPINVOKE.SWIGPendingException.Pending)
490 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
494 internal HoverSignal HoveredSignal()
496 HoverSignal ret = new HoverSignal(Interop.ActorSignal.Actor_HoveredSignal(swigCPtr), false);
497 if (NDalicPINVOKE.SWIGPendingException.Pending)
498 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
502 internal WheelSignal WheelEventSignal()
504 WheelSignal ret = new WheelSignal(Interop.ActorSignal.Actor_WheelEventSignal(swigCPtr), false);
505 if (NDalicPINVOKE.SWIGPendingException.Pending)
506 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
510 internal ViewSignal OnWindowSignal()
512 ViewSignal ret = new ViewSignal(Interop.ActorSignal.Actor_OnStageSignal(swigCPtr), false);
513 if (NDalicPINVOKE.SWIGPendingException.Pending)
514 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
518 internal ViewSignal OffWindowSignal()
520 ViewSignal ret = new ViewSignal(Interop.ActorSignal.Actor_OffStageSignal(swigCPtr), false);
521 if (NDalicPINVOKE.SWIGPendingException.Pending)
522 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
526 internal ViewSignal OnRelayoutSignal()
528 ViewSignal ret = new ViewSignal(Interop.ActorSignal.Actor_OnRelayoutSignal(swigCPtr), false);
529 if (NDalicPINVOKE.SWIGPendingException.Pending)
530 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
534 internal ViewVisibilityChangedSignal VisibilityChangedSignal(View view)
536 ViewVisibilityChangedSignal ret = new ViewVisibilityChangedSignal(Interop.NDalic.VisibilityChangedSignal(View.getCPtr(view)), false);
537 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
541 internal ViewLayoutDirectionChangedSignal LayoutDirectionChangedSignal(View view)
543 ViewLayoutDirectionChangedSignal ret = new ViewLayoutDirectionChangedSignal(Interop.Layout.LayoutDirectionChangedSignal(View.getCPtr(view)), false);
544 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
548 internal ViewSignal ResourcesLoadedSignal()
550 ViewSignal ret = new ViewSignal(Interop.View.ResourceReadySignal(swigCPtr), false);
551 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
555 internal ControlKeySignal KeyEventSignal()
557 ControlKeySignal ret = new ControlKeySignal(Interop.ViewSignal.View_KeyEventSignal(swigCPtr), false);
558 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
562 internal KeyInputFocusSignal KeyInputFocusGainedSignal()
564 KeyInputFocusSignal ret = new KeyInputFocusSignal(Interop.ViewSignal.View_KeyInputFocusGainedSignal(swigCPtr), false);
565 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
569 internal KeyInputFocusSignal KeyInputFocusLostSignal()
571 KeyInputFocusSignal ret = new KeyInputFocusSignal(Interop.ViewSignal.View_KeyInputFocusLostSignal(swigCPtr), false);
572 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
576 private void OnSize2DChanged(int width, int height)
578 Size2D = new Size2D(width, height);
581 private void OnMinimumSizeChanged(int width, int height)
583 MinimumSize = new Size2D(width, height);
586 private void OnMaximumSizeChanged(int width, int height)
588 MaximumSize = new Size2D(width, height);
591 private void OnPosition2DChanged(int x, int y)
593 Position2D = new Position2D(x, y);
596 private void OnSizeChanged(float width, float height, float depth)
598 Size = new Size(width, height, depth);
601 private void OnPositionChanged(float x, float y, float z)
603 Position = new Position(x, y, z);
606 private void OnParentOriginChanged(float x, float y, float z)
608 ParentOrigin = new Position(x, y, z);
611 private void OnPivotPointChanged(float x, float y, float z)
613 PivotPoint = new Position(x, y, z);
616 private void OnImageShadowChanged(ShadowBase instance)
618 ImageShadow = (ImageShadow)instance;
621 private void OnBoxShadowChanged(ShadowBase instance)
623 BoxShadow = (Shadow)instance;
626 private void OnBackgroundImageBorderChanged(int left, int right, int bottom, int top)
628 BackgroundImageBorder = new Rectangle(left, right, bottom, top);
631 private void OnKeyInputFocusGained(IntPtr view)
633 if (_keyInputFocusGainedEventHandler != null)
635 _keyInputFocusGainedEventHandler(this, null);
639 private void OnKeyInputFocusLost(IntPtr view)
641 if (_keyInputFocusLostEventHandler != null)
643 _keyInputFocusLostEventHandler(this, null);
647 private bool OnKeyEvent(IntPtr view, IntPtr keyEvent)
649 if (keyEvent == global::System.IntPtr.Zero)
651 NUILog.Error("keyEvent should not be null!");
655 KeyEventArgs e = new KeyEventArgs();
659 e.Key = Tizen.NUI.Key.GetKeyFromPtr(keyEvent);
661 if (_keyEventHandler != null)
663 Delegate[] delegateList = _keyEventHandler.GetInvocationList();
665 // Oring the result of each callback.
666 foreach (EventHandlerWithReturnType<object, KeyEventArgs, bool> del in delegateList)
668 result |= del(this, e);
675 // Callback for View OnRelayout signal
676 private void OnRelayout(IntPtr data)
678 if (_onRelayoutEventHandler != null)
680 _onRelayoutEventHandler(this, null);
684 // Callback for View TouchSignal
685 private bool OnTouch(IntPtr view, IntPtr touchData)
687 if (touchData == global::System.IntPtr.Zero)
689 NUILog.Error("touchData should not be null!");
693 TouchEventArgs e = new TouchEventArgs();
695 e.Touch = Tizen.NUI.Touch.GetTouchFromPtr(touchData);
697 if (_touchDataEventHandler != null)
699 return _touchDataEventHandler(this, e);
704 // Callback for View Hover signal
705 private bool OnHoverEvent(IntPtr view, IntPtr hoverEvent)
707 if (hoverEvent == global::System.IntPtr.Zero)
709 NUILog.Error("hoverEvent should not be null!");
713 HoverEventArgs e = new HoverEventArgs();
715 e.Hover = Tizen.NUI.Hover.GetHoverFromPtr(hoverEvent);
717 if (_hoverEventHandler != null)
719 return _hoverEventHandler(this, e);
724 // Callback for View Wheel signal
725 private bool OnWheelEvent(IntPtr view, IntPtr wheelEvent)
727 if (wheelEvent == global::System.IntPtr.Zero)
729 NUILog.Error("wheelEvent should not be null!");
733 WheelEventArgs e = new WheelEventArgs();
735 e.Wheel = Tizen.NUI.Wheel.GetWheelFromPtr(wheelEvent);
737 if (_wheelEventHandler != null)
739 return _wheelEventHandler(this, e);
744 // Callback for View OnWindow signal
745 private void OnWindow(IntPtr data)
747 if (_onWindowEventHandler != null)
749 _onWindowEventHandler(this, null);
753 // Callback for View OffWindow signal
754 private void OffWindow(IntPtr data)
756 if (_offWindowEventHandler != null)
758 _offWindowEventHandler(this, null);
762 // Callback for View visibility change signal
763 private void OnVisibilityChanged(IntPtr data, bool visibility, VisibilityChangeType type)
765 VisibilityChangedEventArgs e = new VisibilityChangedEventArgs();
768 e.View = Registry.GetManagedBaseHandleFromNativePtr(data) as View;
770 e.Visibility = visibility;
773 if (_visibilityChangedEventHandler != null)
775 _visibilityChangedEventHandler(this, e);
779 // Callback for View layout direction change signal
780 private void OnLayoutDirectionChanged(IntPtr data, ViewLayoutDirectionType type)
782 LayoutDirectionChangedEventArgs e = new LayoutDirectionChangedEventArgs();
785 e.View = Registry.GetManagedBaseHandleFromNativePtr(data) as View;
789 if (_layoutDirectionChangedEventHandler != null)
791 _layoutDirectionChangedEventHandler(this, e);
795 private void OnResourcesLoaded(IntPtr view)
797 if (_resourcesLoadedEventHandler != null)
799 _resourcesLoadedEventHandler(this, null);
803 private void OnBackgroundResourceLoaded(IntPtr view)
805 BackgroundResourceLoadedEventArgs e = new BackgroundResourceLoadedEventArgs();
806 e.Status = (ResourceLoadingStatusType)Interop.View.View_GetVisualResourceStatus(this.swigCPtr, Property.BACKGROUND);
808 if (_backgroundResourceLoadedEventHandler != null)
810 _backgroundResourceLoadedEventHandler(this, e);
815 /// Event argument passed through the ChildAdded event.
817 /// <since_tizen> 5 </since_tizen>
818 public class ChildAddedEventArgs : EventArgs
821 /// Added child view at moment.
823 /// <since_tizen> 5 </since_tizen>
824 public View Added { get; set; }
828 /// Event argument passed through the ChildRemoved event.
830 /// <since_tizen> 5 </since_tizen>
831 public class ChildRemovedEventArgs : EventArgs
834 /// Removed child view at moment.
836 /// <since_tizen> 5 </since_tizen>
837 public View Removed { get; set; }
841 /// Event arguments that passed via the KeyEvent signal.
843 /// <since_tizen> 3 </since_tizen>
844 public class KeyEventArgs : EventArgs
849 /// Key - is the key sent to the view.
851 /// <since_tizen> 3 </since_tizen>
866 /// Event arguments that passed via the touch signal.
868 /// <since_tizen> 3 </since_tizen>
869 public class TouchEventArgs : EventArgs
871 private Touch _touch;
874 /// Touch - contains the information of touch points.
876 /// <since_tizen> 3 </since_tizen>
891 /// Event arguments that passed via the hover signal.
893 /// <since_tizen> 3 </since_tizen>
894 public class HoverEventArgs : EventArgs
896 private Hover _hover;
899 /// Hover - contains touch points that represent the points that are currently being hovered or the points where a hover has stopped.
901 /// <since_tizen> 3 </since_tizen>
916 /// Event arguments that passed via the wheel signal.
918 /// <since_tizen> 3 </since_tizen>
919 public class WheelEventArgs : EventArgs
921 private Wheel _wheel;
924 /// WheelEvent - store a wheel rolling type: MOUSE_WHEEL or CUSTOM_WHEEL.
926 /// <since_tizen> 3 </since_tizen>
941 /// Event arguments of visibility changed.
943 /// <since_tizen> 3 </since_tizen>
944 public class VisibilityChangedEventArgs : EventArgs
947 private bool _visibility;
948 private VisibilityChangeType _type;
951 /// The view, or child of view, whose visibility has changed.
953 /// <since_tizen> 3 </since_tizen>
967 /// Whether the view is now visible or not.
969 /// <since_tizen> 3 </since_tizen>
970 public bool Visibility
983 /// Whether the view's visible property has changed or a parent's.
985 /// <since_tizen> 3 </since_tizen>
986 public VisibilityChangeType Type
1000 /// Event arguments of layout direction changed.
1002 /// <since_tizen> 4 </since_tizen>
1003 public class LayoutDirectionChangedEventArgs : EventArgs
1006 private ViewLayoutDirectionType _type;
1009 /// The view, or child of view, whose layout direction has changed.
1011 /// <since_tizen> 4 </since_tizen>
1025 /// Whether the view's layout direction property has changed or a parent's.
1027 /// <since_tizen> 4 </since_tizen>
1028 public ViewLayoutDirectionType Type
1041 internal class BackgroundResourceLoadedEventArgs : EventArgs
1043 private ResourceLoadingStatusType status = ResourceLoadingStatusType.Invalid;
1044 public ResourceLoadingStatusType Status
1057 private EventHandlerWithReturnType<object, WheelEventArgs, bool> WindowWheelEventHandler;
1058 private void OnWindowWheelEvent(object sender, Window.WheelEventArgs e)
1062 if(e.Wheel.Type == Wheel.WheelType.CustomWheel)
1064 var arg = new WheelEventArgs()
1068 WindowWheelEventHandler?.Invoke(this, arg);