There is nothing in a DocumentViewer
which ensures that the toolbar is even there, that being the case a programmatic manipulation of the control at run-time to remove a toolbar which may or may not exist might not be such a good idea. Of course you can do some null-checking and exception handling but that is not very clean either.
For the default aero template the following code will knock out the toolbar:
var contentHost = viewer.Template.FindName("PART_ContentHost", viewer) as ScrollViewer;
var grid = contentHost.Parent as Grid;
grid.Children.RemoveAt(0);
I remove the toolbar indirectly as it is not a PART
, this is the reason why it may not even exist in some themes.
Ideally you should override the template completely.