Hello Fayna,
I guess I should use DismissDialog() individually for each dialog in the "menu tree", but I have not been able to find the proper way to do it.
yes, this the right approach. The challenge here is to find all actually (or all desired) dialogs and dismiss them. You would implement for this purpose usually a loop. See the section Enumerate and search for existing Dialogs. It explains how to find dialogs existing actually within a group and it also demonstrates how to dismiss them. According to the description found there you could implement following code. It searches for all actually existing dialogs (therefore the search operation starts in the root object):
var Core::Root theRoot = GetRoot();
var Core::Group dialog = theRoot.FindCurrentDialog();
while ( dialog )
{
dialog.Owner.DismissDialog( dialog, null, null, null, null, null, false );
dialog = theRoot.FindCurrentDialog();
}
Important aspect: if your dialogs are using animations (transitions) to dismiss them, you can pass in the last parameter of the DismissDialog() method the value true for the second and all following dialogs. Then the dismiss animations are not performed one after another but simultaneously - all dialogs e.g. fade-out at the same time. If it is interesting you see the section Perform several Dialog transitions simultaneously.
Best regards
Paul Banach