GuidToBooleanConverter.cs 642 B

1234567891011121314151617181920212223242526
  1. using System;
  2. using System.Globalization;
  3. using Xamarin.Forms;
  4. namespace InABox.Mobile
  5. {
  6. public class GuidToBooleanConverter : IValueConverter
  7. {
  8. public bool EmptyValue { get; set; }
  9. public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
  10. {
  11. return (value != null) && ((Guid)value != Guid.Empty)
  12. ? !EmptyValue
  13. : EmptyValue;
  14. }
  15. public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
  16. {
  17. throw new NotImplementedException();
  18. }
  19. }
  20. }