User Control inherit from ListBox in Wpf?
- by Rev
Hi.
I want to make a user Control in WPf with same properties and events like ListBox.(can add items , remove them , selecting ,...)
on way in windows App is use a user control which is inherit form ListBox. but in WPF I don't know how make User Control inherit from ListBox (or other WPF Control)!!!
I write this code but it had an exception
public partial class InboxListItem : ListBox
{
public InboxListItem()
{
InitializeComponent();
}
and It's Xaml file
<UserControl
x:Class="ListBoxControl.InboxListItem"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:myTypes="clr-namespace:ListBoxControl"
/>