Created
February 25, 2014 12:21
-
-
Save podhmo/9207824 to your computer and use it in GitHub Desktop.
focus
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Window x:Class="FocusSample.MainWindow" | |
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | |
Title="MainWindow" Height="350" Width="525"> | |
<Window.Resources> | |
<Style TargetType="TextBox"> | |
<Setter Property="Height" Value="50"/> | |
<Setter Property="FontSize" Value="40"/> | |
</Style> | |
</Window.Resources> | |
<StackPanel> | |
<TextBox x:Name="Input"></TextBox> | |
<Button Height="50" x:Name="Button"> | |
<Button.Style> | |
<Style TargetType="Button"> | |
<Style.Triggers> | |
<DataTrigger Binding="{Binding ElementName=Button, Path=IsMouseOver}" Value="True"> | |
<Setter Property="FocusManager.FocusedElement" | |
Value="{Binding ElementName=Input}"/> | |
</DataTrigger> | |
</Style.Triggers> | |
</Style> | |
</Button.Style> | |
</Button> | |
<TextBox x:Name="DummyInput"></TextBox> | |
</StackPanel> | |
</Window> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment