We have a DataTemplate that includes a ListBox. Each ListBoxItem has some additional functionality provided by a 3rd party diagram component we are using. I need the functionality of the ListBox (selection, key-presses etc) but having this functionality
seems to prevent the 3rd party stuff from working. The manufacturer of the 3rd party component suggested creating a custom ListBox with the code below.
public class CustomListBox : ListBox
protected override DependencyObject GetContainerForItemOverride()
return new CustomListBoxItem();
public class CustomListBoxItem : ListBoxItem
protected override void OnMouseLeftButtonDown(MouseButtonEventArgs e)
e.Handled = false;
This is great for making the 3rd party stuff work again but now we have lost the ListBox functionality (selection, key-presses). Setting e.Handled=true, obviously makes it work as the normal ListBox.
Any help is greatly appreciated.
View Complete Post