private MultiColorPickerWindow CreateNewWindow()
 {
     var wnd = new MultiColorPickerWindow();
     wnd.Title = this.GetColorPickerTitle();
     wnd.SelectedColor = Colors.ToRGB(this.SelectedColor);
     wnd.Closing += OnColorPickerWindowClosing;
     wnd.PropertyChanged += OnColorPickerColorChanged;
     return wnd;
 }
 private void OpenAdvancedWindow(object sender, RoutedEventArgs e)
 {
     lock (this)
     {
         if (this.colorPickerWindow == null)
         {
             this.colorPickerWindow = this.CreateNewWindow();
             this.colorPickerWindow.Show();
         }
         else
         {
             this.colorPickerWindow.Activate();
         }
     }
 }
 private void OnColorPickerWindowClosing(object sender, System.ComponentModel.CancelEventArgs e)
 {
     lock (this)
     {
         this.colorPickerWindow = null;
     }
 }