12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- using System;
- using System.Globalization;
- using Xamarin.Forms;
- namespace InABox.Mobile
- {
- public class IntToBooleanConverter : AbstractConverter<int,bool>
- {
- public int Value { get; set; }
-
- public bool Result { get; set; }
-
- protected override bool Convert(int value, object parameter = null)
- {
- return value == Value ? Result : !Result;
- }
- public IntToBooleanConverter()
- {
- Result = true;
- }
-
- }
-
- public class DoubleToBooleanConverter : AbstractConverter<double,bool>
- {
- public double MinValue { get; set; }
- public double MaxValue { get; set; }
-
- public bool Result { get; set; }
-
- protected override bool Convert(double value, object parameter = null)
- {
- return value >= MinValue && value <= MaxValue ? Result : !Result;
- }
-
- public DoubleToBooleanConverter()
- {
- Result = true;
- }
-
- }
- }
|