I write client under WPF. The bottom line is this: on the left, the tabs panel on the right is the Grid which changes when the tabs change, when I click, I see two ways to change:
- Using TabControl. But then the whole application will essentially be in one .xaml / .cs file. I do not want to have everything in one file
2.Using
int index = ListViewMenu.SelectedIndex;
MoveCursorMenu(index);
switch (index)
{
case 0:
GridPrincipal.Children.Clear();
GridPrincipal.Children.Add(new UserControlHome());
break;
case 1:
Each tab has an id; when clicked, the display field changes to the right. That is, the current one is deleted and the window that is in another file is loaded. That is, for each tab its own file. It is very convenient for me, but the fact is that these windows, which will be loaded, I ask hard through the Height Width. On the main tabbed page I use Margin
<Grid Margin="250 55 0 0">
<Grid x:Name="GridPrincipal" HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Grid>
It turns out that when you change the scale of the window to keep the proportions will not work when using 2 options. How to fix it?
+UPDATE:
I have(e.g.)
if I want to stretch the window, the nested element is not stretched
Stretching MainWindow with embeded UserControl
How to fix it?