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:
- 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 >
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;
}
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