Can't enter enter text in TextBox control inside Flyout

前端 未结 3 2233
心在旅途
心在旅途 2021-02-13 03:57

I want to use the CommandBar and a Flyout to build something like this.

\"search

3条回答
  •  野的像风
    2021-02-13 04:36

    your TextBox is actually never getting focus at all, somehow flyout prevents it, the only action I can get from this TextBox is PointerOver state - causing it to look like it's got focus, but it is not.

    You need to set the focus in the code, for example when the flyout opens - it works, but may be not the nicest solution, cause you need to name the TextBox in order to get it from code behind.

    
        
            
                
                    
                        
                            
                                
                                
                            
                            
                            
                        
                    
                
            
        
    
    

    and then code behind:

    private void FlyoutBase_OnOpened(object sender, object e)
    {
        Test.Focus(FocusState.Programmatic);
    }
    

提交回复
热议问题