WPF TreeView restores its focus after double click

前端 未结 2 1952
甜味超标
甜味超标 2021-01-12 13:26

I have a WPF TreeView with XAML shown below:


            
                

        
2条回答
  •  悲&欢浪女
    2021-01-12 14:13

    You probably need to let WPF finish the job of handling the current mouse click event(s) before you open the new Window. Let the new window be the next UI job by adding it to the current Dispatcher's queue like this:

    (...)
    
    //Editor.Show();
    Action showAction = () => Editor.Show();
    this.Dispatcher.BeginInvoke(showAction);
    

提交回复
热议问题