Theme/Generic.xaml of my WPF Custom Control MyBaseWindow looks like this:
<Style TargetType="{x:Type MyBaseWindowPath:MyBaseWindow}">
…
<Setter Property="WindowChrome.WindowChrome">
<Setter.Value>
<WindowChrome CaptionHeight="{Binding ActualHeight, ElementName=HeaderPanel}"
GlassFrameThickness="0"
CornerRadius="0" />
</Setter.Value>
</Setter>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type MyBaseWindowPath:MyBaseWindow}">
…
<DockPanel x:Name="HeaderPanel">
…
</DockPanel>
…
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
I would like to bind ActualHeight
property of HeaderPanel element within ControlTemplate
. Is it possible?
Another solution is use fixed height for WindowChrome.CaptionHeight
and HeaderPanel.Height
, but I prefer binding to exact height.