HomeSearch

WPF Controls

Use WPF controls, selecting from the available types in the System.Windows.Controls namespace.

Controls, WPF. This technology, Windows Presentation Foundation, is a newer approach to designing Windows programs. It has more graphical effects available than classic Windows Forms.

Control list. As with Windows Forms, we add controls to a program in the Visual Studio designer. These are represented as XAML in the application.BorderButtonCalendarCanvasCheckBoxComboBoxDataGridDatePickerDockPanelDoubleAnimationEllipseExpanderGridSplitterGridGroupBoxImageLabelListViewMenuPasswordBoxProgressBarRadioButtonRectangleRenderTransformScrollViewerSliderStackPanelTabControlTextBlockTextBoxToolBarTreeViewViewboxWebBrowserWindowsFormsHostWrapPanel

Events, properties. We use events to handle user interaction with WPF programs. And in properties, we adjust parts of controls in response to things like mouse clicks, or key presses.HorizontalAlignmentIsEnabledKeyDownNameToolTip

Expression-based design. Suppose we wish to enable a Button when a situation occurs—like when a valid name is entered. We can set IsEnabled to an expression that returns true or false.

And: This means we can ensure the Button is always enabled when the condition is true, and false if not.

So: The code is clearer, and easier to maintain. We can avoid tracking complicated state this way.

A summary. WPF seems to result in a more professional, polished user interface than Windows Forms does. But in many respects, the technologies are interchangeable.
Home
Dot Net Perls
© 2007-2020 Sam Allen. Every person is special and unique. Send bug reports to info@dotnetperls.com.