public MainWindow() { WindowStartupLocation = WindowStartupLocation.CenterScreen; Main_VM = (Application.Current as App).MainVM; DataContext = Main_VM; InitializeComponent(); //Constructs all of the views' fields. SetViews(); Main_VM.Connect(); Main_VM.Start(); }
// FUNCTIONS //----------------------------------------------------------------------- // Loads the given file public void loadFile(string filePath) { contentFrame.Content = null; mainWiewModel = (filePath != null) ? new Main_VM(filePath) : new Main_VM(); DataContext = mainWiewModel; }