diff --git a/ColorPicker.nuspec b/ColorPicker.nuspec index 01b583a..7227728 100644 --- a/ColorPicker.nuspec +++ b/ColorPicker.nuspec @@ -2,15 +2,15 @@ ColorPicker - 1.1.0 + 1.1.1 Martin Chrzan Martin Chrzan https://github.com/martinchrzan/ColorPicker/blob/master/LICENSE http://github.com/martinchrzan/ColorPicker - Added Colors History Palette activated by right mouse click when color picker is open - Pressing Esc closes Zoom window or Colors History Palette if opened + Color Picker adapts to the current Windows theme + Fixed colors in Settings window when using light theme false Color Picker diff --git a/ColorPicker/Controls/CircularMenu.cs b/ColorPicker/Controls/CircularMenu.cs index 568f443..d88e0da 100644 --- a/ColorPicker/Controls/CircularMenu.cs +++ b/ColorPicker/Controls/CircularMenu.cs @@ -56,18 +56,23 @@ public override void BeginInit() private void Items_CollectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e) { - if (e.Action == System.Collections.Specialized.NotifyCollectionChangedAction.Add) + var newItem = e.NewItems[0] as CircularMenuItem; + if(newItem != null) { - (e.NewItems[0] as CircularMenuItem).MouseEnter += CircularMenuItem_MouseEnter; - (e.NewItems[0] as CircularMenuItem).PreviewMouseDown += CircularMenuItem_MouseDown; - (e.NewItems[0] as CircularMenuItem).MouseLeave += CircularMenuItem_MouseLeave; - } - else if (e.Action == System.Collections.Specialized.NotifyCollectionChangedAction.Remove) - { - (e.NewItems[0] as CircularMenuItem).MouseEnter -= CircularMenuItem_MouseEnter; - (e.NewItems[0] as CircularMenuItem).MouseLeave -= CircularMenuItem_MouseLeave; - (e.NewItems[0] as CircularMenuItem).PreviewMouseDown -= CircularMenuItem_MouseDown; + if (e.Action == System.Collections.Specialized.NotifyCollectionChangedAction.Add) + { + newItem.MouseEnter += CircularMenuItem_MouseEnter; + newItem.PreviewMouseDown += CircularMenuItem_MouseDown; + newItem.MouseLeave += CircularMenuItem_MouseLeave; + } + else if (e.Action == System.Collections.Specialized.NotifyCollectionChangedAction.Remove) + { + newItem.MouseEnter -= CircularMenuItem_MouseEnter; + newItem.MouseLeave -= CircularMenuItem_MouseLeave; + newItem.PreviewMouseDown -= CircularMenuItem_MouseDown; + } } + if(Items?.Count > 0) { CentralItem.ContentText = string.Empty; diff --git a/ColorPicker/Properties/AssemblyInfo.cs b/ColorPicker/Properties/AssemblyInfo.cs index e5f4d7d..b28b6ce 100644 --- a/ColorPicker/Properties/AssemblyInfo.cs +++ b/ColorPicker/Properties/AssemblyInfo.cs @@ -50,6 +50,6 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.1.0.0")] -[assembly: AssemblyFileVersion("1.1.0.0")] +[assembly: AssemblyVersion("1.1.1.0")] +[assembly: AssemblyFileVersion("1.1.1.0")] [assembly: AssemblyMetadata("SquirrelAwareVersion", "1")] \ No newline at end of file