Should I inherit from a stackpanel instead of a stack panel, grid or other UI element or UserControl

Posted by Joel Barsotti on Stack Overflow See other posts from Stack Overflow or by Joel Barsotti
Published on 2010-03-28T02:29:26Z Indexed on 2010/03/28 2:33 UTC
Read the original article Hit count: 345

Filed under:
|
|
|

So I'm building a peice of UI that might me in a dialog window or might be in embedded in part of a bigger page.

I don't have alot of experience with WPF, but in ASP.NET you always used UserControls, because their wasn't anyt really generic UI inherit to inherit from (and in a way UserControl was just a div).

My coworker has written alot of controls that inherit directly from stackpanel. That seems like a decent way of doing things. But when I went to create a control for the code I was going to write I was presented with a dialog that only included the UserControl, which I wasn't that familiar with in the context of WPF.

So can someone explain to me the difference from building a control that inherits from user control vs inheriting directly from a stackPanel?

© Stack Overflow or respective owner

Related posts about .NET

Related posts about wpf