Skip to content

Instantly share code, notes, and snippets.

@dkalamari
Created April 17, 2014 08:17
Show Gist options
  • Save dkalamari/10963821 to your computer and use it in GitHub Desktop.
Save dkalamari/10963821 to your computer and use it in GitHub Desktop.
WPF TextBox focus through MVVM
<Style x:Key="NormalTextBox" TargetType="{x:Type TextBox}">
<Style.Triggers>
<DataTrigger Binding="{Binding IsFocused}" Value="True">
<Setter Property="FocusManager.FocusedElement"
Value="{Binding RelativeSource={RelativeSource Self}}" />
</DataTrigger>
</Style.Triggers>
</Style>
@awekang
Copy link

awekang commented Nov 9, 2018

Good

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment