Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public partial class MyListBox: ListBox
- {
- protected override System.Windows.DependencyObject GetContainerForItemOverride()
- {
- return new MyListBoxItem();
- }
- protected override bool IsItemItsOwnContainerOverride(object item)
- {
- return item is MyListBoxItem;
- }
- }
- public class MyListBoxItem : ListBoxItem
- {
- }
- <local:MyListBox ItemsSource="{Binding Items}">
- <local:MyListBox.ItemTemplate>
- <DataTemplate>
- <TextBlock Text="{Binding id}"/>
- </DataTemplate>
- </local:MyListBox.ItemTemplate>
- </local:MyListBox>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement