diff --git a/.gitignore b/.gitignore index 42c130db..43384808 100644 --- a/.gitignore +++ b/.gitignore @@ -6,11 +6,11 @@ packages/ build/* !build/build.cake -!build/build*.nuspec !build/build.Lang.template !build/create_lang_nuspec_file.py !build/create_nupkg_file.ps1 !build/build.ps1 +!build/version-bump-up-manual.md !build/LICENSE !build/icon.png !build/tools/ diff --git a/build/build-for-myget.nuspec b/build/build-for-myget.nuspec index 95cf65c2..131ca143 100644 --- a/build/build-for-myget.nuspec +++ b/build/build-for-myget.nuspec @@ -2,7 +2,7 @@ HandyControls - 3.3.4 + 3.5.2 Mahdi Hosseini Mahdi Hosseini HandyOrg diff --git a/build/build.Lang.ca-ES.nuspec b/build/build.Lang.ca-ES.nuspec deleted file mode 100644 index d0936ffe..00000000 --- a/build/build.Lang.ca-ES.nuspec +++ /dev/null @@ -1,61 +0,0 @@ - - - - HandyControl.Lang.ca-ES - 3.5.0 - HandyOrg - HandyOrg - HandyOrg - true - LICENSE - icon.png - https://github.com/HandyOrg/HandyControl - Contains some simple and commonly used WPF controls - Changes are detailed at https://github.com/HandyOrg/HandyControl/releases - Copyright © HandyOrg 2018-2024 - WPF C# Control - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/build/build.Lang.cs.nuspec b/build/build.Lang.cs.nuspec deleted file mode 100644 index 431aee9b..00000000 --- a/build/build.Lang.cs.nuspec +++ /dev/null @@ -1,61 +0,0 @@ - - - - HandyControl.Lang.cs - 3.5.0 - HandyOrg - HandyOrg - HandyOrg - true - LICENSE - icon.png - https://github.com/HandyOrg/HandyControl - Contains some simple and commonly used WPF controls - Changes are detailed at https://github.com/HandyOrg/HandyControl/releases - Copyright © HandyOrg 2018-2024 - WPF C# Control - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/build/build.Lang.en.nuspec b/build/build.Lang.en.nuspec deleted file mode 100644 index a6755b50..00000000 --- a/build/build.Lang.en.nuspec +++ /dev/null @@ -1,61 +0,0 @@ - - - - HandyControl.Lang.en - 3.5.0 - HandyOrg - HandyOrg - HandyOrg - true - LICENSE - icon.png - https://github.com/HandyOrg/HandyControl - Contains some simple and commonly used WPF controls - Changes are detailed at https://github.com/HandyOrg/HandyControl/releases - Copyright © HandyOrg 2018-2024 - WPF C# Control - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/build/build.Lang.es.nuspec b/build/build.Lang.es.nuspec deleted file mode 100644 index 5cd6cba4..00000000 --- a/build/build.Lang.es.nuspec +++ /dev/null @@ -1,61 +0,0 @@ - - - - HandyControl.Lang.es - 3.5.0 - HandyOrg - HandyOrg - HandyOrg - true - LICENSE - icon.png - https://github.com/HandyOrg/HandyControl - Contains some simple and commonly used WPF controls - Changes are detailed at https://github.com/HandyOrg/HandyControl/releases - Copyright © HandyOrg 2018-2024 - WPF C# Control - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/build/build.Lang.fa.nuspec b/build/build.Lang.fa.nuspec deleted file mode 100644 index 5165e6bf..00000000 --- a/build/build.Lang.fa.nuspec +++ /dev/null @@ -1,61 +0,0 @@ - - - - HandyControl.Lang.fa - 3.5.0 - HandyOrg - HandyOrg - HandyOrg - true - LICENSE - icon.png - https://github.com/HandyOrg/HandyControl - Contains some simple and commonly used WPF controls - Changes are detailed at https://github.com/HandyOrg/HandyControl/releases - Copyright © HandyOrg 2018-2024 - WPF C# Control - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/build/build.Lang.fr.nuspec b/build/build.Lang.fr.nuspec deleted file mode 100644 index 3ba6fcbd..00000000 --- a/build/build.Lang.fr.nuspec +++ /dev/null @@ -1,61 +0,0 @@ - - - - HandyControl.Lang.fr - 3.5.0 - HandyOrg - HandyOrg - HandyOrg - true - LICENSE - icon.png - https://github.com/HandyOrg/HandyControl - Contains some simple and commonly used WPF controls - Changes are detailed at https://github.com/HandyOrg/HandyControl/releases - Copyright © HandyOrg 2018-2024 - WPF C# Control - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/build/build.Lang.ja.nuspec b/build/build.Lang.ja.nuspec deleted file mode 100644 index 6e22161e..00000000 --- a/build/build.Lang.ja.nuspec +++ /dev/null @@ -1,61 +0,0 @@ - - - - HandyControl.Lang.ja - 3.5.0 - HandyOrg - HandyOrg - HandyOrg - true - LICENSE - icon.png - https://github.com/HandyOrg/HandyControl - Contains some simple and commonly used WPF controls - Changes are detailed at https://github.com/HandyOrg/HandyControl/releases - Copyright © HandyOrg 2018-2024 - WPF C# Control - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/build/build.Lang.ko-KR.nuspec b/build/build.Lang.ko-KR.nuspec deleted file mode 100644 index 37fdd8de..00000000 --- a/build/build.Lang.ko-KR.nuspec +++ /dev/null @@ -1,61 +0,0 @@ - - - - HandyControl.Lang.ko-KR - 3.5.0 - HandyOrg - HandyOrg - HandyOrg - true - LICENSE - icon.png - https://github.com/HandyOrg/HandyControl - Contains some simple and commonly used WPF controls - Changes are detailed at https://github.com/HandyOrg/HandyControl/releases - Copyright © HandyOrg 2018-2024 - WPF C# Control - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/build/build.Lang.pl.nuspec b/build/build.Lang.pl.nuspec deleted file mode 100644 index 17c9e14b..00000000 --- a/build/build.Lang.pl.nuspec +++ /dev/null @@ -1,61 +0,0 @@ - - - - HandyControl.Lang.pl - 3.5.0 - HandyOrg - HandyOrg - HandyOrg - true - LICENSE - icon.png - https://github.com/HandyOrg/HandyControl - Contains some simple and commonly used WPF controls - Changes are detailed at https://github.com/HandyOrg/HandyControl/releases - Copyright © HandyOrg 2018-2024 - WPF C# Control - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/build/build.Lang.pt-BR.nuspec b/build/build.Lang.pt-BR.nuspec deleted file mode 100644 index b1153d78..00000000 --- a/build/build.Lang.pt-BR.nuspec +++ /dev/null @@ -1,61 +0,0 @@ - - - - HandyControl.Lang.pt-BR - 3.5.0 - HandyOrg - HandyOrg - HandyOrg - true - LICENSE - icon.png - https://github.com/HandyOrg/HandyControl - Contains some simple and commonly used WPF controls - Changes are detailed at https://github.com/HandyOrg/HandyControl/releases - Copyright © HandyOrg 2018-2024 - WPF C# Control - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/build/build.Lang.ru.nuspec b/build/build.Lang.ru.nuspec deleted file mode 100644 index 5169a90a..00000000 --- a/build/build.Lang.ru.nuspec +++ /dev/null @@ -1,61 +0,0 @@ - - - - HandyControl.Lang.ru - 3.5.0 - HandyOrg - HandyOrg - HandyOrg - true - LICENSE - icon.png - https://github.com/HandyOrg/HandyControl - Contains some simple and commonly used WPF controls - Changes are detailed at https://github.com/HandyOrg/HandyControl/releases - Copyright © HandyOrg 2018-2024 - WPF C# Control - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/build/build.Lang.template b/build/build.Lang.template index 4863ba70..c1c067bd 100644 --- a/build/build.Lang.template +++ b/build/build.Lang.template @@ -2,7 +2,7 @@ HandyControl.Lang.{lang} - 3.5.0 + 3.5.2 HandyOrg HandyOrg HandyOrg @@ -14,7 +14,7 @@ Changes are detailed at https://github.com/HandyOrg/HandyControl/releases Copyright © HandyOrg 2018-2024 WPF C# Control - + diff --git a/build/build.Lang.tr.nuspec b/build/build.Lang.tr.nuspec deleted file mode 100644 index e22868cd..00000000 --- a/build/build.Lang.tr.nuspec +++ /dev/null @@ -1,61 +0,0 @@ - - - - HandyControl.Lang.tr - 3.5.0 - HandyOrg - HandyOrg - HandyOrg - true - LICENSE - icon.png - https://github.com/HandyOrg/HandyControl - Contains some simple and commonly used WPF controls - Changes are detailed at https://github.com/HandyOrg/HandyControl/releases - Copyright © HandyOrg 2018-2024 - WPF C# Control - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/build/build.nuspec b/build/build.nuspec index 153a7d24..4df3cfa2 100644 --- a/build/build.nuspec +++ b/build/build.nuspec @@ -2,7 +2,7 @@ HandyControl - 3.5.0 + 3.5.2 HandyOrg HandyOrg HandyOrg @@ -14,7 +14,7 @@ Changes are detailed at https://github.com/HandyOrg/HandyControl/releases Copyright © HandyOrg 2018-2024 WPF C# Control - + diff --git a/build/version-bump-up-manual.md b/build/version-bump-up-manual.md new file mode 100644 index 00000000..b699e84d --- /dev/null +++ b/build/version-bump-up-manual.md @@ -0,0 +1,11 @@ +- modify copyright of LICENSE +- modify copyright of build/LICENSE +- modify version and copyright of src/Directory.Build.Props +- modify version, copyright and repository of build/build.nuspec +- modify version, copyright and repository of build/build.Lang.template +- modify version and copyright of build/build-for-myget.nuspec +- run build/build.ps1 +- run create_lang_nuspec_file.py +- run create_nupkg_file.ps1 +- upload nupkg and snupkg to nuget +- draft and publish a new release on github. diff --git a/src/Directory.Build.Props b/src/Directory.Build.Props index 73ba8c3b..f7b5575c 100644 --- a/src/Directory.Build.Props +++ b/src/Directory.Build.Props @@ -1,9 +1,9 @@  true - 3.5.0.0 - 3.5.0.0 - 3.5.0.0 + 3.5.2.0 + 3.5.2.0 + 3.5.2.0 latest Copyright © HandyOrg 2018-2024 HandyOrg diff --git a/src/Net_40/HandyControl_Net_40/Themes/Styles/ListView.xaml b/src/Net_40/HandyControl_Net_40/Themes/Styles/ListView.xaml index bfd3001b..40e57052 100644 --- a/src/Net_40/HandyControl_Net_40/Themes/Styles/ListView.xaml +++ b/src/Net_40/HandyControl_Net_40/Themes/Styles/ListView.xaml @@ -52,7 +52,7 @@ - + @@ -75,6 +75,9 @@ + + + @@ -85,7 +88,7 @@ - + diff --git a/src/Shared/HandyControl_Shared/Controls/Attach/ComboBoxAttach.cs b/src/Shared/HandyControl_Shared/Controls/Attach/ComboBoxAttach.cs new file mode 100644 index 00000000..b71aa6ed --- /dev/null +++ b/src/Shared/HandyControl_Shared/Controls/Attach/ComboBoxAttach.cs @@ -0,0 +1,45 @@ +using System.Windows; +using HandyControl.Data; + +namespace HandyControl.Controls; + +public class ComboBoxAttach +{ + public static readonly DependencyProperty IsMouseWheelEnabledProperty = DependencyProperty.RegisterAttached( + "IsMouseWheelEnabled", typeof(bool), typeof(ComboBoxAttach), new PropertyMetadata(ValueBoxes.TrueBox, OnIsMouseWheelEnabledChanged)); + + private static void OnIsMouseWheelEnabledChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) + { + if (d is not System.Windows.Controls.ComboBox comboBox) + { + return; + } + + if (!(bool) e.NewValue) + { + comboBox.PreviewMouseWheel += OnComboBoxPreviewMouseWheel; + } + else + { + comboBox.PreviewMouseWheel -= OnComboBoxPreviewMouseWheel; + } + + return; + + static void OnComboBoxPreviewMouseWheel(object sender, System.Windows.Input.MouseWheelEventArgs args) + { + if (sender is System.Windows.Controls.ComboBox { IsDropDownOpen: true }) + { + return; + } + + args.Handled = true; + } + } + + public static void SetIsMouseWheelEnabled(DependencyObject element, bool value) + => element.SetValue(IsMouseWheelEnabledProperty, ValueBoxes.BooleanBox(value)); + + public static bool GetIsMouseWheelEnabled(DependencyObject element) + => (bool) element.GetValue(IsMouseWheelEnabledProperty); +} diff --git a/src/Shared/HandyControl_Shared/Controls/ColorPicker/ColorDropper.cs b/src/Shared/HandyControl_Shared/Controls/ColorPicker/ColorDropper.cs index b6aa8fe1..694dcf10 100644 --- a/src/Shared/HandyControl_Shared/Controls/ColorPicker/ColorDropper.cs +++ b/src/Shared/HandyControl_Shared/Controls/ColorPicker/ColorDropper.cs @@ -81,7 +81,7 @@ public void Update(bool isShow) } else { - Mouse.OverrideCursor = Cursors.Arrow; + Mouse.OverrideCursor = null; MouseHook.Stop(); MouseHook.StatusChanged -= MouseHook_StatusChanged; ColorPicker.IsCheckedToggleButtonDropper(false); @@ -137,7 +137,7 @@ private void UpdateCursor(bool isDropper) { if (_cursorIsSetted) { - Mouse.OverrideCursor = Cursors.Arrow; + Mouse.OverrideCursor = null; _cursorIsSetted = false; } } diff --git a/src/Shared/HandyControl_Shared/Controls/Image/ImageViewer.cs b/src/Shared/HandyControl_Shared/Controls/Image/ImageViewer.cs index 9ae80e84..8865004d 100644 --- a/src/Shared/HandyControl_Shared/Controls/Image/ImageViewer.cs +++ b/src/Shared/HandyControl_Shared/Controls/Image/ImageViewer.cs @@ -962,11 +962,10 @@ private static void OnUriChanged(DependencyObject d, DependencyPropertyChangedEv private void OnUriChanged(Uri newValue) { - if (newValue is not null) + ImageSource = newValue is not null ? GetBitmapFrame(newValue) : null; + if (ImageSource is not null && newValue.IsAbsoluteUri) { - ImageSource = GetBitmapFrame(newValue); ImgPath = newValue.AbsolutePath; - if (File.Exists(ImgPath)) { ImgSize = new FileInfo(ImgPath).Length; @@ -974,8 +973,8 @@ private void OnUriChanged(Uri newValue) } else { - ImageSource = null; ImgPath = string.Empty; + ImgSize = 0; } static BitmapFrame GetBitmapFrame(Uri source) diff --git a/src/Shared/HandyControl_Shared/Controls/Panel/Grid/Row.cs b/src/Shared/HandyControl_Shared/Controls/Panel/Grid/Row.cs index 239b95d1..3b4bd3ce 100644 --- a/src/Shared/HandyControl_Shared/Controls/Panel/Grid/Row.cs +++ b/src/Shared/HandyControl_Shared/Controls/Panel/Grid/Row.cs @@ -59,7 +59,9 @@ protected override Size MeasureOverride(Size constraint) if (cellCount > 0 && !child.IsFixed) { totalCellCount += cellCount; - child.Measure(new Size(cellCount * itemWidth - gutter, constraint.Height)); + var availableWidth = Math.Max(0, cellCount * itemWidth - gutter); + + child.Measure(new Size(availableWidth, constraint.Height)); _maxChildDesiredHeight = Math.Max(_maxChildDesiredHeight, child.DesiredSize.Height); if (totalCellCount > ColLayout.ColMaxCellCount) @@ -94,7 +96,7 @@ protected override Size ArrangeOverride(Size finalSize) var cellCount = child.GetLayoutCellCount(_layoutStatus); totalCellCount += cellCount; - var childWidth = (cellCount > 0 && !child.IsFixed) ? cellCount * itemWidth - gutter : child.DesiredSize.Width; + var childWidth = (cellCount > 0 && !child.IsFixed) ? Math.Max(0, cellCount * itemWidth - gutter) : child.DesiredSize.Width; childBounds.Width = childWidth; childBounds.X += child.Offset * itemWidth; diff --git a/src/Shared/HandyControl_Shared/HandyControl_Shared.projitems b/src/Shared/HandyControl_Shared/HandyControl_Shared.projitems index fec7edbf..284f3728 100644 --- a/src/Shared/HandyControl_Shared/HandyControl_Shared.projitems +++ b/src/Shared/HandyControl_Shared/HandyControl_Shared.projitems @@ -15,6 +15,7 @@ + diff --git a/src/Shared/HandyControl_Shared/Input/SimpleMouseBinding.cs b/src/Shared/HandyControl_Shared/Input/SimpleMouseBinding.cs index 027ce8bd..73deead4 100644 --- a/src/Shared/HandyControl_Shared/Input/SimpleMouseBinding.cs +++ b/src/Shared/HandyControl_Shared/Input/SimpleMouseBinding.cs @@ -8,7 +8,7 @@ namespace HandyControl.Input; internal sealed class SimpleMouseBinding : InputBinding { public static readonly DependencyProperty MouseActionProperty = DependencyProperty.Register(nameof(MouseAction), - typeof(MouseAction), typeof(MouseBinding), new UIPropertyMetadata(MouseAction.None, OnMouseActionPropertyChanged)); + typeof(MouseAction), typeof(SimpleMouseBinding), new UIPropertyMetadata(MouseAction.None, OnMouseActionPropertyChanged)); private bool _settingGesture; diff --git a/src/Shared/HandyControl_Shared/Themes/Styles/ListView.xaml b/src/Shared/HandyControl_Shared/Themes/Styles/ListView.xaml index c664119c..53714cca 100644 --- a/src/Shared/HandyControl_Shared/Themes/Styles/ListView.xaml +++ b/src/Shared/HandyControl_Shared/Themes/Styles/ListView.xaml @@ -52,7 +52,7 @@ - + @@ -75,6 +75,9 @@ + + + @@ -92,7 +95,7 @@ - +