Skip to content

Commit

Permalink
Update CheckComboBox.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
NaBian committed Oct 11, 2020
1 parent 86f7c30 commit 5c11cef
Showing 1 changed file with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@
using System.ComponentModel;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Controls.Primitives;
using System.Windows.Data;
using System.Windows.Input;
using System.Windows.Threading;
using HandyControl.Data;
using HandyControl.Interactivity;

Expand Down Expand Up @@ -102,6 +104,15 @@ public CheckComboBox()
{
AddHandler(Controls.Tag.ClosedEvent, new RoutedEventHandler(Tags_OnClosed));
CommandBindings.Add(new CommandBinding(ControlCommands.Clear, (s, e) => SelectedItems.Clear()));
ItemContainerGenerator.StatusChanged += ItemContainerGenerator_StatusChanged;
}

private void ItemContainerGenerator_StatusChanged(object sender, EventArgs e)
{
if (ItemContainerGenerator.Status == GeneratorStatus.ContainersGenerated)
{
UpdateTags();
}
}

public override void OnApplyTemplate()
Expand All @@ -121,6 +132,12 @@ public override void OnApplyTemplate()
_selectAllItem.Selected += SelectAllItem_Selected;
_selectAllItem.Unselected += SelectAllItem_Unselected;
}

Dispatcher.BeginInvoke(new Action(() =>
{
IsDropDownOpen = true;
IsDropDownOpen = false;
}), DispatcherPriority.DataBind);
}

public bool VerifyData()
Expand Down

0 comments on commit 5c11cef

Please sign in to comment.