Keyboard won't dismiss even after Focus change

后端 未结 5 1903
忘掉有多难
忘掉有多难 2020-12-19 06:05

I am creating a Windows 8.1 app and after the user presses a button, a popup opens over most of the screen. There are several textboxes inside the popover.

I found

5条回答
  •  不思量自难忘°
    2020-12-19 06:21

    In UWP Windows 10 simple disable/enable doesn't work anymore. But this works:

                TextBox.IsEnabled = false;
    
                var t = new DispatcherTimer();
                t.Interval = new TimeSpan(0, 0, 1);
                t.Tick += (a, b) =>
                {
                    t.Stop();
                    TextBox.IsEnabled = true;
                };
                t.Start();
    

    Find more elegant solution? Please share.

提交回复
热议问题