public void Choose(JournalItemViewModel vm)
 {
     if (vm is SugarViewModel)
     {
         editedSugar = (vm as SugarViewModel).Sugar;
         var sugarCopy = editedSugar.GetCopy();
         editedSugarViewModel = new SugarViewModel(sugarCopy, this.factories);
         sugarEditing.Show(editedSugarViewModel);
     }
     else
         vm.Choose(Navigator);
     choosedAnAdded = false;
 }
 public void ChooseAnAdded(JournalItemViewModel vm)
 {
     Choose(vm);
     choosedAnAdded = true;
 }
 private int ThenBy(JournalItemViewModel item)
 {
     return item is MealViewModel ? 1 : (item is SugarViewModel ? 2 : 3);
 }