Created
December 27, 2011 17:08
-
-
Save kellabyte/1524391 to your computer and use it in GitHub Desktop.
This file contains 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 class MainViewModelFactory | |
: ViewModelFactory<MainViewModel, MainViewModelDesign> | |
{ | |
} | |
/// <summary> | |
/// Design time version of the MainViewModel. | |
/// </summary> | |
public class MainViewModelDesign : MainViewModel | |
{ | |
public override void OnLocated(bool newInstance) | |
{ | |
#if DEBUG | |
// This gets called at design time. | |
this.Stories = new ObservableCollection<Story>(); | |
this.Stories.Add( | |
new Story("The Windows Blog", "Upping our game...")); | |
this.Stories.Add( | |
new Story("Robot Overlords", "Nevada Passes Law...")); | |
this.Stories.Add( | |
new Story("TechCrunch", "eBay Acquired Magento...")); | |
this.Stories.Add( | |
new Story("Inside Facebook", "Facebook Testing...")); | |
this.Stories.Add( | |
new Story("FOSS Patents", "Eastman Kodak v...")); | |
#endif | |
} | |
} | |
public class MainViewModel : BaseViewModel | |
{ | |
private Database db = null; | |
public MainViewModel() | |
{ | |
} | |
public override void OnLocated(bool newInstance) | |
{ | |
// This gets called at run time. | |
// Gah! Bad me. Wish I knew how to fix this. | |
// I will learn how though! | |
db = ApplicationHost.Current.Container.Resolve<Database>(); | |
this.Stories = new ObservableCollection<Story>(); | |
LoadDatabase(); | |
GetFeedStories(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment