tags:

views:

507

answers:

1

How can I set the ChildWindow Title content from a style?

Setting the content to text is straightforward:

Setter Property="Title" Value="My Title Text"

How can I put a StackPanel or Image in the Title from the Setter? I know I could extract the entire style for the control and modify the Chrome but I would like to avoid having all that XAML to wade through just to change a small part.

A: 
<basics:ChildWindow.Title>
<StackPanel>
 <TextBlock Text="Moo Title"/>
 <Rectangle Fill="DarkCyan" Height="25" Width="25"/>
</StackPanel>
</basics:ChildWindow.Title>

Why do you want to use a setter in the first place?

Graeme Bradbury
I want to use the setter in theme XAML file to centralize the style management of my many ChildWindow controls. Yes, I could put the above code in the ChildWindow XAML itself but that would complicate the management of the pages. Is there any other way to centralize the management other than extracting the generic.xaml and modifing it an allow styling of the title property?
DaveB
Either wait till MS fix the bug that prevents the use of setters with the Title property or get Blend and use it's edit a copy feature.
Graeme Bradbury