WPF Series Custom Controls

Source: Internet
Author: User

Introduction

In WPF, Microsoft provides some basic controls, but the work of these basic controls often does not meet our needs, this time we need to develop their own control according to the actual needs, but it is important to note that not all features are not satisfied with the needs of the custom control to implement. In fact, once a custom control is used, the style,datatemplate,controltemplate features provided by WPF do not meet our needs.

Introduction to Custom Controls

Inherited parent Type Advantages Disadvantages
UserControl As simple as creating a normal WPF interface, you can use events directly
No need to support complex user customizations
Only existing controls can be used
Control Users can customize an appearance through ControlTemplate
The control can support different topics (Theme)
Ensure UI and logic (logic) detach with commands and binding instead of events, and avoid using directly referencing UI elements in ControlTemplate
Need to implement support for complex user customizations
FrameworkElement Finer control over the previous two appearance of controls
You can customize the appearance of the render logic (render) control.

Basic steps for customizing controls

Summarize

Reference

Control Customization

[WPF] ListView click the column header sorting feature to implement

WPF Series Custom Controls

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.