Hi,
1) Try adding a click event to your menuItems and tell the splitButton to close :
1) Try adding a click event to your menuItems and tell the splitButton to close :
<xctk:SplitButton x:Name="_splitButton"
Content="Click Me"
<xctk:SplitButton.DropDownContent>
<Menu>
<MenuItem Header="First"
Click="MenuItem_Click"/>
<MenuItem Header="Second"
Click="MenuItem_Click" />
<MenuItem Header="Third option for this menu"
Click="MenuItem_Click" />
</Menu>
</xctk:SplitButton.DropDownContent>
</xctk:SplitButton>
private void MenuItem_Click( object sender, RoutedEventArgs e )
{
_splitButton.IsOpen = false;
}
2) I don't know with what object you want to bind the menuItems, but, here's an example if you have a CheckBox:<StackPanel
<CheckBox x:Name="_checkBox" IsChecked="True"/>
<xctk:SplitButton x:Name="_splitButton"
Content="Click Me"
<xctk:SplitButton.DropDownContent>
<Menu>
<MenuItem Header="First"
Click="MenuItem_Click" />
<MenuItem Header="Second"
Click="MenuItem_Click"
IsChecked="{Binding Source={x:Reference _checkBox}, Path=IsChecked}" />
</Menu>
</xctk:SplitButton.DropDownContent>
</xctk:SplitButton>
</StackPanel>
Or you can set the DataContext, of the splitButton with the Checkbox, as mentioned on this site : http://stackoverflow.com/questions/20522228/ischecked-binding-not-working-in-menuitem-in-a-contextmenu