public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) { if (IsAttributeFlag) { var par = parameter as Enum; if ((bool)value) { CurrentValue = CurrentValue.Or(par); } else { CurrentValue = CurrentValue.And(par.Not()); } return(CurrentValue); } else { if ((bool)value) { return(parameter); } else { return(CurrentValue); } } }