From 811916a8b95d8c3b2a57231903063f0d62affa44 Mon Sep 17 00:00:00 2001 From: Lorenz Stechauner Date: Thu, 11 Dec 2025 12:49:14 +0100 Subject: [PATCH] Controls/CheckComboBox: Apply AllItemsSelectedContent only when more than 1 items are selected --- Elwig/Controls/CheckComboBox.cs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/Elwig/Controls/CheckComboBox.cs b/Elwig/Controls/CheckComboBox.cs index e108505..0d4c2d6 100644 --- a/Elwig/Controls/CheckComboBox.cs +++ b/Elwig/Controls/CheckComboBox.cs @@ -124,19 +124,24 @@ namespace Elwig.Controls { SelectItemsReverse(); var dmp = !string.IsNullOrEmpty(ListDisplayMemberPath) ? ListDisplayMemberPath : !string.IsNullOrEmpty(DisplayMemberPath) ? DisplayMemberPath : null; if (SelectedItems.Count == ItemsSource.Cast().Count() && AllItemsSelectedContent != null) { - _textBox.Text = AllItemsSelectedContent; AllItemsSelected = true; } else if (SelectedItems.Count == 0) { - _textBox.Text = ""; AllItemsSelected = false; + } else { + AllItemsSelected = null; + } + if (SelectedItems.Count > 1 && SelectedItems.Count == ItemsSource.Cast().Count() && AllItemsSelectedContent != null) { + _textBox.Text = AllItemsSelectedContent; + } else if (SelectedItems.Count == 0) { + _textBox.Text = ""; } else { _textBox.Text = string.Join(Delimiter, dmp == null ? SelectedItems.Cast() : SelectedItems.Cast() .Select(i => i.GetType().GetProperty(dmp)?.GetValue(i)) ); - AllItemsSelected = null; } + RaiseEvent(new SelectionChangedEventArgs(SelectionChangedEvent, evt.RemovedItems, evt.AddedItems)); }