简体   繁体   English

MahApps.Metro ToggleSwitch焦点问题

[英]MahApps.Metro ToggleSwitch Focus issues

I am using the ToggleSwitch from MahApps.Metro as a signoff for my textbox. 我现在用的是ToggleSwitchMahApps.Metro作为signoff了我的文本框中。 Basically, once the TextBox is valid, the ToggleSwitch will disable the TextBox. 基本上,一旦TextBox有效,ToggleSwitch将禁用TextBox。 My TextBox has its UpdateSourceTrigger set to LostFocus because I am using a converter and need to wait until the user is finished to make sure it is completely valid. 我的文本框的UpdateSourceTrigger设置为LostFocus,因为我使用的是转换器,需要等到用户完成操作才能确保它完全有效。 The ToggleSwitch has its UpdateSourceTrigger set to PropertyChanged for the IsChecked property. 对于IsChecked属性,ToggleSwitch的UpdateSourceTrigger设置为PropertyChanged。

What is happening is when I type into my TextBox and then click the ToggleSwitch, my LostFocus never fires for my TextBox and my property is never set. 发生的事情是,当我在TextBox中键入内容,然后单击ToggleSwitch时,我的LostFocus永远不会为我的TextBox触发,也永远不会设置我的属性。 I tested this out by changed the ToggleSwitch to a CheckBox and that fired my LostFocus and my property was set before the IsChecked property was updated. 我通过将ToggleSwitch更改为CheckBox进行了测试,并触发了我的LostFocus,并在更新IsChecked属性之前设置了我的属性。 Any idea why the ToggleSwitch is not taking focus away from my TextBox? 知道为什么ToggleSwitch没有将焦点从我的TextBox移开吗?

MahApps.Metro (> v1.1.2)的最新Alpha版似乎已解决了此问题,也可以通过NuGet获得。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM