I have an "Open" button as an ApplicationMenu2010Item in my ApplicationMenu2010. When it is clicked, the user is prompted for a file to open. If they click Cancel, the ApplicationMenu2010 (backstage) disappears. Is there a way to prevent this from happening? I know if I put content to the right, I can control this better, but can I do it while keeping my current behavior (clicking the ApplicationMenu2010Item?
Hi Jon,
Thank you for your post. I have been looking into your question and I added a button, which invokes Open File Dialog, in the Header of the ApplicationMenu2010Item and as in a content of the ApplicationMenu2010Item and the ApplicationMenu2010 is still open when click the button and after that cancel it.
I am attaching a sample application(Ribbon_ApplicationMenu2010_Close.zip) that shows my definition of the ApplicationMenu2010. Could you please test it on your side and modify it, if needed, in order to be able to replicate the described behavior ?
Looking forward to hearing from you.
That is close to what I want. I am using MVVM, so I have a command that gets called in my ViewModel. Is there a way to close the applicationmenu on clicking open on the open file dialog and keep the applicationmenu open if they click cancel? I know how to do it if I open the file dialog in the code behind, but can I do it in the ViewModel?
In another applicationmenuitem, I am using ApplicationMenu2010Item.CloseWhenClicked="True" to close the applicationmenu upon clicking that button. In this case since the open file dialog is system controlled, I can't put that attribute on the open and cancel buttons.
Thank you!
Thank you for your reply. I have been looking into your scenario and in order to achieve the desired behavior I used CommandParameter which is bound to the ApplicationMenu2010 element. This way I am able to set its ‘IsOpen’ property in CommandMethid method.
I am attaching a modified version of my sample application(Ribbon_ApplicationMenu2010_Close_Command.zip) that shows my suggestion.
Let me know, if you need any further assistance on this matter.