WPF learning notes controls attributes [1] FrameworkElement

Source: Internet
Author: User

Recently, I am working on WPF. Because many attributes are not well understood, I often take settings for granted, and I often encounter unexpected problems, I feel like I have to sort them out.

 

Ps: first fill in the class structure of common controls to avoid confusion

 

. NET Framework 4.5

Using System. Windows. Controls;

This makes it clear that the FrameworkElement class is summarized first:

"Provides the WPF framework-level property set, event set, and method set for Windows Presentation Foundation (WPF) elements. This class represents the included WPF framework-level implementation, which is built based on the WPF core-level API defined by UIElement ." From Msdn

 

Only list common attributes that are not familiar to me.

AllowDrop: Can it be used as the target for drag-and-drop operations?

Clip: Defines the geometric shape of the element content contour (that is, to set a shape to display the current control as a window, it may be used to create a non-rectangular Control)

ClipToBounds: Indicates whether to cut the content of this element to make it suitable for the size of the contained element.

CacheMode: Gets or sets the cache representation of the UIElement. Set the CacheMode attribute when you need to improve the performance of the content that is very time-consuming. For more information, see BitmapCache. (If you haven't used it, copy msdn directly, the same below)

BindingGroup: Used to verify the values of multiple attributes of an object.

CommandBindings: Gets the set of CommandBinding objects associated with this element. CommandBinding enables command processing for this element, and declares the link between the command, command event, and the handler appended to this element.

DesiredSize:Obtains the size calculated during the measurement processing of this element during the layout process.

Dispatcher: Get the Dispatcher associated with this DispatcherObject. (Scheduler... don't understand)

ForceCursor: Force the Cursor to display when it is positioned on this element (including all child elements) using the current Cursor settings of the Cursor

IsHitTestVisible: Declares whether this element can be returned as a hit test result for a part of its rendered content. (If it is false, the control cannot respond to various events)

IsManipulationEnabled: Indicates whether to enable operation events for this UIElement.

LogicalChildren: Gets an enumerator for the logical child element of this element. Sub-elements can be accessed cyclically.

Tag: Gets or sets any object value, which can be used to store custom information about this element.

SnapsToDevicePixels: Determines whether to use device-specific pixel settings during the rendering of elements. (For devices running at more than 96 dots per inch (dpi), setting this attribute to true can minimize the anti-sawtooth visual flaws that appear near a single solid line)

UseLayoutRounding: Gets or sets a value that indicates whether layout rounding should be applied to the size and position of the element during the layout process. (When the edge is in the middle of the device pixel, painting the object on the pixel boundary will eliminate the semi-transparent edge generated by anti-aliasing .)

Network restrictions, other attributes are not listed, and cannot be published after being listed...

Related Article

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.