|
<Window x:Class="TestApp.Window1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:t="clr-namespace:TestApp" Title="EnhancedFocusScope" Height="400" Width="500">
<Window.Resources>
<Style TargetType="GroupBox">
<Setter Property="Background" Value="Transparent"/>
<Setter Property="KeyboardNavigation.TabNavigation" Value="Cycle"/>
<Setter Property="KeyboardNavigation.ControlTabNavigation" Value="Once"/>
</Style>
</Window.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="100" />
<RowDefinition />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<ToolBar Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="3">
<Button Command="Copy">Copy</Button>
<Button Command="Cut">Cut</Button>
<Button Command="Paste">Paste</Button>
</ToolBar>
<TextBox Grid.Row="1" Grid.ColumnSpan="3" AcceptsReturn="True">A free text area</TextBox>
<GroupBox Name="box1" Header="No focus scope" Grid.Row="2" MouseDown="Box1_MouseDown">
<StackPanel Margin="4">
<Button>a</Button>
<Button>b</Button>
<Button>c</Button>
<TextBox />
<CheckBox>CheckBox</CheckBox>
</StackPanel>
</GroupBox>
<GroupBox Name="box2" Header="WPF focus scope" FocusManager.IsFocusScope="True" Grid.Column="1" Grid.Row="2" MouseDown="Box2_MouseDown">
<StackPanel Margin="4">
<Button>a</Button>
<Button>b</Button>
<Button>c</Button>
<TextBox />
<CheckBox>CheckBox</CheckBox>
</StackPanel>
</GroupBox>
<GroupBox Name="box3" Header="My Focus Scope" t:EnhancedFocusScope.IsEnhancedFocusScope="True" Grid.Column="2" Grid.Row="2" MouseDown="Box3_MouseDown">
<StackPanel Margin="4">
<Button>a</Button>
<Button>b</Button>
<Button>c</Button>
<TextBox />
<CheckBox>CheckBox</CheckBox>
</StackPanel>
</GroupBox>
</Grid>
</Window>
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.