I have encountered something very strange, simple WPF application
<Window x:Class="ListBoxSelection.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow" Height="350" Width="525">
<Grid>
<ListBox ItemsSource="{Binding Path=Strings}" SelectionMode="Single"/>
</Grid>
</Window>
with code behind
public class ViewModel
{
public List<string> Strings { get; set; }
public ViewModel ()
{
Strings = new List<string> ();
Strings.Add ("A");
// add many items ...
Strings.Add ("A");
}
}
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
public MainWindow ()
{
InitializeComponent ();
DataContext = new ViewModel ();
}
}
and when I click on a single item,
if I continue clicking items, they just aggregate. Clicking an already selected item does nothing. Scratching my head, I have databound lists to ListBoxes before, and have never seen this before. Running Win7 (64), VS2010, behaviour presents with .Net 3.5, .Net 3.5 Client Profile, .Net 4, and .Net 4 Client Profile.
Arg, I should mention I am expecting normal, default, single-select behaviour.