C# WPF:如何处理多XAML UI?

C# WPF:如何处理多XAML UI?,c#,wpf,xaml,datagrid,C#,Wpf,Xaml,Datagrid,我不知道你们的情况,但我患有严重的深度压痕过敏。我几乎无法管理所有缩进的XAML块 我当前的应用程序是基于一个大型DataGrid的,它具有各种各样的奇特功能(还有更多功能),但我想在屏幕顶部添加几个选项卡,以便有一个额外的、第二个非常类似的DataGrid 我想按以下方式实施: <Tab> <Tab Selection 1> <DataGrid 1 in some other XAML file> </Tab Selec

我不知道你们的情况,但我患有严重的深度压痕过敏。我几乎无法管理所有缩进的XAML块

我当前的应用程序是基于一个大型DataGrid的,它具有各种各样的奇特功能(还有更多功能),但我想在屏幕顶部添加几个选项卡,以便有一个额外的、第二个非常类似的DataGrid

我想按以下方式实施:

<Tab>
    <Tab Selection 1>
        <DataGrid 1 in some other XAML file>
    </Tab Selection 1>
    <Tab Selection 2>
        <DataGrid 2 in some other XAML file>
    </Tab Selection 2>
<Tab>

所以,我会有一个小的XAML文件,它控制2个更大的XAML文件

这应该是可行的,对吧

善良的灵魂能提供细节吗

TIA.

简单地说:

1-在解决方案资源管理器中右键单击您的项目,选择
Add
->
新项目

2-选择
WPF用户控件

<UserControl x:Class="MyApp.MyUserControl"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
   <DataGrid>
      <!-- lots of XAML ... -->
   </DataGrid>
</UserControl>

3:在
UserControl
内创建您的
DataGrid

<UserControl x:Class="MyApp.MyUserControl"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
   <DataGrid>
      <!-- lots of XAML ... -->
   </DataGrid>
</UserControl>
简单地说:

1-在解决方案资源管理器中右键单击您的项目,选择
Add
->
新项目

2-选择
WPF用户控件

<UserControl x:Class="MyApp.MyUserControl"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
   <DataGrid>
      <!-- lots of XAML ... -->
   </DataGrid>
</UserControl>

3:在
UserControl
内创建您的
DataGrid

<UserControl x:Class="MyApp.MyUserControl"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
   <DataGrid>
      <!-- lots of XAML ... -->
   </DataGrid>
</UserControl>
简单地说:

1-在解决方案资源管理器中右键单击您的项目,选择
Add
->
新项目

2-选择
WPF用户控件

<UserControl x:Class="MyApp.MyUserControl"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
   <DataGrid>
      <!-- lots of XAML ... -->
   </DataGrid>
</UserControl>

3:在
UserControl
内创建您的
DataGrid

<UserControl x:Class="MyApp.MyUserControl"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
   <DataGrid>
      <!-- lots of XAML ... -->
   </DataGrid>
</UserControl>
简单地说:

1-在解决方案资源管理器中右键单击您的项目,选择
Add
->
新项目

2-选择
WPF用户控件

<UserControl x:Class="MyApp.MyUserControl"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
   <DataGrid>
      <!-- lots of XAML ... -->
   </DataGrid>
</UserControl>

3:在
UserControl
内创建您的
DataGrid

<UserControl x:Class="MyApp.MyUserControl"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
   <DataGrid>
      <!-- lots of XAML ... -->
   </DataGrid>
</UserControl>

我希望这不是一个
XY问题我希望这不是一个
XY问题我希望这不是一个
XY问题我希望这不是一个
XY问题