WPF-template viewing tool: Show me the template and how to view third-party topics

Source: Internet
Author: User

When learning WPF templates (datatemplate, itemspaneltemplate, and controltemplate), you often want to see the built-in WPF control templates. In the debugging and Development utilities of WPF-resource collection, I listed a tool named show me the template, which can be used to view the built-in templates for five themes, modifying and creating your own template based on these templates is much easier than starting from scratch. The running interface is as follows:

How to modify to view a third-party Template  

InReuxables provides two free styles, one of which is Inc. I think it is good. openexpressapp is ready to support this style. The interface is as follows:

However, it does not provide a XAML file, so it cannot be modified. You can modify the show me the TemplateCodeThe steps are as follows:

  1. REFERENCE The incy. dll Style File, modify the app. XAML file, and add resources:

    Code

    < Application
    X: Class = " Showmethetemplate. app "
    Xmlns = " Http://schemas.microsoft.com/winfx/2006/xaml/presentation "
    Xmlns: x = " Http://schemas.microsoft.com/winfx/2006/xaml "
    Startupuri = " Window1.xaml "
    Shutdownmode = " Onmainwindowclose " >
    < Application. Resources >
    <Resourcedictionary source = "/incy; component/incoriginal. XAML"/>
    </ Application. Resources >
    </ Application >
  2. Comment out two lines of code in window1.xaml. CS:

    Code

    Void Themes_selectionchanged ( Object Sender, selectionchangedeventargs e ){
    ComboBox CB = (ComboBox) sender;
    Uri themeuri = New Uri (( String ) (Comboboxitem) CB. selecteditem). Tag, urikind. Relative );
    // Resourcedictionary themeresources = (resourcedictionary) application. loadcomponent (themeuri );
    // Templateitems. Resources = themeresources;
    }

     

  3. After running, switch to the left-side list to view the corresponding third-party template. to switch the listboxitem interface:

 

Recommended:Online e-books you may need

Agile individual Sina microjournal: http://kan.weibo.com/kan/3483302195814612

 You are welcome to reprint it. Please note: Reprinted fromAgile personal website

 

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.