Browse Source

Make focus follow listbox selection.

pull/58/head
Steven Kirk 12 years ago
parent
commit
8f46c1360d
  1. 13
      Perspex.Controls/Primitives/SelectingItemsControl.cs

13
Perspex.Controls/Primitives/SelectingItemsControl.cs

@ -106,6 +106,18 @@ namespace Perspex.Controls.Primitives
break;
}
var selected = this.SelectedItem;
if (selected != null)
{
var container = this.ItemContainerGenerator.GetContainerForItem(selected);
if (container != null)
{
FocusManager.Instance.Focus(container, true);
}
}
e.Handled = true;
}
@ -124,6 +136,7 @@ namespace Perspex.Controls.Primitives
if (item != null)
{
this.SelectedItem = item;
FocusManager.Instance.Focus(selectable);
}
}

Loading…
Cancel
Save