WPF core object model-class diagram and parsing

Source: Internet
Author: User
Tags set background

Dispatcherobject is a base class that, by inheriting the class, can gain access to the dispatcher object that creates the UI thread of the object. With the Dispatcher object, you can incorporate code snippets into the UI thread execution.

DependencyObject is the core base class for implementing a dependency property mechanism. A dependency property is a more powerful property model than a CLR property, which supports attributes such as change notification, default inheritance, and reduces property storage space. DependencyObject supports the dependency property mechanism through methods such as GetValue and SetValue. Inheriting several of the next layer base classes of the class Visual,visual3d,triggerbase, Freezable and its derived classes are supported by the dependency property mechanism.

A dependency property is represented by the DependencyProperty class, which contains attributes such as name, owning type, property type, and registering the dependency property through the Register static method, and registering the attached property by registerattached the static method.

There are also frameworktemplate and style,frameworktemplate that directly inherit the base class Dispatcherobject to support the template mechanism, and style is used to support the styling mechanism.

The inheritance frameworktemplate includes the data template DataTemplate, the control template ControlTemplate, and the item panel template itemspaneltemplate. Customizing data presentation using DataTemplate, you can specify that datatype is used to uniformly customize the rendering of a data type. Hierarchicaldatatemplate inherits DataTemplate, which represents a hierarchical data template that can be used to specify a data source for child data binding by ItemTemplate specifying how the child data is rendered. Custom control rendering using ControlTemplate, you can set a trigger. Customize the layout of items for multiple content controls using Itemspaneltemplate.

The style class is used for style extraction, styles, and other resources in the resource dictionary ResourceDictionary. The style specifies the type of action through the TargetType property, the base style is specified by the BasedOn property, and the trigger is added to the triggers by adding a setter setting to the value of the property in setters.

ResourceDictionary can be used for resource dictionary merging through Mergeddictionaries, specifying the referenced resource dictionary address through source, and finding resources through the indexer.

The RoutedEvent class is used to support another important mechanism for routing events, and the properties of RoutedEvent include the name, the owning type, the routing policy, and the processor type. The routed event is registered through EventManager's registerroutedevent static method.

DispatcherTimer is a UI thread timer that can set the interval interval, whether IsEnabled is enabled, the processing logic is specified through the Tick event, and the timer starts and stops with the start and stop methods.

The application represents the application, obtains the current instance through the present, MainWindow obtains the main window, can add the application level resource in the resources, the launch page through the StartupUri setting.

The direct derived classes of the core base class DependencyObject are Visual,visual3d,triggerbase and freezable.

Visual represents a 2D visual element, Visual3D represents a 3D visual element, UIElement3D inherits Visual3D represents a 3D UI element, and it has two derived classes Modeluielement3d and Containeruielement3d.

Triggerbase is used to support trigger mechanisms, and its derived classes include Trigger,multitrigger,datatrigger,multidatatrigger and EventTrigger.

Animatable is a derived class of freezable, and it has two derived classes, brush and ImageSource, representing both brush and picture sources. Paint brushes include solid color brush SolidColorBrush, can set color colors, gradient brush Gradientbrush, you can set the gradient end gradientstop, and tile brush TileBrush, you can set the stretching method. Gradientbrush is divided into linear linear and radial radial two kinds. Picture painting brush ImageBrush is a kind of tilebrush, can set the picture source ImageSource.

ImageSource derived classes include bitmap picture source BitmapSource, drawing picture source drawingimage and 3D picture source D3dimage, BitmapSource also has a bitmap picture bitmapimage and a writable bitmap picture WriteableBitmap two derived classes.

Directly inheriting UIElement is frameworkelement,uielement located in the WPF core layer PresentationCore, FrameworkElement and its derived classes are located in the WPF framework layer presentationframework. UIElement provides clipping clip, command binding commandbindings, input binding inputbindings, availability isenabled, transparency opacity, rendering transform RenderTransform, Properties such as visibility visibility, which trigger routed events by means of the RaiseEvent method. FrameworkElement provides mouse cursors cursor, data context DataContext, wide height, horizontal vertical alignment, margin margin, resource collection resources, style Style,tag, tooltip tooltip, Trigger collection triggers properties, which are set by the SetBinding method.

Visualstatemanager,visualstategroup and VisualState are used to implement visual state management mechanisms.

control controls, text blocks TextBlock, image images, page pages, decorative decorator, panel panels, popup popup, shape shapes, and so on directly inherit FrameworkElement, both of which are frame elements.

TextBlock can set the text and text alignment textalignment. Image to set source and Extrude mode stretch. Page to set content contents and titles title. Popup can set child elements, whether to open isopen, position placement and other properties.

Decorator is the base class for decorative elements, child elements can be set, there are border border and view boxes Viewbox two derived classes. Border can set background background, border brush BorderBrush, border width borderthickness, fillet radius cornerradius and inner margin padding. Viewbox can set the stretch mode stretch and the extrusion direction stretchdirection.

A panel is the base class for a layout container, and you can set the background to add child elements. Its derived classes have grid layout grid, can set row and column definitions, stacked layout stackpanel, can set orientation, canvas layout canvas, dock layout dockpanel, Flow layout wrappanel, set the direction and width of items, Unified Grid Layout UniformGrid, there are virtual base class Virtualizingpanel. VirtualizingStackPanel is an implementation of Virtualizingpanel.

Shape is the base class for shapes, including the fill brush fill, wireframe brush stroke, wireframe width strokethickness, stretch mode stretch and other properties. Its derived classes are rectangular rectangle, oval ellipse, line lines, and path paths.

Finally, the control is very derived from the class system. Control contains background background, border brush BorderBrush, border width borderthickness, font fontfamily, size fontsize, Word weight fontweight, foreground foreground , the horizontal and vertical content on its way, the padding padding, and the template templates for the control. Its derived classes include ContentControl and ItemsControl two families, which represent controls with individual content and controls that have multiple content, as well as small groups such as TextBoxBase and Rangebase.

The derived classes for Rangebase are ProgressBar and sliders. The derived classes for TextBoxBase are TextBox and RichTextBox.

ContentControl has a single content, can be set content contents, content template ContentTemplate, or content template selector contenttemplateselector. There are window windows, user Controls UserControl, tooltip tooltips, scroll viewer scrollviewer, frame frames and other derived classes, and a single content control with a head HeaderedContentControl and a base button ButtonBase two important derived classes.

HeaderedContentControl can be set header header, head template HeaderTemplate, or head template selector Headertemplateselector, derived class for the expansion expander, Group container GroupBox, tab item TabItem, and so on.

ButtonBase can set the click Mode clickmode, command commands, command parameters CommandParameter, derived classes for button buttons and toggle Buttons ToggleButton. ToggleButton can set whether ischecked is checked and whether it is a three-state isthreestate, and a single marquee RadioButton and check box checkbox two derived classes, where RadioButton can set the group name GroupName.

ItemsControl has a number of content, you can set the binding data source ItemsSource, item template ItemTemplate, or item template selector itemtemplateselector, item panel Itemspanel, Item container style Itemcontainerstyle, or item container style selector Itemcontainerstyleselector properties. There are multiple content controls that have headers HeaderedItemsControl and selectors selector two derived classes.

HeaderedItemsControl can be set header header, header template HeaderTemplate, or head template selector Headertemplateselector, derived class for tree view item TreeViewItem, etc.

Selector can be set to select an index selectedindex or select an item SelectedItem, the derived class is a multi-selector multiselector, a dropdown box combobox, a list box listbox, and a tab control TabControl. The DataGrid is a derived class of multiselector.

WPF core object model-class diagram and parsing

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.