2

I want to be able to close a Silverlight window when running out of browser. I know it is possible to do this in the browser.

Brendan Enrick
  • 4,277
  • 2
  • 26
  • 40

1 Answers1

1
Application.Current.MainWindow.Close();
RobSiklos
  • 8,348
  • 5
  • 47
  • 77
  • Thanks. Interestingly, I asked my question before this method was added, so it wasn't possible to do this when I asked the question. – Brendan Enrick Nov 08 '11 at 21:09
  • 3
    FYI This method is limited to trusted applications or when called from a user-initiated event. See the [Remarks section of the documentation](http://msdn.microsoft.com/en-us/library/system.windows.window.close(v=vs.95)) for details. – Martin Hollingsworth Jun 29 '12 at 03:08