How to inherit from a UserControl in WPF / NET 3.0?
Hello everyone,
I′ve an importend question, because I can′t inherit an created UserControl under NET 3.0. It′s an WindowsApplication WPF Project and I tried to inherit likes the well known rules in NET 2.0:
public class NewUserControl : BaseUserControl
I′ve seen some code examples which contained some instructions about "VisualInheritance" with XAML. But this isn′t enough, becaus I must inherit the whole class with it′s code.
But it doesn′t work anymore, I get some compiler errors - who can help me out? (It′s very urgent)
Thanks a lot for reading and your help
[1067 byte] By [
CongoFX] at [2008-1-7]
Hello Marlon,
thank you very much for your quit answer.
The compiler error displays:
"Partial declarations of must not specify different base classes"
It seems that there are partial classes created by visual studio, when adding a user control to the project. But I′ve tried very hard to find this partial class, I can′t find it.
There are not any results by google, can′t find anything about this problem...
Any ideas?
Hi there,
The problem is that since you created a new user control from the Visual studio it will automatically create a class that inherits from UserControl.
Visual studio creates a hiden class (filed under obj\Debug\) called classname.g.cs. This usual inherits from user control...
to navigate to this file just right click on your class and select Go to Defenition . This should take you to the hidden class..
hope this helps, get back to me if you need anything else
regards