private void Application_Launching(object sender, LaunchingEventArgs e)
{
// TODO Ask for permission
// TODO Stop animation and do other battery-saving things under lock screen
// http://msdn.microsoft.com/en-us/library/windowsphone/develop/ff941090(v=vs.105).aspx
PhoneApplicationService.Current.ApplicationIdleDetectionMode = IdleDetectionMode.Disabled;
Model.Initialize();
// Set up workflow through events on the model
Model.PropertyChanged += new PropertyChangedEventHandler(
(s, ev) =>
{
Model.RunWorkflow(ev.PropertyName);
if (ev.PropertyName == DataModel.AllDonePropertyName)
{
if (Model.AllDone)
{
// What do we do here?
}
}
else if (ev.PropertyName == DataModel.NewSongsAddedPropertyName)
{
if (Model.NewSongsAdded)
{
MessengerInstance.Send<NewSongsAddedMessage>(
new NewSongsAddedMessage());
}
}
});
Model.RunWorkflow(null);
}