Dialog OnClose Binding

I there any way I can bind some value to OnClose event when I press close button?

DialogService.OnClose += RelaodDashBoard;
DialogService.Open<.......>

void RelaodDashBoard(dynamic result)
{
   if(result)
   {
         reload dashbard
   }
}

problem is that I always get null. If I do DialogService.Close(true) it works fine

You can use any object as Close() method argument and OnClose will be raised with the provided object.

Yes but if I want to bind some model to close button top right corner. How do I do that?

I’ll repeat myself: To close the dialog you need to execute DialogService.Close() method and you can provide whatever argument. This argument can be received in Close event handler (used usually with Open() method) or as a result of OpenAsync() method. Closing the dialog with top right close button will return null. You can hide this button if you set ShowClose to false to DialogOptions.