Hi,
I am trying to change the expander backgraund color, It seems so easy but I can't do that.
<Expander Name="expOneDay">
<Expander.Header>
<TextBlock Foreground="CadetBlue" Text="Some Text" HorizontalAlignment="Stretch" />
</Expander.Header>
...
</Expander>
why HorizontalAlignment="Stretch" doesn't help? I am trying to bind the with of header to the with of expander but the resoult is not nice looking
Thanks a lot
views:
556answers:
1
+2
A:
here you go, this should do the trick....
<Expander Name="expOneDay"
HorizontalAlignment="Stretch"
HorizontalContentAlignment="Stretch" Width="Auto">
<Expander.Header >
<Border Background="Bisque">
<TextBlock Foreground="White" Text="Steve"
Width="{Binding ElementName=expOneDay, Path=ActualWidth}"
HorizontalAlignment="Stretch" />
</Border>
</Expander.Header>
</Expander>
Muad'Dib
2009-05-20 14:33:28
Good answer, but i tried that allready, it doesn't help, it seems that the header becomes bigger than expander
ArsenMkrt
2009-05-21 11:07:29
funny, worked fine for me--should be exactly the same width. you could make a converter that takes the width and subtracts some amount from it, returning the result.
Muad'Dib
2009-05-21 14:21:44