Rev | Line | |
---|
[4311] | 1 | using System;
|
---|
| 2 | using System.Collections.Generic;
|
---|
| 3 | using System.Linq;
|
---|
| 4 | using System.Text;
|
---|
| 5 | using System.Windows.Data;
|
---|
| 6 | using System.Globalization;
|
---|
| 7 |
|
---|
| 8 | namespace HeuristicLab.MainForm.WPF {
|
---|
| 9 |
|
---|
| 10 | public class AndNotConverter : IMultiValueConverter {
|
---|
| 11 | public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture) {
|
---|
| 12 | if (values.Length == 2 && values[0] is bool && values[1] is bool && targetType == typeof(bool))
|
---|
| 13 | return (bool)values[0] && !(bool)values[1];
|
---|
| 14 | return null;
|
---|
| 15 | }
|
---|
| 16 |
|
---|
| 17 | public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture) {
|
---|
| 18 | throw new NotImplementedException();
|
---|
| 19 | }
|
---|
| 20 | }
|
---|
| 21 |
|
---|
| 22 | public class NotConverter : IValueConverter {
|
---|
| 23 | public object Convert(object value, Type targetType, object parameter, CultureInfo culture) {
|
---|
| 24 | return !(bool)value;
|
---|
| 25 | }
|
---|
| 26 | public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) {
|
---|
| 27 | return !(bool)value;
|
---|
| 28 | }
|
---|
| 29 | }
|
---|
| 30 | }
|
---|
Note: See
TracBrowser
for help on using the repository browser.