public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { DosageType dosageType = (DosageType)value; return(EnumLocalizer.Default.Translate(dosageType)); }
static float min = -1000000; //(float)decimal.MinValue; public static SupplementCycleDosage CreateDosage(decimal dosageValue, string name, Suplement supplement, SupplementCycleDayRepetitions repetitions = SupplementCycleDayRepetitions.OnceAWeek, DosageType dosageType = DosageType.MiliGrams, TimeType timeType = TimeType.NotSet) { var dosage = new SupplementCycleDosage(); dosage.Dosage = dosageValue; dosage.Name = name; dosage.DosageType = dosageType; dosage.Repetitions = repetitions; dosage.Supplement = supplement; dosage.TimeType = timeType; return(dosage); }