Пример #1
0
 private static void AmountPropertyChanged(BindableObject bindable, object oldValue, object newValue)
 {
     if (newValue.IsNotNull())
     {
         NumberEntry entry = (NumberEntry)bindable;
         entry.Amount = (decimal)newValue;
         entry.ChangeText();
     }
 }
Пример #2
0
        private static void NumberTypePropertyChanged(BindableObject bindable, object oldValue, object newValue)
        {
            if (newValue.IsNotNull())
            {
                NumberEntry entry = (NumberEntry)bindable;
                entry.NumberType = (EnumNumberType)newValue;

                if (entry.NumberType == EnumNumberType.Percent)
                {
                    entry.MinimumAmount = 0;
                    entry.MaximumAmount = 100;
                }

                if (oldValue.IsNull())
                {
                    entry.ChangeText();
                }
            }
        }