Binding a height value of a panel for WindowChrome CaptionHeight in XAML
I am trying to create data binding for CaptionHeight with the Height value
of a panel . The panel is panel_title which represents the caption area in
my window template . It's height is set automatic by it's content so I
want the CaptionHeight of WindowChrome to be same as the Height value of
panel_title .
I tried to bind Height and ActualHeight , But its not working for me .
<WindowChrome GlassFrameThickness="0"
ResizeBorderThickness="{Binding
Converter={StaticResource thickness},
Mode=OneWay, Source={StaticResource
shadow_size}}"
CaptionHeight="{Binding ActualHeight,
ElementName=panel_title}"
CornerRadius="0" />
Here is my panel_title :
<StackPanel x:Name="panel_title"
Margin="0"
Orientation="Horizontal"
FlowDirection="LeftToRight">
<TextBlock x:Name="text_title"
TextWrapping="Wrap"
Text="Window Title"
FontSize="{DynamicResource
font_size_title}"
VerticalAlignment="Stretch"
FontFamily="{DynamicResource
font_familiy}" />
</StackPanel>
No comments:
Post a Comment