Created
August 13, 2011 12:57
-
-
Save clausjoergensen/1143826 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class ViewModelLocator | |
{ | |
private static MyViewModel myViewModel; | |
public static MyViewModel MyViewModel | |
{ | |
get | |
{ | |
if (myViewModel == null) | |
Deployment.Current.Dispatcher.BeginInvoke(() => myViewModel = new MyViewModel()); | |
return myViewModel; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment