private void OnPropertySelected(MenuItemProperty obj) { var mig = SelectedItemPropertyGroups.FirstOrDefault(propertyGroup => propertyGroup.Properties.Contains(obj)); Debug.Assert(mig != null); if (_removeModifier) { if (mig.ForceValue && SelectedItem.Properties.Count(x => x.Model.PropertyGroupId == mig.Id) < 2) { InteractionService.UserIntraction.GiveFeedback(string.Format(Resources.SelectionRequired_f, mig.Name)); } else { SelectedItem.RemoveProperty(mig, obj); } } else { SelectedItem.ToggleProperty(mig, obj); } SelectedTicket.RefreshVisuals(); SelectedTicket.RecalculateTicket(); if (_removeModifier) { OnRemoveModifier(""); } RaisePropertyChanged("IsRemoveModifierButtonVisible"); }
private void OnPortionSelected(MenuItemPortion obj) { SelectedItem.UpdatePortion(obj, AppServices.MainDataContext.SelectedDepartment.PriceTag); SelectedTicket.RefreshVisuals(); SelectedTicket.RecalculateTicket(); if (SelectedItemPropertyGroups.Count == 0 && SelectedItemGroupedPropertyItems.Count == 0) { SelectedTicket.ClearSelectedItems(); } }
private void OnPropertyGroupSelected(MenuItemGroupedPropertyItemViewModel obj) { if (_removeModifier) { SelectedItem.RemoveProperty(obj.MenuItemPropertyGroup, obj.CurrentProperty); obj.UpdateNextProperty(null); } else { SelectedItem.ToggleProperty(obj.MenuItemPropertyGroup, obj.NextProperty); obj.UpdateNextProperty(obj.NextProperty); } SelectedTicket.RefreshVisuals(); SelectedTicket.RecalculateTicket(); if (_removeModifier) { OnRemoveModifier(""); } RaisePropertyChanged("IsRemoveModifierButtonVisible"); }
private void OnUpdateExtraProperties(string obj) { SelectedTicket.RefreshVisuals(); _showExtraPropertyEditor = false; RaisePropertyChanged("IsExtraPropertyEditorVisible"); }