我正在开发 WPF,但 UI 已本地化为古吉拉特语。在我的 window.xaml 中,我有 2 行和 2 列。
我无法使用 HeaderedContentControl 标签。代码在这里:
<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>
请解释一下,并解释一下内容模板的作用。
A HeaderedContentControl
是一个显示其他控件的控件,但也为其提供标题(如GroupBox
或窗口标题)。
The HeaderedContentControl
绑定到一组数据——在本例中为“CurrentWorkspace”。
The ContentTemplate
描述了如何显示该数据。在这种特殊情况下,它是一个名为“WorkspaceTemplate”的东西,它将被定义为项目中某处的静态资源——要么在资源 XAML 文件中,要么在您的窗口中,在<Window.Resources>
在 XAML 的顶部。
无论它在哪里,如果您在整个解决方案中搜索WorkspaceTemplate
您最终应该看到它的定义位置。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)