WPFwiki, wpf, wiki, .net 3.0, windows presentation foundation, FAQ, free resources, solution, development, microsoft Home of the world's largest WPF FAQ
Edit

Category

Control Styling

Edit

Question

How can I create custom ControlTemplate for a ContentControl and its derived classes (Button, Label, etc.)?

Edit

Answer

The key, when building the ControlTemplate of a ContentControl (or any of its derived classes), is to include a ContentPresenter object somewhere.

ContentPresenter is a class that will automatically take the content of the ContentControl and display it, when placed into a ContentControl's ControlTemplate.

All content is Copyright ©2007 Xceed Software Inc. unless otherwise indicated. See the Terms of Service. Contributors must read and agree to the Contribution Policy. WPFwiki is brought to you by Xceed, makers of the powerful yet free Xceed DataGrid for WPF.