I am working on WPF but the UI is localized for the Gujarati language. In my window.xaml I have 2 rows and 2 columns.
I could not get use of the HeaderedContentControl tag. The code is here:
<Border
Grid.Row="1" Grid.Column="1"
Style="{StaticResource MainBorderStyle}"
Padding="0"
BorderThickness="0,0,0,1"
Background="#f9f9f9">
<HeaderedContentControl
VerticalContentAlignment="Stretch"
Content="{Binding Path=CurrentWorkspace}"
Style="{StaticResource MainWorkspaceStyle}"
ContentTemplate="{StaticResource WorkspaceTemplate}"/>
</Border>
Please explain it and also explain role of content template.
A HeaderedContentControl
is a control that displays other controls, but also provides a header for that (like a GroupBox
or window title).
The HeaderedContentControl
is bound to a set of data-- in this case "CurrentWorkspace".
The ContentTemplate
describes how that data should be displayed. In this particular case, it is something called "WorkspaceTemplate", which will be defined as a Static Resource somewhere in the project-- either in a resource XAML file, or, perhaps in your window, under <Window.Resources>
at the top of the XAML.
No matter where it is, if you search through your entire solution for WorkspaceTemplate
you should eventually see where it is defined.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With