Slight modification to Editor.xaml.cs