void MainWindow_Loaded(object sender, RoutedEventArgs e) { /* Create a graph viewer */ GViewer graphViewer = new GViewer(); graphViewer.BindToPanel(this.Graph_DockPanel); /* Create a graph */ Graph graph = new Graph(); graph.AddEdge("a", "b"); /* Connect graph to graphviewer */ graphViewer.Graph = graph; }