2 * Copyright(c) 2017 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.
23 using System.Runtime.InteropServices;
24 using Tizen.NUI.BaseComponents;
25 using System.ComponentModel;
28 /// Provides the functionality of handling keyboard navigation and maintaining the two-dimensional keyboard focus chain.<br />
29 /// It provides functionality of setting the focus and moving the focus in four directions( i.e., left, right, up, and down).<br />
30 /// It also draws a highlight for the focused view and sends an event when the focus is changed.<br />
32 public class FocusManager : BaseHandle
34 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
35 private CustomAlgorithmInterfaceWrapper _customAlgorithmInterfaceWrapper;
37 internal FocusManager(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicManualPINVOKE.FocusManager_SWIGUpcast(cPtr), cMemoryOwn)
39 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
42 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(FocusManager obj)
44 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
48 /// To make the FocusManager instance be disposed.
50 protected override void Dispose(DisposeTypes type)
57 if(type == DisposeTypes.Explicit)
60 //Release your own managed resources here.
61 //You should release all of your own disposable objects here.
64 //Release your own unmanaged resources here.
65 //You should not access any managed member here except static instance.
66 //because the execution order of Finalizes is non-deterministic.
68 if (_focusedViewEnterKeyEventCallback2 != null)
70 FocusedViewEnterKeySignal().Disconnect(_focusedViewEnterKeyEventCallback2);
73 if (_focusedViewEnterKeyEventCallback != null)
75 FocusedViewEnterKeySignal().Disconnect(_focusedViewEnterKeyEventCallback);
78 if (_focusGroupChangedEventCallback != null)
80 FocusGroupChangedSignal().Disconnect(_focusGroupChangedEventCallback);
83 if (_focusChangedEventCallback != null)
85 FocusChangedSignal().Disconnect(_focusChangedEventCallback);
88 if (_preFocusChangeCallback != null)
90 PreFocusChangeSignal().Disconnect(_preFocusChangeCallback);
93 if (swigCPtr.Handle != global::System.IntPtr.Zero)
98 NDalicManualPINVOKE.delete_FocusManager(swigCPtr);
100 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
108 /// Event arguments that passed via the PreFocusChange signal.
110 public class PreFocusChangeEventArgs : EventArgs
112 private View _current;
113 private View _proposed;
114 private View.FocusDirection _direction;
117 /// The current focus view.
119 /// <since_tizen> 3 </since_tizen>
120 public View CurrentView
133 /// The proposed view.
135 /// <since_tizen> 3 </since_tizen>
136 public View ProposedView
149 /// The focus move direction.
151 /// <since_tizen> 3 </since_tizen>
152 public View.FocusDirection Direction
165 private EventHandlerWithReturnType<object, PreFocusChangeEventArgs, View> _preFocusChangeEventHandler;
166 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
167 internal delegate IntPtr PreFocusChangeEventCallback(IntPtr current, IntPtr proposed, View.FocusDirection direction);
168 private PreFocusChangeEventCallback _preFocusChangeCallback;
171 /// PreFocusChange will be triggered before the focus is going to be changed.<br />
172 /// The FocusManager makes the best guess for which view to focus towards the given direction, but applications might want to change that.<br />
173 /// By connecting with this event, they can check the proposed view to focus and return a different view if they wish.<br />
174 /// This event is only triggered when the navigation key is pressed and KeyboardFocusManager tries to move the focus automatically.<br />
175 /// It won't be emitted for focus movement by calling the SetCurrentFocusView directly.<br />
177 /// <since_tizen> 3 </since_tizen>
178 public event EventHandlerWithReturnType<object, PreFocusChangeEventArgs, View> PreFocusChange
182 if (_preFocusChangeEventHandler == null)
185 Tizen.Log.Debug("NUI", "con1) PreFocusChangeSignal().Empty = " + PreFocusChangeSignal().Empty());
186 Tizen.Log.Debug("NUI", "con2) PreFocusChangeSignal().GetConnectionCount = " + PreFocusChangeSignal().GetConnectionCount());
188 _preFocusChangeCallback = OnPreFocusChange;
189 PreFocusChangeSignal().Connect(_preFocusChangeCallback);
191 Tizen.Log.Debug("NUI", "con3) PreFocusChangeSignal().Empty = " + PreFocusChangeSignal().Empty());
192 Tizen.Log.Debug("NUI", "con4) PreFocusChangeSignal().GetConnectionCount = " + PreFocusChangeSignal().GetConnectionCount());
195 _preFocusChangeEventHandler += value;
199 _preFocusChangeEventHandler -= value;
200 if (_preFocusChangeEventHandler == null && PreFocusChangeSignal().Empty() == false)
203 Tizen.Log.Debug("NUI", "discon1) PreFocusChangeSignal().Empty = " + PreFocusChangeSignal().Empty());
204 Tizen.Log.Debug("NUI", "discon2) PreFocusChangeSignal().GetConnectionCount = " + PreFocusChangeSignal().GetConnectionCount());
206 PreFocusChangeSignal().Disconnect(_preFocusChangeCallback);
208 Tizen.Log.Debug("NUI", "discon3) PreFocusChangeSignal().Empty = " + PreFocusChangeSignal().Empty());
209 Tizen.Log.Debug("NUI", "discon4) PreFocusChangeSignal().GetConnectionCount = " + PreFocusChangeSignal().GetConnectionCount());
215 private IntPtr OnPreFocusChange(IntPtr current, IntPtr proposed, View.FocusDirection direction)
218 PreFocusChangeEventArgs e = new PreFocusChangeEventArgs();
220 if (current != global::System.IntPtr.Zero)
222 e.CurrentView = Registry.GetManagedBaseHandleFromNativePtr(current) as View;
224 if (proposed != global::System.IntPtr.Zero)
226 e.ProposedView = Registry.GetManagedBaseHandleFromNativePtr(proposed) as View;
228 e.Direction = direction;
230 if (_preFocusChangeEventHandler != null)
232 view = _preFocusChangeEventHandler(this, e);
237 return view.GetPtrfromView();
241 //if (e.ProposedView) return proposed;
242 //else return current;
243 return current; //xb.teng
248 /// Event arguments that passed via the FocusChanged signal.
250 public class FocusChangedEventArgs : EventArgs
252 private View _current;
256 /// The current focus view.
258 /// <since_tizen> 3 </since_tizen>
259 public View CurrentView
271 /// The next focus view.
273 /// <since_tizen> 3 </since_tizen>
287 private EventHandler<FocusChangedEventArgs> _focusChangedEventHandler;
288 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
289 internal delegate void FocusChangedEventCallback(IntPtr current, IntPtr next);
290 private FocusChangedEventCallback _focusChangedEventCallback;
293 /// The FocusGroupChanged will be triggered after the current focused view has been changed.
295 /// <since_tizen> 3 </since_tizen>
296 public event EventHandler<FocusChangedEventArgs> FocusChanged
300 if (_focusChangedEventCallback == null)
302 _focusChangedEventCallback = OnFocusChanged;
303 FocusChangedSignal().Connect(_focusChangedEventCallback);
305 _focusChangedEventHandler += value;
309 _focusChangedEventHandler -= value;
311 if (_focusChangedEventCallback == null && FocusChangedSignal().Empty() == false)
313 FocusChangedSignal().Disconnect(_focusChangedEventCallback);
318 private void OnFocusChanged(IntPtr current, IntPtr next)
320 FocusChangedEventArgs e = new FocusChangedEventArgs();
322 e.CurrentView = Registry.GetManagedBaseHandleFromNativePtr(current) as View;
323 e.NextView = Registry.GetManagedBaseHandleFromNativePtr(next) as View;
325 if (_focusChangedEventHandler != null)
327 _focusChangedEventHandler(this, e);
332 /// Event arguments that passed via the FocusGroupChanged signal.
334 public class FocusGroupChangedEventArgs : EventArgs
336 private View _current;
337 private bool _forwardDirection;
340 /// The current focus view.
342 /// <since_tizen> 3 </since_tizen>
343 public View CurrentView
356 /// The forward direction.
358 /// <since_tizen> 3 </since_tizen>
359 public bool ForwardDirection
363 return _forwardDirection;
367 _forwardDirection = value;
372 private EventHandler<FocusGroupChangedEventArgs> _focusGroupChangedEventHandler;
373 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
374 private delegate void FocusGroupChangedEventCallback(IntPtr current, bool forwardDirection);
375 private FocusGroupChangedEventCallback _focusGroupChangedEventCallback;
378 /// The FocusGroupChanged will be triggered when the focus group has been changed.<br />
379 /// If the current focus group has a parent layout control, the FocusManager will make the best guess for the next focus group to move the focus to in the given direction (forward or backward).<br />
380 /// If not, the application has to set the new focus.<br />
382 /// <since_tizen> 3 </since_tizen>
383 public event EventHandler<FocusGroupChangedEventArgs> FocusGroupChanged
387 if (_focusGroupChangedEventCallback == null)
389 _focusGroupChangedEventCallback = OnFocusGroupChanged;
390 FocusGroupChangedSignal().Connect(_focusGroupChangedEventCallback);
392 _focusGroupChangedEventHandler += value;
396 _focusGroupChangedEventHandler -= value;
398 if (_focusGroupChangedEventCallback == null && FocusGroupChangedSignal().Empty() == false)
400 FocusGroupChangedSignal().Disconnect(_focusGroupChangedEventCallback);
405 private void OnFocusGroupChanged(IntPtr current, bool forwardDirection)
407 FocusGroupChangedEventArgs e = new FocusGroupChangedEventArgs();
409 e.CurrentView = Registry.GetManagedBaseHandleFromNativePtr(current) as View;
410 e.ForwardDirection = forwardDirection;
412 if (_focusGroupChangedEventHandler != null)
414 _focusGroupChangedEventHandler(this, e);
419 /// Event arguments that passed via the FocusedViewEnterKey signal.
421 public class FocusedViewActivatedEventArgs : EventArgs
428 /// <since_tizen> 3 </since_tizen>
442 private EventHandler<FocusedViewActivatedEventArgs> _focusedViewEnterKeyEventHandler;
443 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
444 private delegate void FocusedViewEnterKeyEventCallback(IntPtr view);
445 private FocusedViewEnterKeyEventCallback _focusedViewEnterKeyEventCallback;
448 /// The FocusedViewActivated will be triggered when the current focused view has the enter key pressed on it.
450 /// <since_tizen> 4 </since_tizen>
451 public event EventHandler<FocusedViewActivatedEventArgs> FocusedViewActivated
455 if (_focusedViewEnterKeyEventCallback == null)
457 _focusedViewEnterKeyEventCallback = OnFocusedViewEnterKey;
458 FocusedViewEnterKeySignal().Connect(_focusedViewEnterKeyEventCallback);
460 _focusedViewEnterKeyEventHandler += value;
464 _focusedViewEnterKeyEventHandler -= value;
466 if (_focusedViewEnterKeyEventCallback != null && FocusedViewEnterKeySignal().Empty() == false)
468 FocusedViewEnterKeySignal().Disconnect(_focusedViewEnterKeyEventCallback);
473 private void OnFocusedViewEnterKey(IntPtr view)
475 FocusedViewActivatedEventArgs e = new FocusedViewActivatedEventArgs();
477 e.View = Registry.GetManagedBaseHandleFromNativePtr(view) as View;
479 if (_focusedViewEnterKeyEventHandler != null)
481 _focusedViewEnterKeyEventHandler(this, e);
486 internal FocusManager() : this(NDalicManualPINVOKE.new_FocusManager(), true)
488 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
491 internal static FocusManager Get()
493 FocusManager ret = new FocusManager(NDalicManualPINVOKE.FocusManager_Get(), true);
494 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
499 /// Moves the keyboard focus to the given view.<br />
500 /// Only one view can be focused at the same time.<br />
501 /// The view must be in the stage already and keyboard focusable.<br />
503 /// <param name="view">The view to be focused.</param>
504 /// <returns>Whether the focus is successful or not.</returns>
505 /// <since_tizen> 3 </since_tizen>
506 public bool SetCurrentFocusView(View view)
510 throw new ArgumentNullException("the target view should not be null");
513 bool ret = NDalicManualPINVOKE.FocusManager_SetCurrentFocusActor(swigCPtr, View.getCPtr(view));
514 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
519 /// Gets the current focused view.
521 /// <returns>A handle to the current focused view or an empty handle if no view is focused.</returns>
522 /// <since_tizen> 3 </since_tizen>
523 public View GetCurrentFocusView()
525 IntPtr cPtr = NDalicManualPINVOKE.FocusManager_GetCurrentFocusActor(swigCPtr);
527 View ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as View;
532 /// Moves the focus to the next focusable view in the focus chain in the given direction (according to the focus traversal order).
534 /// <param name="direction">The direction of the focus movement.</param>
535 /// <returns>True if the movement was successful.</returns>
536 /// <since_tizen> 3 </since_tizen>
537 public bool MoveFocus(View.FocusDirection direction)
539 bool ret = NDalicManualPINVOKE.FocusManager_MoveFocus(swigCPtr, (int)direction);
540 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
545 /// Clears the focus from the current focused view if any, so that no view is focused in the focus chain.<br />
546 /// It will emit the FocusChanged event without the current focused view.<br />
548 /// <since_tizen> 3 </since_tizen>
549 public void ClearFocus()
551 NDalicManualPINVOKE.FocusManager_ClearFocus(swigCPtr);
552 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
556 /// Move the focus to previous focused view.
558 /// <since_tizen> 4 </since_tizen>
559 public void MoveFocusBackward()
561 NDalicManualPINVOKE.FocusManager_MoveFocusBackward(swigCPtr);
562 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
566 /// Gets or sets the status of whether the focus movement should be looped within the same focus group.<br />
567 /// The focus movement is not looped by default.<br />
569 /// <since_tizen> 3 </since_tizen>
570 public bool FocusGroupLoop
574 SetFocusGroupLoop(value);
578 return GetFocusGroupLoop();
582 internal void SetFocusGroupLoop(bool enabled)
584 NDalicManualPINVOKE.FocusManager_SetFocusGroupLoop(swigCPtr, enabled);
585 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
588 internal bool GetFocusGroupLoop()
590 bool ret = NDalicManualPINVOKE.FocusManager_GetFocusGroupLoop(swigCPtr);
591 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
596 /// Sets whether the view is a focus group that can limit the scope of the focus movement to its child views in the focus chain.<br />
597 /// Layout controls set themselves as focus groups by default.<br />
599 /// <param name="view">The view to be set as a focus group.</param>
600 /// <param name="isFocusGroup">Whether to set the view as a focus group or not.</param>
601 /// <since_tizen> 3 </since_tizen>
602 public void SetAsFocusGroup(View view, bool isFocusGroup)
604 NDalicManualPINVOKE.FocusManager_SetAsFocusGroup(swigCPtr, View.getCPtr(view), isFocusGroup);
605 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
609 /// Checks whether the view is set as a focus group or not.
611 /// <param name="view">The view to be checked.</param>
612 /// <returns>Whether the view is set as a focus group.</returns>
613 /// <since_tizen> 3 </since_tizen>
614 public bool IsFocusGroup(View view)
616 bool ret = NDalicManualPINVOKE.FocusManager_IsFocusGroup(swigCPtr, View.getCPtr(view));
617 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
622 /// Returns the closest ancestor of the given view that is a focus group.
624 /// <param name="view">The view to be checked for its focus group.</param>
625 /// <returns>The focus group the given view belongs to or an empty handle if the given view.</returns>
626 /// <since_tizen> 3 </since_tizen>
627 public View GetFocusGroup(View view)
629 IntPtr cPtr = NDalicManualPINVOKE.FocusManager_GetFocusGroup(swigCPtr, View.getCPtr(view));
631 View ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as View;
634 /*View ret = new View(NDalicManualPINVOKE.FocusManager_GetFocusGroup(swigCPtr, View.getCPtr(view)), true);
635 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
636 if (ret.HasBody() == false)
645 /// Gets or sets the focus indicator view.<br />
646 /// This will replace the default focus indicator view in the FocusManager and will be added to the focused view as a highlight.<br />
648 /// <since_tizen> 3 </since_tizen>
649 public View FocusIndicator
653 SetFocusIndicatorView(value);
657 return GetFocusIndicatorView();
661 internal void SetFocusIndicatorView(View indicator)
663 NDalicManualPINVOKE.FocusManager_SetFocusIndicatorActor(swigCPtr, View.getCPtr(indicator));
664 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
667 internal View GetFocusIndicatorView()
669 IntPtr cPtr = NDalicManualPINVOKE.FocusManager_GetFocusIndicatorActor(swigCPtr);
671 View ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as View;
677 /// Provides the implementation of a custom focus algorithm interface to allow the application to define the focus logic.<br />
679 /// <param name="arg0">The user's implementation of ICustomFocusAlgorithm.</param>
680 /// <since_tizen> 3 </since_tizen>
681 public void SetCustomAlgorithm(ICustomFocusAlgorithm arg0)
683 _customAlgorithmInterfaceWrapper = new CustomAlgorithmInterfaceWrapper();
684 _customAlgorithmInterfaceWrapper.SetFocusAlgorithm(arg0);
686 NDalicPINVOKE.SetCustomAlgorithm(swigCPtr, CustomAlgorithmInterface.getCPtr(_customAlgorithmInterfaceWrapper));
687 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
690 internal PreFocusChangeSignal PreFocusChangeSignal()
692 PreFocusChangeSignal ret = new PreFocusChangeSignal(NDalicManualPINVOKE.FocusManager_PreFocusChangeSignal(swigCPtr), false);
693 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
697 internal FocusChangedSignal FocusChangedSignal()
699 FocusChangedSignal ret = new FocusChangedSignal(NDalicManualPINVOKE.FocusManager_FocusChangedSignal(swigCPtr), false);
700 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
704 internal FocusGroupChangedSignal FocusGroupChangedSignal()
706 FocusGroupChangedSignal ret = new FocusGroupChangedSignal(NDalicManualPINVOKE.FocusManager_FocusGroupChangedSignal(swigCPtr), false);
707 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
711 internal ViewSignal FocusedViewEnterKeySignal()
713 ViewSignal ret = new ViewSignal(NDalicManualPINVOKE.FocusManager_FocusedActorEnterKeySignal(swigCPtr), false);
714 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
718 private static readonly FocusManager instance = FocusManager.Get();
721 /// Gets the singleton of the FocusManager object.
723 /// <since_tizen> 3 </since_tizen>
724 public static FocusManager Instance
733 /// ICustomFocusAlgorithm is used to provide the custom keyboard focus algorithm for retrieving the next focusable view.<br />
734 /// The application can implement the interface and override the keyboard focus behavior.<br />
735 /// If the focus is changing within a layout container, then the layout container is queried first to provide the next focusable view.<br />
736 /// If this does not provide a valid view, then the Keyboard FocusManager will check focusable properties to determine the next focusable actor.<br />
737 /// If focusable properties are not set, then the keyboard FocusManager calls the GetNextFocusableView() method of this interface.<br />
739 /// <since_tizen> 3 </since_tizen>
740 public interface ICustomFocusAlgorithm
743 /// Get the next focus actor.
745 /// <param name="current">The current focus view.</param>
746 /// <param name="proposed">The proposed focus view</param>
747 /// <param name="direction">The focus move direction</param>
748 /// <returns>The next focus actor.</returns>
749 /// <since_tizen> 3 </since_tizen>
750 View GetNextFocusableView(View current, View proposed, View.FocusDirection direction);
753 private class CustomAlgorithmInterfaceWrapper : CustomAlgorithmInterface
755 private FocusManager.ICustomFocusAlgorithm _customFocusAlgorithm;
757 public CustomAlgorithmInterfaceWrapper()
761 public void SetFocusAlgorithm(FocusManager.ICustomFocusAlgorithm customFocusAlgorithm)
763 _customFocusAlgorithm = customFocusAlgorithm;
766 public override View GetNextFocusableView(View current, View proposed, View.FocusDirection direction)
768 return _customFocusAlgorithm.GetNextFocusableView(current, proposed, direction);
774 /// Please do not use! this will be deprecated
776 /// <since_tizen> 3 </since_tizen>
777 //Please do not use! this will be deprecated
778 [EditorBrowsable(EditorBrowsableState.Never)]
779 public class FocusedViewEnterKeyEventArgs : EventArgs
799 private EventHandler<FocusedViewEnterKeyEventArgs> _focusedViewEnterKeyEventHandler2;
800 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
801 private delegate void FocusedViewEnterKeyEventCallback2(IntPtr view);
802 private FocusedViewEnterKeyEventCallback2 _focusedViewEnterKeyEventCallback2;
805 /// [Obsolete("Please do not use! this will be deprecated")]
807 /// <since_tizen> 3 </since_tizen>
808 [Obsolete("Please do not use! this will be deprecated")]
809 public event EventHandler<FocusedViewEnterKeyEventArgs> FocusedViewEnterKeyPressed
813 if (_focusedViewEnterKeyEventCallback2 == null)
815 _focusedViewEnterKeyEventCallback2 = OnFocusedViewEnterKey2;
816 FocusedViewEnterKeySignal().Connect(_focusedViewEnterKeyEventCallback2);
818 _focusedViewEnterKeyEventHandler2 += value;
822 _focusedViewEnterKeyEventHandler2 -= value;
824 if (_focusedViewEnterKeyEventCallback2 != null && FocusedViewEnterKeySignal().Empty() == false)
826 FocusedViewEnterKeySignal().Disconnect(_focusedViewEnterKeyEventCallback2);
831 [Obsolete("Please do not use! this will be deprecated")]
832 private void OnFocusedViewEnterKey2(IntPtr view)
834 FocusedViewActivatedEventArgs e = new FocusedViewActivatedEventArgs();
836 e.View = Registry.GetManagedBaseHandleFromNativePtr(view) as View;
838 if (_focusedViewEnterKeyEventHandler != null)
840 _focusedViewEnterKeyEventHandler(this, e);