示例#1
0
 private static void LostScrollFocusClass(Actor sender, ScrollFocusChangedEventArgs e)
 {
     if (sender != null)
     {
         sender.OnLostScrollFocus(e);
     }
 }
示例#2
0
        public void SetScrollFocus(Actor actor)
        {
            if (_scrollFocus == actor)
            {
                return;
            }

            Actor oldScrollFocus = _scrollFocus;

            _scrollFocus = actor;

            if (oldScrollFocus != null)
            {
                ScrollFocusChangedEventArgs eva = Pools <ScrollFocusChangedEventArgs> .Obtain();

                eva.RoutedEvent = LostScrollFocusEvent;
                eva.NewFocus    = actor;
                eva.OldFocus    = oldScrollFocus;

                bool cancel = oldScrollFocus.RaiseEvent(eva);
                Pools <ScrollFocusChangedEventArgs> .Release(eva);

                if (cancel)
                {
                    return;
                }
            }

            if (actor != null)
            {
                ScrollFocusChangedEventArgs eva = Pools <ScrollFocusChangedEventArgs> .Obtain();

                eva.RoutedEvent = GotScrollFocusEvent;
                eva.NewFocus    = actor;
                eva.OldFocus    = oldScrollFocus;

                if (actor.RaiseEvent(eva))
                {
                    SetScrollFocus(oldScrollFocus);
                }

                Pools <ScrollFocusChangedEventArgs> .Release(eva);
            }
        }
示例#3
0
 protected virtual void OnLostScrollFocus(ScrollFocusChangedEventArgs e)
 {
 }