Skip to content

Commit 5c11cef

Browse files
committed
Update CheckComboBox.cs
1 parent 86f7c30 commit 5c11cef

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

src/Shared/HandyControl_Shared/Controls/Input/CheckComboBox/CheckComboBox.cs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@
22
using System.ComponentModel;
33
using System.Windows;
44
using System.Windows.Controls;
5+
using System.Windows.Controls.Primitives;
56
using System.Windows.Data;
67
using System.Windows.Input;
8+
using System.Windows.Threading;
79
using HandyControl.Data;
810
using HandyControl.Interactivity;
911

@@ -102,6 +104,15 @@ public CheckComboBox()
102104
{
103105
AddHandler(Controls.Tag.ClosedEvent, new RoutedEventHandler(Tags_OnClosed));
104106
CommandBindings.Add(new CommandBinding(ControlCommands.Clear, (s, e) => SelectedItems.Clear()));
107+
ItemContainerGenerator.StatusChanged += ItemContainerGenerator_StatusChanged;
108+
}
109+
110+
private void ItemContainerGenerator_StatusChanged(object sender, EventArgs e)
111+
{
112+
if (ItemContainerGenerator.Status == GeneratorStatus.ContainersGenerated)
113+
{
114+
UpdateTags();
115+
}
105116
}
106117

107118
public override void OnApplyTemplate()
@@ -121,6 +132,12 @@ public override void OnApplyTemplate()
121132
_selectAllItem.Selected += SelectAllItem_Selected;
122133
_selectAllItem.Unselected += SelectAllItem_Unselected;
123134
}
135+
136+
Dispatcher.BeginInvoke(new Action(() =>
137+
{
138+
IsDropDownOpen = true;
139+
IsDropDownOpen = false;
140+
}), DispatcherPriority.DataBind);
124141
}
125142

126143
public bool VerifyData()

0 commit comments

Comments
 (0)