Results 1 to 4 of 4

Thread: How to prevent exit window in OOB mode on SilverLight 4

  1. #1
    Join Date
    Sep 2010
    Posts
    40

    How to prevent exit window in OOB mode on SilverLight 4

    Hello everyone, I am making one project SilverLight 4, my problem is I need cancel the closing of my application in some cases. However I have tried MainWindowClosing event, but it is not working every time, sometime it works but not working every time on server. So I am stuck and confused how to do it, does it work in SilverLight 4 OOB mode? I have almost checked on every website related to it, but I am not finding my way to be clear. So if anyone can help here? Every single solution is highly appreciated. Thanks a lot in advance!

  2. #2
    Join Date
    Feb 2008
    Posts
    624

    Re: How to prevent exit window in OOB mode on SilverLight 4

    Hey I have seen your problem; well looking at your case you must try the official website of SilverLight and Visual Studio, there you will find some readymade examples which will solve your problem, because I was having the same issue and I have solved it from these websites only. As per my experience with SilverLight website, I think it will solve your problem, if it is not working for you then just store the initial in MainWindowClosing Event, and also try to some change in web.config setting of Visual Studio. All the Best! Enjoy your Website.

  3. #3
    Join Date
    Nov 2009
    Posts
    580

    Re: How to prevent exit window in OOB mode on SilverLight 4

    There you are!! Hello everyone, looking at above post I must say that you are going exactly with the solution. On addition I wanted to tell you that if you have made constructor, then from constructor it will not fire MainWindowClosing event, if you are writing Application.Current.MainWindow+=Main_Window_Closing
    But you want to fire it, then replace it with Application.Current.MainWindow by a global variable: private Window_MainWindow = Application.Current.MainWindow; when you will do this this will solve your closing window application. All the best!!!

  4. #4
    Join Date
    May 2008
    Posts
    540

    Re: How to prevent exit window in OOB mode on SilverLight 4

    Hey thanks friend for helping me, I have tried to follow each step you have written above. But when I tried to above code it was not working for me, after 2 to 3 attempts I came to know that I have not made constructor for that code. After that when I made constructor on top with global and private variable, I put Application.Current.MainWindow code it finally worked for me. I am very happy that I have made it, but mu friend without you it was not possible. Thanks a lot man, and thanks to all.

Similar Threads

  1. How to exit EM Mode on LinkStation Live LS-CHL
    By G.Kahli in forum Networking & Security
    Replies: 3
    Last Post: 29-05-2012, 01:47 PM
  2. Exit a Silverlight Application
    By KornFlexia in forum Portable Devices
    Replies: 4
    Last Post: 26-10-2010, 07:43 PM
  3. Exit button [X] on application window not working
    By Wajeeha in forum Networking & Security
    Replies: 5
    Last Post: 16-07-2010, 05:08 PM
  4. How to exit a Windows MS-DOS window through a batch file.
    By Juaquine in forum Operating Systems
    Replies: 4
    Last Post: 27-03-2010, 05:31 PM
  5. Prevent window resizing Firefox
    By tombman in forum Technology & Internet
    Replies: 3
    Last Post: 04-07-2009, 01:53 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,718,173,928.03557 seconds with 16 queries