private void MainWindow_Loaded(object sender, RoutedEventArgs e) { ViewModel = new AutomatonViewModel(); this.DataContext = ViewModel; graphViewer = new GraphViewer(); graphViewer.BindToPanel(graphViewPanel); }