How to start WPF program with a ContentControl already loaded?

0

I have three ContentControl that I created:

ContentControl homeContent = new Home();
ContentControl completeContent = new Complete();
ContentControl individualContent = new Individual();

I want my program to start with the content of the loaded home, so in my MainWindow I put this code:

public partial class MainWindow : Window
{
    ContentControl homeContent = new Home();
    ContentControl completeContent = new Complete();
    ContentControl individualContent = new Individual();

    public MainWindow()
    {
        InitializeComponent();
        DataContext = BaseModel.Instance;
        BaseModel.Instance.ActualContent = homeContent; 
    }

What am I doing wrong? By the way, getting access to contents through a menu that I created, I just do not know how to start with a same pattern.

    
asked by anonymous 14.05.2018 / 21:20

0 answers