WPF Controls Overview – Individual Control – Items Control -Layout Control

WPF – Windows presentation foundation provides three types of controls to interact with user 1. Individual controls 2. Items control and 3. Layout control.

1. Individual controls: These controls have single responsibility e.g   Textbox : display text, Button: get clicked. These controls contain content controls which can contain one nested element. So literally developer can place a layout control as content of button which can itself contain several controls. This provides huge power to developers. As content property is an object.

WPF-Controls-Individual-Control

WPF-Controls-Individual-Control

If the content control contains any element inheriting from UIElement then it is rendered else ToString() method is called on that element.

2. Items controls : These contain group of related items from which user can choose any one or many and do some action on them. These contain many nested elements. E.g Treeview, Listbox, Menu.

WPF-Controls-Itmes-Control

WPF-Controls-Itmes-Control

3. Layout controls: These can contain multiple nested elements of different types. These provide inbuilt support for visual layout. E.g. Canvas, Stackpanel and Grid.

WPF-Controls-Layout-Control

WPF-Controls-Layout-Control

Leave a Reply

Your email address will not be published. Required fields are marked *