Change WPF Toolbar Background

I am trying to reproduce a Visual Studio style toolbar with two gradient backgrounds in C # code. I can see how to do this in XAML, but how can I expand the object to change the binding of the "MainPanelBorder" border in my C # code?

thank

+1


source to share


1 answer


You will need to use



myToolbar.Template.FindName("MainPanelBorder", myToolbar) as Panel 
   //Or whatever the type of the item is in the template.

      

+1


source







All Articles