A followup to this question: How do you hide a WPF DocumentViewer's menu bars?
I’m totally new to WPF and not sure where to start with control template customization. MSDN doesn’t seem to help a lot.
All I need is to hide the main DocumentViewer toolbar, but when I try to customize the XAML file, it fails to compile. What are the customization steps?
In WPF a control template is used to “skin” a control with a set of elements that compose the look-and-feel and the behavior of the control. You don’t have to know any more than that to start using control templates. The steps to customizing a control template are:
ElementName(which includes the control template) using MSDN, ShowMeTheTemplate, Expression Blend or theme filesApp.xamlor in an element’s resources such as aWindoworGridx:Key="{x:Type ElementName}"tox:Key="myStyleName"ElementNameby adding the attributeStyle="{StaticResource myStyleName}"So let’s do that. Here’s the default style for
DocumentViewerfrom MSDN. We see a big section starting with<ToolBar ...>so we’ll delete all of that. Then if you follow the rest of the steps you’ll end up with XAML like this: