- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Good morning everyone,
I try to explain as best as I can what my application does and what the problem is.
In Vault 2023 (C#) I developed a custom search form.
By this form it's possible to search for items through their UDP (I mean some internal Company classification properties). Once the search is completed, with a click on the result row, the context returns to the Vault which navigates to the selected item.
As far I have successfully used a ShowDialog to open the modal Form and retrieve the result upon closing and GOTO the item. This is all done inside the CommandHandler routine (therefore using e.Context.GoToLocation). Everything works like a charm.
Now the request is that this form remains available on demand, on a second monitor, in order to allow the user to use the Vault and recall the form to perform searches if necessary.
In order to reach the goal I pass the CommandItemEventArgs to the non-modal form when I instantiate and open it.
On item selection I hide the form and through the Hide event (with Close event I get a Vault crash) I retrieve the value of the selected item and try to navigate to that item in the Vault.
These operations no longer take place within the CommandHandler but rather in the FormSearchVisibleChanged routine (invoked by the Hide event).
In debug I see that the original context is intact but despite this it doesn't work.
At the moment it seems that the only way to access the context is within its CommandHandler.
Apologies for the length of the introduction.
Now the question:
Is it possible to access the context if it is passed to a routine external to the CommandHandler?
Any other ways to manage or rethink the solution?
Thank you very much in advance for your patience and kind support
Solved! Go to Solution.
