WPF Study Notes (6)

Source: Internet
Author: User

The inheritance tree of the inline object is as follows:

Object -- dispatcherobject -- dependencyobject -- contentelement -- frameworkcontentelement -- textelement -- inline -- run span --- italic. Bold... hyperlink. Underline

Contentelement must be presented using the uielement element. Example: TXB (textblock object). inlines. Add (New linebreak ());

The inheritance tree of the button is contentcontrol --- buttonbase -- button. It inherits the clickmode attribute from the buttonbase class to control the time when a click event is generated. One of the three values is recommended. Release hover (click event generated above) Press. Padding and margin control the padding and padding respectively.

The command attribute can be set to applicationcommands, componentcommands, mediacommands, and navigatecommands.

, The static attribute of editingcommands. You can use commandbindings. Add (New commandbinding (applicationcommands. paste, pasteonexecute, pastecanexecute ));

Void pasteonexecute (Object sender, executedroutedeventargs e ){}

Void pastecanexecute (Object sender, canexecutedroutedeventargs e ){}

 

Buttonbase --- button, gridviewcolumnheader, repeatebutton, togglebutton --- checkbox, radiobutton

You can bind the attributes of the dependent object with the ischecked attribute of togglebutton. For example, BTN (togglebutton). setbinding (togglebutton. ischeckedproperty, someproperty (example; topmost) or bindind object). datacontext determines the object to which someproperty belongs.

 

Control -- textbase --- Textbox, RichTextBox

You can use the following method to load files in special formats for RichTextBox objects:

Flowdocument flow = RichTextBox. Document;

Textrange range = new textrange (flow. contentstart, flow. contentend );

Range. Load (static attributes of filestream and dataformats );

Range. Save (static attributes of filestream and dataformats );

 

 

 

 

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.