Tab Order / Focus
Posted: 01 Sep 2013, 23:43
Are there directions anywhere for setting up navigating between elements using the keyboard? I'm just trying to get something simple working with tabbing to move the focus the between a few buttons.
When I manually call Focus on an element it gets focused, but when I try using SetIsTabStop, SetTabIndex and moving the focus with MoveFocus I am not seeing anything. MoveFocus returns false when I call it on the currently focused item.
I'm using a test xaml file which is very simple:
When I manually call Focus on an element it gets focused, but when I try using SetIsTabStop, SetTabIndex and moving the focus with MoveFocus I am not seeing anything. MoveFocus returns false when I call it on the currently focused item.
I'm using a test xaml file which is very simple:
Code: Select all
<Grid
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d"
xmlns:noesis="clr-namespace:NoesisGUIExtensions">
<Grid.Resources>
<Storyboard x:Name="AnimInFromSplash">
<DoubleAnimation Duration="0:0:1" From="0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="ButtonPlay" d:IsOptimized="True"/>
<DoubleAnimation Duration="0:0:1" From="0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="ButtonEdit" d:IsOptimized="True"/>
<DoubleAnimation Duration="0:0:1" From="0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="ButtonOptions" d:IsOptimized="True"/>
<DoubleAnimation Duration="0:0:1" From="0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="LogoBorder" d:IsOptimized="True"/>
</Storyboard>
<Storyboard x:Name="AnimIn">
<DoubleAnimation Duration="0:0:1" From="0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="ButtonPlay" d:IsOptimized="True"/>
<DoubleAnimation Duration="0:0:1" From="0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="ButtonEdit" d:IsOptimized="True"/>
<DoubleAnimation Duration="0:0:1" From="0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="ButtonOptions" d:IsOptimized="True"/>
</Storyboard>
</Grid.Resources>
<StackPanel VerticalAlignment="Center" HorizontalAlignment="Center">
<Border x:Name="LogoBorder" BorderBrush="Black" BorderThickness="1" Margin="5,0" HorizontalAlignment="Center" VerticalAlignment="Center">
<Image Source="main_menu_logo.png" Stretch="None"/>
</Border>
<Button x:Name="ButtonPlay" Content="Play" Width="120" Height="40" FontFamily="fonts/#meiryo"/>
<Button x:Name="ButtonEdit" Content="Edit" Width="120" Height="40" FontFamily="fonts/#meiryo"/>
<Button x:Name="ButtonOptions" Content="Options" Width="120" Height="40" FontFamily="fonts/#meiryo"/>
</StackPanel>
</Grid>