I have a split button which has a dropdown that contains an ItemsControl that contains menu items, when a menu item is selected it calls a handler, the first thing I do is to attempt to close the dropdown using the following code.
The following is an example of the XAML.
Any help would be greatly appreciated.
//*eggbox
private void OnClickOne(object sender, RoutedEventArgs e) {
MyButton.IsOpen = false;
...
// Do the work.
...
}
The dropdown does not disappear, I checked the value of IsOpen when it enters the handler and it is already set to false. The dropdown only seems to disappear if something else gains focus. Am I missing a style or setting somewhere? I was using an older version of the library but I downloaded 2.9.0 and it exhibits the same behaviour.The following is an example of the XAML.
<xctk:SplitButtonx:Name="MyButton"Grid.Row="1"Grid.Column="1"Click="OnAdd"Content="AddThing"><xctk:SplitButton.DropDownContent><ItemsControlHorizontalAlignment="Left"><ItemsControl.Resources><StyleTargetType="MenuItem"><SetterProperty="StaysOpenOnClick"Value="False"/></Style></ItemsControl.Resources><MenuItemClick="OnClickOne"Header="AddThing"/><MenuItemClick="OnClickTwo"Header="AddOtherThing"/></ItemsControl></xctk:SplitButton.DropDownContent></xctk:SplitButton>
//*eggbox