Click here to Skip to main content
15,896,118 members
Home / Discussions / WPF
   

WPF

 
GeneralRe: Any trick for *REUSABLE* "Application" class? Pin
Ian Shlasko21-Apr-11 8:48
Ian Shlasko21-Apr-11 8:48 
GeneralRe: Any trick for *REUSABLE* "Application" class? Pin
SledgeHammer0121-Apr-11 8:59
SledgeHammer0121-Apr-11 8:59 
GeneralRe: Any trick for *REUSABLE* "Application" class? Pin
Ian Shlasko21-Apr-11 9:10
Ian Shlasko21-Apr-11 9:10 
GeneralRe: Any trick for *REUSABLE* "Application" class? Pin
SledgeHammer0121-Apr-11 9:33
SledgeHammer0121-Apr-11 9:33 
GeneralRe: Any trick for *REUSABLE* "Application" class? Pin
Ian Shlasko21-Apr-11 10:00
Ian Shlasko21-Apr-11 10:00 
GeneralRe: Any trick for *REUSABLE* "Application" class? Pin
SledgeHammer0121-Apr-11 11:29
SledgeHammer0121-Apr-11 11:29 
GeneralRe: Any trick for *REUSABLE* "Application" class? Pin
Ian Shlasko21-Apr-11 15:27
Ian Shlasko21-Apr-11 15:27 
GeneralRe: Any trick for *REUSABLE* "Application" class? Pin
SledgeHammer0121-Apr-11 17:06
SledgeHammer0121-Apr-11 17:06 
I'm making an "ApplicationEx" class that encapsulates single application instance functionality and the WindowsFormsApplicationBase technique is one of the more popular ways to do that. No multi-threaded GUI threads Smile | :) . WindowsFormsApplicationBase is just MSFT's wrapper for that stuff and they do all the inter-process communication like forwarding the new cmd line args to the previous instance.

Think about IE... if you type "start http://www.microsoft.com" at the cmd prompt, it starts up IE and goes to www.microsoft.com. Now if you type "start http://www.cnn.com", it keeps the same one instance of IE, but opens up a 2nd tab to www.cnn.com. Obviously a 2nd instance of IE ran and exited and somehow forwarded the args to the first process.

WindowsFormsApplicationBase provides a pretty clean mechanism to get the SECOND instance cmd line args to the singleton instance, but it doesn't provide a very clean way to get the original instance cmd line args out of the static classes.

I think I'm kind of going to do what you suggested and add a "LastCmdLineArgs" property to ApplicationEx. Kind of weird that Application doesn't have that already.
GeneralRe: Any trick for *REUSABLE* "Application" class? Pin
Ian Shlasko21-Apr-11 17:22
Ian Shlasko21-Apr-11 17:22 
GeneralRe: Any trick for *REUSABLE* "Application" class? Pin
Pete O'Hanlon22-Apr-11 9:25
mvePete O'Hanlon22-Apr-11 9:25 
GeneralRe: Any trick for *REUSABLE* "Application" class? Pin
SledgeHammer0122-Apr-11 9:52
SledgeHammer0122-Apr-11 9:52 
GeneralRe: Any trick for *REUSABLE* "Application" class? Pin
Pete O'Hanlon22-Apr-11 9:56
mvePete O'Hanlon22-Apr-11 9:56 
QuestionHmm ...MVVM ... Is this Bad? I can't decide Pin
Jammer21-Apr-11 4:26
Jammer21-Apr-11 4:26 
AnswerRe: Hmm ...MVVM ... Is this Bad? I can't decide Pin
BobJanova21-Apr-11 4:51
BobJanova21-Apr-11 4:51 
GeneralRe: Hmm ...MVVM ... Is this Bad? I can't decide Pin
Jammer21-Apr-11 5:02
Jammer21-Apr-11 5:02 
GeneralRe: Hmm ...MVVM ... Is this Bad? I can't decide Pin
Pete O'Hanlon21-Apr-11 10:04
mvePete O'Hanlon21-Apr-11 10:04 
GeneralRe: Hmm ...MVVM ... Is this Bad? I can't decide Pin
Jammer22-Apr-11 2:57
Jammer22-Apr-11 2:57 
GeneralRe: Hmm ...MVVM ... Is this Bad? I can't decide Pin
Pete O'Hanlon22-Apr-11 9:12
mvePete O'Hanlon22-Apr-11 9:12 
GeneralRe: Hmm ...MVVM ... Is this Bad? I can't decide Pin
Jammer22-Apr-11 10:38
Jammer22-Apr-11 10:38 
GeneralRe: Hmm ...MVVM ... Is this Bad? I can't decide Pin
Jammer25-Apr-11 22:38
Jammer25-Apr-11 22:38 
AnswerRe: Hmm ...MVVM ... Is this Bad? I can't decide [modified] Pin
BubingaMan28-Apr-11 1:59
BubingaMan28-Apr-11 1:59 
QuestionHow to read the data from listbox Itemsource datatemplate and display it in UI controls Pin
Rocky2320-Apr-11 2:24
Rocky2320-Apr-11 2:24 
AnswerRe: How to read the data from listbox Itemsource datatemplate and display it in UI controls Pin
Tarun.K.S20-Apr-11 3:05
Tarun.K.S20-Apr-11 3:05 
GeneralRe: How to read the data from listbox Itemsource datatemplate and display it in UI controls [modified] Pin
Rocky2320-Apr-11 3:28
Rocky2320-Apr-11 3:28 
GeneralRe: How to read the data from listbox Itemsource datatemplate and display it in UI controls Pin
Tarun.K.S20-Apr-11 3:59
Tarun.K.S20-Apr-11 3:59 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.