Hi all,
I am creating a series of UserControls in silverlight, and they all need a hand full of the same functions, such as ShowControl(), ValidateInput() etc.
I created an interface and which then had an abstract class inherit from it. I then changed my UserControls to inherit from the abstract instead of directly from UserControl.
This all compiled fine, but when I go into the SilverLight App the controls dont show, the editor in VS2010 gives me an error saying it "Cannot create an instance of" my control.
What did I miss?
I have included below my code:
The interface:
public interface IMyControl
{
Action<string> ValueAction { get; set; }
void ShowControl(StackPanel parentControl, Action<string> response);
}
The abstract control:
public abstract class MyControl : UserControl, IMyControl
{
public abstract Action<string> ValueAction { get; set; }
public abstract void ShowControl(StackPanel parentControl, Action<string> response);
protected abstract void SetupControl();
protected abstract void ValidateInput();
}
Thanks for any help on this one.