Select to view content in your preferred language

ICommand Close Event

1800
1
Jump to solution
05-02-2012 12:41 AM
AnthonyKeogh1
Deactivated User
Hi,

I am trying to add a close event to a command I have made for a Map web part in SharePoint.
The command adds some graphics to the map and all I want to do is clear the graphics when the user clicks the 'X' button on the Command window.

I have added an EventHandler to the ShowWindow method :

MapApplication.Current.ShowWindow("Perform a search", gazSearch, false, DialogClosing, null, WindowType.Floating);


Then I have called my Reset function in the handler method:

public event EventHandler<System.ComponentModel.CancelEventArgs> DialogClosing;          protected virtual void OnDialogClosing2(object sender, System.ComponentModel.CancelEventArgs args)         {             if (DialogClosing2 != null)             {                 DialogClosing2(this, args);                 gazSearch.reset();             }         }


But no matter what I have tried I have not been able to get the event to fire.

Can somebody tell me what  I am doing wrong.
Thanks
0 Kudos
1 Solution

Accepted Solutions
AnthonyKeogh1
Deactivated User
In the end I ditched the Close event and used the Unloaded event instead.

View solution in original post

0 Kudos
1 Reply
AnthonyKeogh1
Deactivated User
In the end I ditched the Close event and used the Unloaded event instead.
0 Kudos