Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kellabyte/1524394 to your computer and use it in GitHub Desktop.
Save kellabyte/1524394 to your computer and use it in GitHub Desktop.
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