public SetWaterPopup(WaterOperationType waterOperationType, WaterPageViewModel waterPageViewModel) { _wpVM = waterPageViewModel; ObservableCollection <string> collection = new ObservableCollection <string>(); switch (waterOperationType) { case WaterOperationType.TotalAmount: { collection = GetListOfWaterAmount.GetListOfWaterAmountMethod(WaterOperationType.TotalAmount, 81); break; } case WaterOperationType.Capacity: { collection = GetListOfWaterAmount.GetListOfWaterAmountMethod(WaterOperationType.Capacity, 10); break; } } BindingContext = new SetWaterPopupViewModel(this, collection, waterOperationType, _wpVM); InitializeComponent(); }
public SetWaterPopupViewModel(SetWaterPopup setWaterPopup, ObservableCollection <string> vs, WaterOperationType waterOperationType, WaterPageViewModel waterPageViewModel) { IsNotSelected = false; _swp = setWaterPopup; CollectionSource = vs; _waterOperationChoice = waterOperationType; _wpVM = waterPageViewModel; ButtonBackgroundColor = System.Drawing.Color.FromArgb(255, 0, 0); QuitCommand = new Command(QuitCommandImpl); }
public static ObservableCollection <string> GetListOfWaterAmountMethod(WaterOperationType waterOperationType, int loops) { ObservableCollection <string> result = new ObservableCollection <string>(); int StartingValue; int insideLoops = 0; switch (waterOperationType) { case WaterOperationType.TotalAmount: { StartingValue = 1000; break; } case WaterOperationType.Capacity: { StartingValue = 50; break; } default: { StartingValue = 50; break; } } if (insideLoops >= loops) { return(result); } for (int i = StartingValue; insideLoops < loops; i += 50) { result.Add(i.ToString()); insideLoops++; } return(result); }
public void WaterAmountClickImpl() { WaterOperationType waterOperationType = WaterOperationType.TotalAmount; _wp.Navigation.ShowPopup(new SetWaterPopup(waterOperationType, this)); }
public void GlassCapacityClickImpl() { WaterOperationType waterOperationType = WaterOperationType.Capacity; _wp.Navigation.ShowPopup(new SetWaterPopup(waterOperationType, this)); }