I don\'t know about you folks, but I suffer from a severe case of Deep Indentation Allergy. I can barely manage all those indented XAML blocks.
My current appli
Simply create a new UserControl:
1 - Right Click your Project in Solution Explorer, select Add
->
New Item
:
2 - Select WPF UserControl
:
3: Create your DataGrid
inside the UserControl
:
<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>
4: Put the UserControl
inside the TabItem
:
You will need to Import your Namespace, like so:
<Window ....
xmlns:local="clr-namespace:MyApp">
<TabControl>
<TabItem>
<local:MyUserControl/>
</TabItem>
</TabControl>
</Window>