Fokus setzen auf ein ListBox-Element bricht die navigation mit der Tastatur

Nach Auswahl der ListBox-Element programmgesteuert es benötigt wird, drücken Sie die down\up-Taste zwei mal um die Auswahl zu verschieben. Irgendwelche Vorschläge?

Anzeigen:

<ListBox Name="lbActions" Canvas.Left="10" Canvas.Top="10"
               Width="260" Height="180">
        <ListBoxItem Name="Open" IsSelected="true" Content="Open"></ListBoxItem>
        <ListBoxItem Name="Enter" Content="Enter"></ListBoxItem>
        <ListBoxItem Name="Print" Content="Print"></ListBoxItem>
</ListBox>

Code:

public View()
{
   lbActions.Focus();
   lbActions.SelectedIndex = 0; //not helps
   ((ListBoxItem) lbActions.SelectedItem).Focus(); //not helps either
}
InformationsquelleAutor StreamT | 2010-02-08
Schreibe einen Kommentar