public ThemeEditorViewModel(Theme currentTheme)
 {
     this.quantumColor = currentTheme.QuantumColorPick;
     this.radiusFactor = currentTheme.RadiusFactor;
     this.colors = new ObservableCollection<ColorEditorViewModel>();
     foreach (var color in currentTheme.ColorsSrc)
     {
         var colorEditor = new ColorEditorViewModel(color);
         colorEditor.OnDown += this.OnDownHandler;
         colorEditor.OnUp += this.OnUpHandler;
         colorEditor.OnDelete += this.OnDeleteHandler;
         this.colors.Add(colorEditor);
     }
     this.ResetColorEditorsProperties();
     this.styles = currentTheme.Styles;
     this.commands = new ThemeEditorCommands();
     this.commands.OnOk += this.OkHandler;
     this.commands.OnSave += this.SaveHandler;
     this.commands.OnCancel += this.CancelHandler;
 }
 private void OnUpHandler(ColorEditorViewModel sender)
 {
     var index = this.colors.IndexOf(sender);
     if(index.Between(0, this.colors.Count, false))
     {
         this.colors.Move(index, index - 1);
     }
     this.ResetColorEditorsProperties();
 }
 private void OnDeleteHandler(ColorEditorViewModel sender)
 {
     if (this.colors.Count > 2)
     {
         this.colors.Remove(sender);
     }
     this.ResetColorEditorsProperties();
 }