Message 1 of 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I'm facing an issue with making ExternalEvent execute before my code.
Context of the Problem :
I have WPF UI which is called when I click the push button on the ribbon, this UI in turn calls the "ExternalEvent" which runs the test on the document and we use the test results to perform the action.
Current State of Problem:
As a work around we are using 2 push buttons one to call external event and then we call the UI, this is not efficient workflow for us and we would like to execute this as a part of single push button.
Please let us know what solution could we explore?
/*When the button is clicked in the fucntion below the External event should execute first , but it is not happening instead it complete all other tasks and then run external event handler. */
//Function
private void BtnClicked()
{
btnClickedEvent.Raise();
Othertasks();
}
//external Event
btnClickedEvent = ExternalEvent.Create(new ExternalEventhandle());
public class ExternalEventhandle: IExternalEventHandler
{
public void Execute(UIApplication app)
{
UIDocument UIdoc = app.ActiveUIDocument;
Document doc = UIdoc.Document;
//----some task to do ------
RunTestFunction();
}
public string GetName()
{
return "";
}
}
/Expectation: Want to excute RunTestFunction() first , only when it is completed then only Run Othertasks() function/
Solved! Go to Solution.