|
@@ -52,6 +52,7 @@ namespace PixiEditor.ViewModels
|
|
public RelayCommand DeletePixelsCommand { get; set; }
|
|
public RelayCommand DeletePixelsCommand { get; set; }
|
|
public RelayCommand OpenResizePopupCommand { get; set; }
|
|
public RelayCommand OpenResizePopupCommand { get; set; }
|
|
public RelayCommand SelectColorCommand { get; set; }
|
|
public RelayCommand SelectColorCommand { get; set; }
|
|
|
|
+ public RelayCommand RemoveSwatchCommand { get; set; }
|
|
|
|
|
|
|
|
|
|
private double _mouseXonCanvas;
|
|
private double _mouseXonCanvas;
|
|
@@ -202,6 +203,7 @@ namespace PixiEditor.ViewModels
|
|
DeletePixelsCommand = new RelayCommand(DeletePixels, SelectionIsNotEmpty);
|
|
DeletePixelsCommand = new RelayCommand(DeletePixels, SelectionIsNotEmpty);
|
|
OpenResizePopupCommand = new RelayCommand(OpenResizePopup, DocumentIsNotNull);
|
|
OpenResizePopupCommand = new RelayCommand(OpenResizePopup, DocumentIsNotNull);
|
|
SelectColorCommand = new RelayCommand(SelectColor);
|
|
SelectColorCommand = new RelayCommand(SelectColor);
|
|
|
|
+ RemoveSwatchCommand = new RelayCommand(RemoveSwatch);
|
|
ToolSet = new ObservableCollection<Tool> {new MoveTool(), new PenTool(), new SelectTool(), new FloodFill(), new LineTool(),
|
|
ToolSet = new ObservableCollection<Tool> {new MoveTool(), new PenTool(), new SelectTool(), new FloodFill(), new LineTool(),
|
|
new CircleTool(), new RectangleTool(), new EarserTool(), new ColorPickerTool(), new BrightnessTool()};
|
|
new CircleTool(), new RectangleTool(), new EarserTool(), new ColorPickerTool(), new BrightnessTool()};
|
|
ShortcutController = new ShortcutController
|
|
ShortcutController = new ShortcutController
|
|
@@ -242,6 +244,19 @@ namespace PixiEditor.ViewModels
|
|
Current = this;
|
|
Current = this;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ private void RemoveSwatch(object parameter)
|
|
|
|
+ {
|
|
|
|
+ if (!(parameter is Color))
|
|
|
|
+ {
|
|
|
|
+ throw new ArgumentException();
|
|
|
|
+ }
|
|
|
|
+ Color color = (Color)parameter;
|
|
|
|
+ if (Swatches.Contains(color))
|
|
|
|
+ {
|
|
|
|
+ Swatches.Remove(color);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
private void SelectColor(object parameter)
|
|
private void SelectColor(object parameter)
|
|
{
|
|
{
|
|
if(!(parameter is Color))
|
|
if(!(parameter is Color))
|