How to Implement our own base class for Silverlight 3.0 user controls ?

How we can implement to silver light project?

UserControl.cs
---------------
public class UserControlBase : UserControl
{

public UserControlBase()
{
}

}

TextControl.xaml.cs
-------------------
public partial class TestControl : UserControlBase
{
public TestControl()
{
InitializeComponent();
}
}

Error:-
------
Error 1 Partial declarations of 'BaseClassTest.TestControl' must not specify different base classes C:\ TestControl.xaml.cs 15 26 BaseClassTest

Please help me with that problem
Jaya1983Asked:
Who is Participating?
 
Rob SiklosConnect With a Mentor Commented:
In TextControl.xaml, make sure the root tag is <UserControlBase>, and not <UserControl>.

This will make sure that the generated code (hidden *.g.cs files) also inherit from UserControlBase
0
 
MaffeCommented:
Looks like the parts of TestControl inherits from two different classes. ;o) You should use the same base class.

Check all partial definitions and fix it.
0
 
Rob SiklosCommented:
I don't think this question should be deleted.  I have seen this problem many times - my solution is valid and correct, and could be helpful to others with the same problem.
0
 
Rob SiklosCommented:
0
All Courses

From novice to tech pro — start learning today.