From e5cde119eaa2bc46e845f92cf2446faef0d69f02 Mon Sep 17 00:00:00 2001 From: punker76 Date: Fri, 4 Dec 2020 23:27:54 +0100 Subject: [PATCH] (GH-3991) Fix adding colors to recent colors by AddColorToRecentColors --- .../Controls/ColorPicker/BuildInColorPalettes.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/MahApps.Metro/Controls/ColorPicker/BuildInColorPalettes.cs b/src/MahApps.Metro/Controls/ColorPicker/BuildInColorPalettes.cs index 9a81a3839e..83e4cedc8c 100644 --- a/src/MahApps.Metro/Controls/ColorPicker/BuildInColorPalettes.cs +++ b/src/MahApps.Metro/Controls/ColorPicker/BuildInColorPalettes.cs @@ -51,11 +51,11 @@ public static void AddColorToRecentColors(Color? color, IEnumerable recentColors if (recentColors is ObservableCollection collection) { var oldIndex = collection.IndexOf(color); - if (oldIndex > -1) + if (oldIndex > 0) { collection.Move(oldIndex, 0); } - else + else if (oldIndex < 0) { if (collection.Count >= maxCount) {