Which are the different namespaces and classes in WPF?

 Posted by ArticlesMaint on 9/19/2009 | Category: WPF Interview questions | Views: 7921

There are ten important namespaces / classes in WPF.


All WPF objects derive from the DispatcherObject. WPF works on STA model i.e. Single Threading Apartment Model. The main duty of this object is to handle concurrency and threading. When any message like mouse clicks, button clicks etc are initiated they are sent to the DispatcherObject who verifies whether code is running on the correct thread. In the coming section we will look in to detail how WPF threading works.


When WPF was designed property based architecture was considered. In other words rather than using methods, functions and events object behavior will interact using properties. For now we will only restrict ourselves to this definition. In the coming section we have dedicated question for the same.


Visual class is a drawing object which abstracts drawing instructions, how drawing should be drawn like clipping, opacity and other functionalities. Visual class also acts like a bridge between unmanaged MilCore.dll and WPF managed classes. When any class derived from visual it can be displayed on windows. If you want to create your own customized user interface then you can program using visual objects.


UIElement handled three important aspects layout, input and events.
FrameWorkElement uses the foundation set by UIElement. It adds key properties like HorizontalAlignment , VerticalAlignment , margins etc.


This class helps us to create basic shapes such as Rectangle, Polygon, Ellipse, Line, and Path.


This class has controls like TextBox,Button,ListBox etc. It adds some extra properties like font,foreground and background colors.


It holds a single piece of content. This can start from a simple label and go down to a unit level of string in a layout panel using shapes.
This is the base class for all controls that show a collection of items, such as the ListBox and TreeView.


This class is used for all layout containers—elements that can contain one or more children and arrange them as per specific layout rules. These containers are the foundation of the WPF layout system, and using them is the key to arranging your content in the most attractive, flexible way possible.

Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response