Ejemplo n.º 1
0
 public DependencyObject LastKeyboardFocussedControl(RapidFindReplaceControlViewModel model)
 {
     //look for most recent UIElement that got focus that we will search (mostly this is to ignore menus and buttons that might have opened the find popup)
     foreach (WeakReference reference in focussedElementBuffer)
     {
         if (reference != null && reference.IsAlive)
         {
             UIElement targ  = reference.Target as UIElement;
             bool      dummy = true;
             if (model.WillSearchInElement(targ, true, ref dummy, RapidFindReplaceControl.GetIsFindable(targ)))
             {
                 return(targ as DependencyObject);
             }
         }
     }
     return(null);
 }
Ejemplo n.º 2
0
        public DependencyObject LastKeyboardFocussedControl(RapidFindReplaceControlViewModel model)
        {

            //look for most recent UIElement that got focus that we will search (mostly this is to ignore menus and buttons that might have opened the find popup)
                foreach (WeakReference reference in focussedElementBuffer)
                {
                    if (reference != null && reference.IsAlive)
                    {
                        UIElement targ = reference.Target as UIElement;
                        bool dummy=true;
                        if (model.WillSearchInElement(targ, true, ref dummy, RapidFindReplaceControl.GetIsFindable(targ)))
                        {
                            return targ as DependencyObject;
                        }
                    }
                    
                }
                return null;

            
        }