How to Implement our own base class for user controls

Posted by Girish578 under Silverlight on 3/19/2010 | Views : 6031 | Status : [Member] | Replies : 3
How to Implement our own base class for Silverlight 3.0 user controls ?




Responses

Posted by: Abhi2434 on: 3/20/2010 [Member] [Microsoft_MVP] [MVP] Silver

Up
0
Down
Is this what you are looking for ?

http://www.abhisheksur.com/2010/03/create-base-window-usercontrol-in-wpf.html

Hope this will help you.

www.abhisheksur.com

Girish578, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Girish578 on: 3/22/2010 [Member] Starter

Up
0
Down
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

Girish578, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Abhi2434 on: 3/23/2010 [Member] [Microsoft_MVP] [MVP] Silver

Up
0
Down
Did you made the UserControl root element in the XAML to your custom Base class as I was doing in my application ?

It is very important to do this.

www.abhisheksur.com

Girish578, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response