public MainWindow() { InitializeComponent(); VertexTool.Background = new SolidColorBrush(Colors.LightSlateGray); vm = new ViewModel(); DataContext = vm; edgeStart = false; GraphCanvas.Cursor = Cursors.Pen; ZoomBox.CenterContent(); Closing += MainWindow_Closing; }