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
HeaderedContentControlis a control that displays other controls, but also provides a header for that (like aGroupBoxor window title).The
HeaderedContentControlis bound to a set of data– in this case “CurrentWorkspace”.The
ContentTemplatedescribes 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
WorkspaceTemplateyou should eventually see where it is defined.