首页 > 解决方案 > 如何使用 mvvm 模式在 wpf 中的文本框上闪烁光标

问题描述

如何在文本框上使用 MVVM 模式专注于鼠标输入时在文本框上闪烁光标。以下是我的代码

    <TextBox Name="txtUserName" IsManipulationEnabled="True"  Tag="{lex:Loc Key=EnterYourUsername}"  TextAlignment="Center" Style="{StaticResource LoginByDomaintxt}" HorizontalAlignment="Right" Text="{Binding UserName, Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Foreground="#111111">

标签: wpfxamlmvvmstyles

解决方案


默认样式下,您将让光标闪烁。

<Textbox Name="Name"/>

推荐阅读