Changing the ContentTemplate
won't help you because that is just used by the that you want to replace. You could use something like the following to access a ContentPresenter
, but this only works on a per UI element basis from a UI collection, eg. you could use this to access the single ContentPresenter
defined in a template from a ListBoxItem
that has that template applied:
ContentPresenter contentPresenter = FindVisualChild(dependencyObject);
As that is no use to you, I won't bother showing the code for that method. The only other alternative you have is to define a new ControlTemplate
. It should be a simple matter to define a new ControlTemplate
if you have access to the default ControlTemplate
.