Zajda

Hi, I am aware that this version of WPF does not support inheriting windows or pages when both of them are defined in XAML. I hope this feature will be avaiable in the next release (anyone knows what priority this have ).

But, we started development in WPF and we need to inherit some pages to extend theri functionality (like in WinForms). Imagine i have page named "PersonDetail" which encapsulates all person related edit tasks. If i want to create page "ManagerDetail" I want naturally inherit "PersonDetail" page and extend its functionality.

Now, please advise, how to approach this problem since i cant inherit those pages.

Thanks, Peter



Re: Windows Presentation Foundation (WPF) Visual inheritance - how to approach?

Tamir Khason

Create dependencyObject that encapsulate Details logic and use it all over your pages, windows and controls




Re: Windows Presentation Foundation (WPF) Visual inheritance - how to approach?

Zajda

Thing is i need to inherit Visual appearance (and change or extend it), but Events and funcionality too.



Re: Windows Presentation Foundation (WPF) Visual inheritance - how to approach?

Yi-Lun Luo - MSFT

Hello, I think you can create two custom controls. You can define their templates in styles located in generic.xaml. You can use BasedOn property of Style to inherite your parent style, and use Setter to change those you want. In your page, you can use a Grid containing only your custom control. Custom controls support inheritance.




Re: Windows Presentation Foundation (WPF) Visual inheritance - how to approach?

Zajda

Hello Yi-Lun

this is very interresting idea, I will definitely try it.

Thanks for your answer.

Peter





Re: Windows Presentation Foundation (WPF) Visual inheritance - how to approach?

Alexnaldo Santos

I tried the inheritance approach using Custom Control but doesn't solve any problem.

Please, see this post for more information :

http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=2293679&SiteID=1

Regards,
Alexnaldo Santos