Category Archive for: Windows Presentation Foundation

Event Handling

WPF classes define events where you can add your handlers. For example, you can add MouseEnter, MouseLeave, MouseMove, Click, and the like. This is based on the events and delegates mechanism on .NET.covers the event and delegate architecture of .NET, With WPF,you can assign the event handler either with XAML or in the code behind. With buttonl the XMLattribute…

Read More →

Layout

To define the layout of the application, you can use a class that derives from the Panel base class, Several layout containers are available that are discussed here, A layout container needs to do two main tasks measure and arrange, With measuring, the container asks its children for the preferred shes, Because the complete size answered by the…

Read More →

Controls

You can use hundreds of controls with WPF For a better understanding, the controls are categorized into these groups: Simple controls Content controls Headered content controls Items controls Headered items controls Simple Controls Simple controls are controls that don’t have a Content property, With the But ton class, you have seen that the Button can contain any…

Read More →

Brushes

This section illustrates how to use the brushes that WPF offers for drawing backgrounds and foregrounds. Throughout this section, we will reference Figure 34-9, which shows the effects of using various brushes within the Background of Button elements. SolldColorBrush The first button in Figure 34-9 uses the SolidColorBrush, which, by name, uses a solid color, The complete area…

Read More →

Transformation

Because WPF is based on DirectX,which is vector-based, you can resize every element, The vector-based graphics are now scaled, rotated, and skewed. Hit testing (for example with mouse moves and mouse clicks) is still working without the need for manual position calculation. Adding the ScaleTransform element to the LayoutTransform property of the Canvas element, as shown, resizes the…

Read More →

Shapes

Shapes are the core elements of WPF. With shapes you can draw 20 graphics using rectangles, lines, ellipses,paths, polygons, and polylines that are represented by classes derived from the abstract base class Shape. Shapes are defined in the namespace System Windows Shapes. The following XAML example draws a yellow face with blue legs,consisting of an ellipsefor the…

Read More →

Windows Presentation Foundation

Windows Presentation Foundation (WPF) is one of the major extensions of .NET Framework 3.0 WPF is a new library to create the Ul for smart client applications, While the Windows Forms controls are native Windows controls that use Window handles that are based on screen pixels, WPF is based on DirectX, The application does not use Window handles.…

Read More →

Back to Top