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.
19 using System.Runtime.InteropServices;
20 using Tizen.NUI.BaseComponents;
21 using System.ComponentModel;
26 /// Provides the functionality of handling keyboard navigation and maintaining the two-dimensional keyboard focus chain.<br />
27 /// It provides functionality of setting the focus and moving the focus in four directions( i.e., left, right, up, and down).<br />
28 /// It also draws a highlight for the focused view and sends an event when the focus is changed.<br />
30 /// <since_tizen> 3 </since_tizen>
31 public class FocusManager : BaseHandle
33 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
34 private CustomAlgorithmInterfaceWrapper _customAlgorithmInterfaceWrapper;
36 internal FocusManager(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicManualPINVOKE.FocusManager_SWIGUpcast(cPtr), cMemoryOwn)
38 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
41 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(FocusManager obj)
43 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
47 /// Event arguments that passed via the PreFocusChange signal.
49 /// <since_tizen> 3 </since_tizen>
50 public class PreFocusChangeEventArgs : EventArgs
52 private View _current;
53 private View _proposed;
54 private View.FocusDirection _direction;
57 /// The current focus view.
59 /// <since_tizen> 3 </since_tizen>
60 public View CurrentView
73 /// The proposed view.
75 /// <since_tizen> 3 </since_tizen>
76 public View ProposedView
89 /// The focus move direction.
91 /// <since_tizen> 3 </since_tizen>
92 public View.FocusDirection Direction
105 private EventHandlerWithReturnType<object, PreFocusChangeEventArgs, View> _preFocusChangeEventHandler;
106 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
107 internal delegate IntPtr PreFocusChangeEventCallback(IntPtr current, IntPtr proposed, View.FocusDirection direction);
108 private PreFocusChangeEventCallback _preFocusChangeCallback;
111 /// PreFocusChange will be triggered before the focus is going to be changed.<br />
112 /// The FocusManager makes the best guess for which view to focus towards the given direction, but applications might want to change that.<br />
113 /// By connecting with this event, they can check the proposed view to focus and return a different view if they wish.<br />
114 /// This event is only triggered when the navigation key is pressed and KeyboardFocusManager tries to move the focus automatically.<br />
115 /// It won't be emitted for focus movement by calling the SetCurrentFocusView directly.<br />
117 /// <since_tizen> 3 </since_tizen>
118 public event EventHandlerWithReturnType<object, PreFocusChangeEventArgs, View> PreFocusChange
122 if (_preFocusChangeEventHandler == null)
124 _preFocusChangeCallback = OnPreFocusChange;
125 PreFocusChangeSignal().Connect(_preFocusChangeCallback);
127 _preFocusChangeEventHandler += value;
131 _preFocusChangeEventHandler -= value;
132 if (_preFocusChangeEventHandler == null && PreFocusChangeSignal().Empty() == false)
134 PreFocusChangeSignal().Disconnect(_preFocusChangeCallback);
139 private IntPtr OnPreFocusChange(IntPtr current, IntPtr proposed, View.FocusDirection direction)
142 PreFocusChangeEventArgs e = new PreFocusChangeEventArgs();
144 if (current != global::System.IntPtr.Zero)
146 e.CurrentView = Registry.GetManagedBaseHandleFromNativePtr(current) as View;
148 if (proposed != global::System.IntPtr.Zero)
150 e.ProposedView = Registry.GetManagedBaseHandleFromNativePtr(proposed) as View;
152 e.Direction = direction;
154 if (_preFocusChangeEventHandler != null)
156 view = _preFocusChangeEventHandler(this, e);
161 return view.GetPtrfromView();
165 //if (e.ProposedView) return proposed;
166 //else return current;
167 return current; //xb.teng
172 /// Event arguments that passed via the FocusChanged signal.
174 /// <since_tizen> 3 </since_tizen>
175 public class FocusChangedEventArgs : EventArgs
177 private View _current;
181 /// The current focus view.
183 /// <since_tizen> 3 </since_tizen>
184 public View CurrentView
196 /// The next focus view.
198 /// <since_tizen> 3 </since_tizen>
212 private EventHandler<FocusChangedEventArgs> _focusChangedEventHandler;
213 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
214 internal delegate void FocusChangedEventCallback(IntPtr current, IntPtr next);
215 private FocusChangedEventCallback _focusChangedEventCallback;
218 /// The FocusGroupChanged will be triggered after the current focused view has been changed.
220 /// <since_tizen> 3 </since_tizen>
221 public event EventHandler<FocusChangedEventArgs> FocusChanged
225 if (_focusChangedEventCallback == null)
227 _focusChangedEventCallback = OnFocusChanged;
228 FocusChangedSignal().Connect(_focusChangedEventCallback);
230 _focusChangedEventHandler += value;
234 _focusChangedEventHandler -= value;
236 if (_focusChangedEventCallback == null && FocusChangedSignal().Empty() == false)
238 FocusChangedSignal().Disconnect(_focusChangedEventCallback);
243 private void OnFocusChanged(IntPtr current, IntPtr next)
245 FocusChangedEventArgs e = new FocusChangedEventArgs();
247 e.CurrentView = Registry.GetManagedBaseHandleFromNativePtr(current) as View;
248 e.NextView = Registry.GetManagedBaseHandleFromNativePtr(next) as View;
250 if (_focusChangedEventHandler != null)
252 _focusChangedEventHandler(this, e);
257 /// Event arguments that passed via the FocusGroupChanged signal.
259 /// <since_tizen> 3 </since_tizen>
260 public class FocusGroupChangedEventArgs : EventArgs
262 private View _current;
263 private bool _forwardDirection;
266 /// The current focus view.
268 /// <since_tizen> 3 </since_tizen>
269 public View CurrentView
282 /// The forward direction.
284 /// <since_tizen> 3 </since_tizen>
285 public bool ForwardDirection
289 return _forwardDirection;
293 _forwardDirection = value;
298 private EventHandler<FocusGroupChangedEventArgs> _focusGroupChangedEventHandler;
299 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
300 private delegate void FocusGroupChangedEventCallback(IntPtr current, bool forwardDirection);
301 private FocusGroupChangedEventCallback _focusGroupChangedEventCallback;
304 /// The FocusGroupChanged will be triggered when the focus group has been changed.<br />
305 /// 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 />
306 /// If not, the application has to set the new focus.<br />
308 /// <since_tizen> 3 </since_tizen>
309 public event EventHandler<FocusGroupChangedEventArgs> FocusGroupChanged
313 if (_focusGroupChangedEventCallback == null)
315 _focusGroupChangedEventCallback = OnFocusGroupChanged;
316 FocusGroupChangedSignal().Connect(_focusGroupChangedEventCallback);
318 _focusGroupChangedEventHandler += value;
322 _focusGroupChangedEventHandler -= value;
324 if (_focusGroupChangedEventCallback == null && FocusGroupChangedSignal().Empty() == false)
326 FocusGroupChangedSignal().Disconnect(_focusGroupChangedEventCallback);
331 private void OnFocusGroupChanged(IntPtr current, bool forwardDirection)
333 FocusGroupChangedEventArgs e = new FocusGroupChangedEventArgs();
335 e.CurrentView = Registry.GetManagedBaseHandleFromNativePtr(current) as View;
336 e.ForwardDirection = forwardDirection;
338 if (_focusGroupChangedEventHandler != null)
340 _focusGroupChangedEventHandler(this, e);
345 /// Event arguments that passed via the FocusedViewEnterKey signal.
347 /// <since_tizen> 3 </since_tizen>
348 public class FocusedViewActivatedEventArgs : EventArgs
355 /// <since_tizen> 3 </since_tizen>
369 private EventHandler<FocusedViewActivatedEventArgs> _focusedViewEnterKeyEventHandler;
370 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
371 private delegate void FocusedViewEnterKeyEventCallback(IntPtr view);
372 private FocusedViewEnterKeyEventCallback _focusedViewEnterKeyEventCallback;
375 /// The FocusedViewActivated will be triggered when the current focused view has the enter key pressed on it.
377 /// <since_tizen> 3 </since_tizen>
378 public event EventHandler<FocusedViewActivatedEventArgs> FocusedViewActivated
382 if (_focusedViewEnterKeyEventCallback == null)
384 _focusedViewEnterKeyEventCallback = OnFocusedViewEnterKey;
385 FocusedViewEnterKeySignal().Connect(_focusedViewEnterKeyEventCallback);
387 _focusedViewEnterKeyEventHandler += value;
391 _focusedViewEnterKeyEventHandler -= value;
393 if (_focusedViewEnterKeyEventCallback != null && FocusedViewEnterKeySignal().Empty() == false)
395 FocusedViewEnterKeySignal().Disconnect(_focusedViewEnterKeyEventCallback);
400 private void OnFocusedViewEnterKey(IntPtr view)
402 FocusedViewActivatedEventArgs e = new FocusedViewActivatedEventArgs();
404 e.View = Registry.GetManagedBaseHandleFromNativePtr(view) as View;
406 if (_focusedViewEnterKeyEventHandler != null)
408 _focusedViewEnterKeyEventHandler(this, e);
413 internal FocusManager() : this(NDalicManualPINVOKE.new_FocusManager(), true)
415 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
418 internal static FocusManager Get()
420 FocusManager ret = new FocusManager(NDalicManualPINVOKE.FocusManager_Get(), true);
421 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
426 /// Moves the keyboard focus to the given view.<br />
427 /// Only one view can be focused at the same time.<br />
428 /// The view must be in the stage already and keyboard focusable.<br />
430 /// <param name="view">The view to be focused.</param>
431 /// <returns>Whether the focus is successful or not.</returns>
432 /// <since_tizen> 3 </since_tizen>
433 public bool SetCurrentFocusView(View view)
437 throw new ArgumentNullException("the target view should not be null");
440 bool ret = NDalicManualPINVOKE.FocusManager_SetCurrentFocusActor(swigCPtr, View.getCPtr(view));
441 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
446 /// Gets the current focused view.
448 /// <returns>A handle to the current focused view or an empty handle if no view is focused.</returns>
449 /// <since_tizen> 3 </since_tizen>
450 public View GetCurrentFocusView()
452 //to fix memory leak issue, match the handle count with native side.
453 IntPtr cPtr = NDalicManualPINVOKE.FocusManager_GetCurrentFocusActor(swigCPtr);
454 HandleRef CPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
455 View ret = Registry.GetManagedBaseHandleFromNativePtr(CPtr.Handle) as View;
456 NDalicPINVOKE.delete_BaseHandle(CPtr);
457 CPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
463 /// Moves the focus to the next focusable view in the focus chain in the given direction (according to the focus traversal order).
465 /// <param name="direction">The direction of the focus movement.</param>
466 /// <returns>True if the movement was successful.</returns>
467 /// <since_tizen> 3 </since_tizen>
468 public bool MoveFocus(View.FocusDirection direction)
470 bool ret = NDalicManualPINVOKE.FocusManager_MoveFocus(swigCPtr, (int)direction);
471 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
476 /// Clears the focus from the current focused view if any, so that no view is focused in the focus chain.<br />
477 /// It will emit the FocusChanged event without the current focused view.<br />
479 /// <since_tizen> 3 </since_tizen>
480 public void ClearFocus()
482 NDalicManualPINVOKE.FocusManager_ClearFocus(swigCPtr);
483 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
487 /// Move the focus to previous focused view.
489 /// <since_tizen> 3 </since_tizen>
490 public void MoveFocusBackward()
492 NDalicManualPINVOKE.FocusManager_MoveFocusBackward(swigCPtr);
493 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
497 /// Gets or sets the status of whether the focus movement should be looped within the same focus group.<br />
498 /// The focus movement is not looped by default.<br />
500 /// <since_tizen> 3 </since_tizen>
501 public bool FocusGroupLoop
505 SetFocusGroupLoop(value);
509 return GetFocusGroupLoop();
513 internal void SetFocusGroupLoop(bool enabled)
515 NDalicManualPINVOKE.FocusManager_SetFocusGroupLoop(swigCPtr, enabled);
516 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
519 internal bool GetFocusGroupLoop()
521 bool ret = NDalicManualPINVOKE.FocusManager_GetFocusGroupLoop(swigCPtr);
522 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
527 /// 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 />
528 /// Layout controls set themselves as focus groups by default.<br />
530 /// <param name="view">The view to be set as a focus group.</param>
531 /// <param name="isFocusGroup">Whether to set the view as a focus group or not.</param>
532 /// <since_tizen> 3 </since_tizen>
533 public void SetAsFocusGroup(View view, bool isFocusGroup)
535 NDalicManualPINVOKE.FocusManager_SetAsFocusGroup(swigCPtr, View.getCPtr(view), isFocusGroup);
536 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
540 /// Checks whether the view is set as a focus group or not.
542 /// <param name="view">The view to be checked.</param>
543 /// <returns>Whether the view is set as a focus group.</returns>
544 /// <since_tizen> 3 </since_tizen>
545 public bool IsFocusGroup(View view)
547 bool ret = NDalicManualPINVOKE.FocusManager_IsFocusGroup(swigCPtr, View.getCPtr(view));
548 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
553 /// Returns the closest ancestor of the given view that is a focus group.
555 /// <param name="view">The view to be checked for its focus group.</param>
556 /// <returns>The focus group the given view belongs to or an empty handle if the given view.</returns>
557 /// <since_tizen> 3 </since_tizen>
558 public View GetFocusGroup(View view)
560 //to fix memory leak issue, match the handle count with native side.
561 IntPtr cPtr = NDalicManualPINVOKE.FocusManager_GetFocusGroup(swigCPtr, View.getCPtr(view));
562 HandleRef CPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
563 View ret = Registry.GetManagedBaseHandleFromNativePtr(CPtr.Handle) as View;
564 NDalicPINVOKE.delete_BaseHandle(CPtr);
565 CPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
571 /// Gets or sets the focus indicator view.<br />
572 /// This will replace the default focus indicator view in the FocusManager and will be added to the focused view as a highlight.<br />
574 /// <since_tizen> 3 </since_tizen>
575 public View FocusIndicator
579 SetFocusIndicatorView(value);
583 return GetFocusIndicatorView();
587 internal void SetFocusIndicatorView(View indicator)
589 NDalicManualPINVOKE.FocusManager_SetFocusIndicatorActor(swigCPtr, View.getCPtr(indicator));
590 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
593 internal View GetFocusIndicatorView()
595 //to fix memory leak issue, match the handle count with native side.
596 IntPtr cPtr = NDalicManualPINVOKE.FocusManager_GetFocusIndicatorActor(swigCPtr);
597 HandleRef CPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
598 View ret = Registry.GetManagedBaseHandleFromNativePtr(CPtr.Handle) as View;
599 NDalicPINVOKE.delete_BaseHandle(CPtr);
600 CPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
606 /// Provides the implementation of a custom focus algorithm interface to allow the application to define the focus logic.<br />
608 /// <param name="arg0">The user's implementation of ICustomFocusAlgorithm.</param>
609 /// <since_tizen> 3 </since_tizen>
610 public void SetCustomAlgorithm(ICustomFocusAlgorithm arg0)
612 _customAlgorithmInterfaceWrapper = new CustomAlgorithmInterfaceWrapper();
613 _customAlgorithmInterfaceWrapper.SetFocusAlgorithm(arg0);
615 NDalicPINVOKE.SetCustomAlgorithm(swigCPtr, CustomAlgorithmInterface.getCPtr(_customAlgorithmInterfaceWrapper));
616 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
619 internal PreFocusChangeSignal PreFocusChangeSignal()
621 PreFocusChangeSignal ret = new PreFocusChangeSignal(NDalicManualPINVOKE.FocusManager_PreFocusChangeSignal(swigCPtr), false);
622 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
626 internal FocusChangedSignal FocusChangedSignal()
628 FocusChangedSignal ret = new FocusChangedSignal(NDalicManualPINVOKE.FocusManager_FocusChangedSignal(swigCPtr), false);
629 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
633 internal FocusGroupChangedSignal FocusGroupChangedSignal()
635 FocusGroupChangedSignal ret = new FocusGroupChangedSignal(NDalicManualPINVOKE.FocusManager_FocusGroupChangedSignal(swigCPtr), false);
636 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
640 internal ViewSignal FocusedViewEnterKeySignal()
642 ViewSignal ret = new ViewSignal(NDalicManualPINVOKE.FocusManager_FocusedActorEnterKeySignal(swigCPtr), false);
643 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
647 private static readonly FocusManager instance = FocusManager.Get();
650 /// Gets the singleton of the FocusManager object.
652 /// <since_tizen> 3 </since_tizen>
653 public static FocusManager Instance
662 /// ICustomFocusAlgorithm is used to provide the custom keyboard focus algorithm for retrieving the next focusable view.<br />
663 /// The application can implement the interface and override the keyboard focus behavior.<br />
664 /// If the focus is changing within a layout container, then the layout container is queried first to provide the next focusable view.<br />
665 /// If this does not provide a valid view, then the Keyboard FocusManager will check focusable properties to determine the next focusable actor.<br />
666 /// If focusable properties are not set, then the keyboard FocusManager calls the GetNextFocusableView() method of this interface.<br />
668 /// <since_tizen> 3 </since_tizen>
669 public interface ICustomFocusAlgorithm
672 /// Get the next focus actor.
674 /// <param name="current">The current focus view.</param>
675 /// <param name="proposed">The proposed focus view</param>
676 /// <param name="direction">The focus move direction</param>
677 /// <returns>The next focus actor.</returns>
678 /// <since_tizen> 3 </since_tizen>
679 View GetNextFocusableView(View current, View proposed, View.FocusDirection direction);
682 private class CustomAlgorithmInterfaceWrapper : CustomAlgorithmInterface
684 private FocusManager.ICustomFocusAlgorithm _customFocusAlgorithm;
686 public CustomAlgorithmInterfaceWrapper()
690 public void SetFocusAlgorithm(FocusManager.ICustomFocusAlgorithm customFocusAlgorithm)
692 _customFocusAlgorithm = customFocusAlgorithm;
695 public override View GetNextFocusableView(View current, View proposed, View.FocusDirection direction)
697 return _customFocusAlgorithm.GetNextFocusableView(current, proposed, direction);
703 /// Please do not use! this will be deprecated
705 /// <since_tizen> 3 </since_tizen>
706 /// Please do not use! this will be deprecated.
707 /// Instead please use FocusedViewActivatedEventArgs.
708 [Obsolete("Please do not use! This will be deprecated! Please use FocusedViewActivatedEventArgs instead! " +
710 "FocusManager.Instance.FocusedViewActivated = OnFocusedViewActivated; " +
711 "private void OnFocusedViewActivated(object source, FocusManager.FocusedViewActivatedEventArgs arg)" +
713 [EditorBrowsable(EditorBrowsableState.Never)]
714 public class FocusedViewEnterKeyEventArgs : EventArgs
721 /// <since_tizen> 3 </since_tizen>
735 private EventHandler<FocusedViewEnterKeyEventArgs> _focusedViewEnterKeyEventHandler2;
736 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
737 private delegate void FocusedViewEnterKeyEventCallback2(IntPtr view);
738 private FocusedViewEnterKeyEventCallback2 _focusedViewEnterKeyEventCallback2;
741 /// [Obsolete("Please do not use! this will be deprecated")]
743 /// <since_tizen> 3 </since_tizen>
744 /// Please do not use! this will be deprecated!
745 /// Instead please use FocusedViewActivated.
746 [Obsolete("Please do not use! This will be deprecated! Please use FocusManager.FocusedViewActivated instead! " +
748 "FocusManager.Instance.FocusedViewActivated = OnFocusedViewActivated; " +
749 "private void OnFocusedViewActivated(object source, FocusManager.FocusedViewActivatedEventArgs args) {...}")]
750 [EditorBrowsable(EditorBrowsableState.Never)]
751 public event EventHandler<FocusedViewEnterKeyEventArgs> FocusedViewEnterKeyPressed
755 if (_focusedViewEnterKeyEventCallback2 == null)
757 _focusedViewEnterKeyEventCallback2 = OnFocusedViewEnterKey2;
758 FocusedViewEnterKeySignal().Connect(_focusedViewEnterKeyEventCallback2);
760 _focusedViewEnterKeyEventHandler2 += value;
764 _focusedViewEnterKeyEventHandler2 -= value;
766 if (_focusedViewEnterKeyEventCallback2 != null && FocusedViewEnterKeySignal().Empty() == false)
768 FocusedViewEnterKeySignal().Disconnect(_focusedViewEnterKeyEventCallback2);
774 /// Please do not use! this will be deprecated!
776 /// Please do not use! this will be deprecated!
777 /// Instead please use OnFocusedViewEnterKey.
778 [Obsolete("Please do not use! This will be deprecated! Please use FocusManager.OnFocusedViewEnterKey instead!")]
779 [EditorBrowsable(EditorBrowsableState.Never)]
780 private void OnFocusedViewEnterKey2(IntPtr view)
782 FocusedViewActivatedEventArgs e = new FocusedViewActivatedEventArgs();
784 e.View = Registry.GetManagedBaseHandleFromNativePtr(view) as View;
786 if (_focusedViewEnterKeyEventHandler != null)
788 _focusedViewEnterKeyEventHandler(this, e);