Initial commit

This commit is contained in:
2014-04-30 17:33:21 -04:00
commit f965f46fb3
33 changed files with 2949 additions and 0 deletions

View File

@@ -0,0 +1,32 @@
using System.Windows;
using System.Windows.Controls;
namespace Common.Wpf.ExtendedListBoxControl
{
public class ExtendedListBox : ListBox
{
protected override DependencyObject GetContainerForItemOverride()
{
return new ExtendedListBoxItem();
}
private int _lastSelectedIndex = -1;
protected override void OnSelectionChanged(SelectionChangedEventArgs e)
{
base.OnSelectionChanged(e);
if (SelectedIndex == -1 && _lastSelectedIndex != -1)
{
int itemCount = Items.Count;
if (_lastSelectedIndex >= itemCount)
_lastSelectedIndex = itemCount - 1;
SelectedIndex = _lastSelectedIndex;
}
_lastSelectedIndex = SelectedIndex;
}
}
}