public void CommitNewItem() { if (!entry.Item.IsNewItem) { Platform.MessageBox("Item is not new"); } //throw new ArgumentOutOfRangeException("Item is not new"); if (Navigate.IAcceptsNewEntry != null) { if (!Navigate.IAcceptsNewEntry.ShouldSaveNewEntry(entry)) { Navigate.BackAfterSubmit(); return; } } // entry.Item.NotifyEntries.Remove(entry); // entry.Item.NotifyEntries.Add(entry); entry.Save(); #if WINDOWS_PHONE PictureCache.Current.UpdateNewItemWithID(item.Text); #endif MessageQueue.Push(new Messages.EntryUpdatedMessage(entry)); // do this in model? Navigate.BackAfterSubmit(); }
public void CommitNewItem() { if (!recipe.IsNewItem) { throw new ArgumentOutOfRangeException("Item is not new"); } recipe.Save(); #if WINDOWS_PHONE PictureCache.Current.UpdateNewItemWithID(recipe.GetItemId()); #endif MessageQueue.Push(new Messages.RecipeUpdatedMessage(recipe)); // do this in model? //#if !DEBUG Navigate.BackAfterSubmit(); //#endif }