I'm developing WPF app. The problem is:
I have TabControl
Inside of each TabControl I have DataGridView
I need to print content of each DataGridView from TabControl in one document
I can't use lists from ViewModels because I need to take under consideration if columns of DataGridView are visible or not
I'm able to print one particular DataGrid
How to iterate over TabControl to get access to DataGridViews? Thank you for your help!
Part of view with tab control:
<UserControl>
<UserControl.Resources>
<DataTemplate DataType="{x:Type local:EmployeeAuthorizationListViewModel}">
<views:EmployeeAuthorizationsListView/>
</DataTemplate>
<DataTemplate DataType="{x:Type local:EmployeeTrainingListViewModel}">
<views:EmployeeTraningsListView/>
</DataTemplate>
<DataTemplate DataType="{x:Type local:EmployeeMachineListViewModel}">
<views:EmployeeMachineListView/>
</DataTemplate>
<DataTemplate DataType="{x:Type local:EmployeeInspectionListViewModel}">
<views:EmployeeInspectionListView/>
</DataTemplate>
</UserControl.Resources>
<Grid>
<TabControl Grid.Column="1" ItemsSource="{Binding Tabs}" SelectedItem="{Binding ActiveTab}">
<TabControl.ItemTemplate>
<DataTemplate>
<HeaderedContentControl Header="{Binding ViewTitle}" />
</DataTemplate>
</TabControl.ItemTemplate>
</TabControl>
</Grid>
</UserControl>