Blog author:
Naimishforu | Posted on: 6/21/2011 | Category:
WPF Blogs | Views: 2429 | Status:
[Member] [MVP] |
Points: 75
|
Alert Moderator
WPF application Single Instance in one line
Usage: WpfSingleInstance.Make(); or WpfSingleInstance.Make(SingleInstanceModes.ForEveryUser);
1. Add only a line of code (above) in the App.xaml.cs or in the main window.
2. Add a small static class in project (and a dummy enum SingleInstanceModes).
No additional inheritance in App class.
No App.xalm deleting.
No so redundant WCF and Remoting.
It works by the EventWaitHandle. Look in code, it's so simply.
Thanks,
Naimish
http://dotnetinterview.zxq.net/
http://naimishpandya.blogspot.in/
Found interesting? Add this to: