private void DeleteBatch(BatchDataModel batch) { BatchUtility.DeleteBatch(batch); if (CurrentBatch == batch) { int previousBatchIndex = SavedBatches.IndexOf(batch) - 1; CurrentBatch = previousBatchIndex >= 0 ? SavedBatches[previousBatchIndex] : SavedBatches.FirstOrDefault(); } SavedBatches.Remove(batch); }
private void AddNewBatch(RecipeDataModel recipe) { SaveCurrentBatch(); CurrentBatch = BatchUtility.CreateBatch(recipe); SavedBatches.Add(CurrentBatch); }