I have this code behind:
CustomUserControl.xaml.cs
namespace MyProject
{
public partial class CustomUserControl : UserControl
{
You can create generic "code-behind" file without XAML-file:
public class CustomUserControl: UserControl
{ }
and than derive from it providing specific class as a parameter:
public partial class SpecificUserControl : CustomUserControl
{
public SpecificUserControl()
{
InitializeComponent();
}
}
XAML:
Unfortunately, it seems that Visual Studio designer doesn't support such generics until Visual Studio 2012 Update 2 (see https://stackoverflow.com/a/15110115/355438)