I am still working on converting some Winforms to WPF Windows. I have one that is working perfectly, except for one, very annoying, issue. Here's a snip of the XAML to create a CheckedListBox:
<ListBox x:Name="clb_PtGrps" ItemsSource="{Binding PresentationObjects}" >
<ListBox.ItemTemplate>
<HierarchicalDataTemplate>
<CheckBox Content="{Binding Name}" IsChecked="{Binding IsChecked}" HorizontalAlignment="Left"/>
</HierarchicalDataTemplate>
</ListBox.ItemTemplate>
<ListBox.ToolTip>
<ToolTip>
<TextBlock Text="Checked groups will be placed at the top in the same relative order. All others will be sorted."
TextWrapping="WrapWithOverflow" Width="200"/>
</ToolTip>
</ListBox.ToolTip>
</ListBox>
Which works almost perfectly. The issue is that I have one object with a name having a leading Underscore, such as "_AllPoints". When that item is placed into the checkbox Content, the underscore is placed UNDER the A instead of showing "_A". The same list, when used in a Winforms CheckedListBox Text property display correctly. So, how in the world do I get the Content to display as it should?
HAH! Just before I posted this I had a fleeting thought and solved this on my own. For anyone stumbling across this, here is the change I made to get this to work:
<CheckBox IsChecked="{Binding IsChecked}" HorizontalAlignment="Left">
<StackPanel>
<TextBlock Text="{Binding Name}"/>
</StackPanel>
</CheckBox>