public AxleWeightViewModel(string axlePosition, int numberOfAxle) { AxlePosition = axlePosition; NumberOfAxle = numberOfAxle; Psi = ApplicationPropertiesHelper.GetProperty(_lastPsiValueKey + _axlePosition, 50); }
public WeightPageForCombinationViewModel(string combination) { NumberOfAxles = combination.Split(',') .Select((a) => Convert.ToInt32(a)) .ToList(); string imageFile = combination.Replace(',', '_') + ".png"; ImageSource = ImageSourceHelper.GetFromResource(imageFile); PsiTableTruck = DictionaryToList(_psiTableTruckBase); PsiTableTrailerGeneric = DictionaryToList(_psiTableTrailerGenericBase); SelectedIndexA = ApplicationPropertiesHelper.GetProperty(nameof(SelectedIndexA), -1); SelectedIndexB = ApplicationPropertiesHelper.GetProperty(nameof(SelectedIndexB), -1); SelectedIndexC = ApplicationPropertiesHelper.GetProperty(nameof(SelectedIndexC), -1); SelectedIndexD = ApplicationPropertiesHelper.GetProperty(nameof(SelectedIndexD), -1); HelpCommand = new Command(async() => { await Commons.DisplayAlert(AppResources.WeightHelpTitle, AppResources.WeightHelpMessage, "Ok"); }); MaxLegalWeight = (NumberOfAxles[2] > 0) ? 67500 : 5500 + GetMaxWeightForAxle(NumberOfAxles[0]) + GetMaxWeightForAxle(NumberOfAxles[1]); }