예제 #1
0
        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();
        }
예제 #2
0
        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);
        }
예제 #3
0
        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);
        }
예제 #4
0
        public void WaterAmountClickImpl()
        {
            WaterOperationType waterOperationType = WaterOperationType.TotalAmount;

            _wp.Navigation.ShowPopup(new SetWaterPopup(waterOperationType, this));
        }
예제 #5
0
        public void GlassCapacityClickImpl()
        {
            WaterOperationType waterOperationType = WaterOperationType.Capacity;

            _wp.Navigation.ShowPopup(new SetWaterPopup(waterOperationType, this));
        }