I am using Infragistics default style for XamContextMenu.
The context menu items have checkboxes. The issue is that when a user clicks the checkbox, the check mark takes a few moments to appear. I know this is/can be controlled via the ResourceDictionary style were are using (which was taken initially from the one used by the Infragistics Samples application). But I am unable to determine what controls this behavior.
In that attached sample app, if you right-click on the menu to get the context menu to appear, when you click a menu item the check mark has a slight delay before it is rendered. How can this be made so that the check mark appears as soon as user clicks the checkbox?
Thank you for any help.
--Pat
Hello Pat,
Thank you for your post. I have been looking into it. In out samples application the IG theme is used as style for the controls. It seems, that there in those themes there is a style for the Checkbox itself, that sets the duration for the animation, when the Checkbox is checked and unchecked.
I have created a small sample for you to show you this style. In the sample application I am using the default style for the XamMenu and add the above mentioned style. The style is named ‘CheckboxStyle’ and in the setter for the Template property you can see the VisualStateGroup, that determines how fast the checkmark should appear.
Please find the attached sample application and feel free to let me know if you have any further questions on this matter.
Thank you for the answer Gergana. It works. But I have a question.
In my original attached solution (which is a modified version of the one from the Infragistics XamContextMenu Samples project), the checkbox doesn't have a Style set. So, I don't understand if the delay in a checkmark appearing is from the default checkbox you get when you don't specify a Style or if it is from something in the Sample resources I started with? In order for your solution to work I had to copy the entire Style (and the corresponding brush declarations) to my resource dictionary. There isn't a more compact way to get the checkmark to appear immediately? That is, do I have to use the entire Style you provided just to get that behavior? I like to keep code as clean as possible with only what is necessary is why I am asking.
Thanks again for your help.
Gergana,
No, we used the style as you suggested earlier in the thread.
Thank you for your help.
I am just checking if you have any further questions on this matter. Please do not hesitate to let me know if you do.
I am glad I was able to help.
I have been looking into your question. The delay you have mentioned comes from the default style for the checkbox. You can see it by simply adding a checkbox and check and uncheck it. The style used in the themes, as I have mentioned in my previous post, sets duration for the animation, when the checkbox is checked and unchecked.
Please do not hesitate to let me know if you have any further questions on this matter.