What are the panels in WPF?

Posted by Rajendra.prasad under WPF on 6/10/2010 | Views : 7693 | Status : [Member] | Replies : 3
2. What are the panels in WPF?
a). canvas
b). dockpanel
c). grid
d). stackpanel
e). all the above




Responses

Posted by: Lalji_mer on: 10/28/2010 [Member] Bronze | Points: 25
Posted by: Raouf on: 10/28/2010 [Member] Starter | Points: 25

Up
0
Down
These are container controls. They are used in two cases :

1)Organize how you controls are drawed in the UI.
2)Created custom DataTempates for collection controls such as TreeView, ListView, ListBox ...

The grid is like a matrix.
The DockPanel docks its child elements to a given position (Left, Right, Top, Bottom ...)
The stack panel stacks its elements in a vertical or horizontal way.

You can use them in hierarchical manner. The better way is grid->dock or stack panel.

The canvas is a coordinates based container. It's the unique one in WPF all the other containers fit their elements to the available space. You can still give them width and height values but it's not how things should be done.

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

Posted by: Raja on: 10/28/2010 [Member] Starter | Points: 25

Up
0
Down
Read this article, it will help you understand in greater detials http://www.dotnetfunda.com/articles/article900-wpf-tutorial--layoutpanelscontainers--layout-transformation-2-.aspx

Thanks

Regards,
Raja, USA

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

Login to post response