Created
December 27, 2011 17:08
-
-
Save kellabyte/1524394 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> | |
{ | |
} | |
public class MainViewModelDesign : MainViewModel | |
{ | |
public MainViewModelDesign() | |
: base(new EventAggregator(), new DesignDatabase()) | |
{ | |
} | |
public override void OnLocated(bool newInstance) | |
{ | |
#if DEBUG | |
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 IDatabase db = null; | |
private IEventAggregator events = null; | |
private Feed feed = null; | |
public MainViewModel(IEventAggregator events, IDatabase db) | |
{ | |
this.events = events; | |
this.events.Subscribe(this); | |
this.db = db; | |
this.Stories = new ObservableCollection<Story>(); | |
} | |
public override void OnLocated(bool newInstance) | |
{ | |
LoadDatabase(); | |
GetFeedStories(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment