2017-10-16 60 views
0

在ModernUI上,我们使用“ModernTab”而不是“TabControl” 但是如何在每个选项卡内显示“”,而不是使用userControl。 我意味着我希望增加“网格”,每个标签在ModernUI上使用“Grid”而不是“UserControl” - WPF

码内对ModernUI:

<mui:ModernTab SelectedSource="/Content/ControlsStylesButton.xaml" Layout="List"> 
      <mui:ModernTab.Links> 
       <mui:Link DisplayName="Button" Source="/Content/ControlsStylesButton.xaml" /> 
       <mui:Link DisplayName="DataGrid" Source="/Content/ControlsStylesDataGrid.xaml" /> 
      </mui:ModernTab.Links> 
     </mui:ModernTab> 

我对正常WPF窗口代码:

<TabControl SelectionChanged="Selector_OnSelectionChanged"> 
<TabItem Name="tiProfileEdit" Header="profile" > 
<Grid> 
//UI of this tab instead of using usercontrol 
</Grid> 
</TabItem> 
<TabItem Name="tiDataGrid" Header="DataGrid" > 
<Grid> 
//UI of this tab instead of using usercontrol 
</Grid> 
</TabItem> 
</TabControl> 

回答

0

添加<Grid>作为根元素的UserControl

A Link不是ContentControl并且没有任何直接内容的概念。它只有一个Source属性,所以它不像内置的TabItem

相关问题