public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { SynchronisatieTypeEnum e = (SynchronisatieTypeEnum)parameter; switch (e) { case SynchronisatieTypeEnum.Conflict: case SynchronisatieTypeEnum.GarantieConflict: if (value is string) { return(value as string); } else { return(""); } case SynchronisatieTypeEnum.Gelijkstart: case SynchronisatieTypeEnum.Voorstart: case SynchronisatieTypeEnum.Naloop: if (value is bool) { return((bool)value); } else { return(false); } default: throw new NotImplementedException(); } }
public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { SynchronisatieTypeEnum e1 = (SynchronisatieTypeEnum)value; SynchronisatieTypeEnum e2 = (SynchronisatieTypeEnum)parameter; if (e2.HasFlag(e1)) { return(true); } else { return(false); } }
public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { SynchronisatieTypeEnum e1 = (SynchronisatieTypeEnum)value; SynchronisatieTypeEnum e2 = (SynchronisatieTypeEnum)parameter; if (e2.HasFlag(e1)) { return(Visibility.Visible); } else { return(Visibility.Collapsed); } }