source: trunk/CrypPlugins/KeySearcher/Converter/FalseToVisibleConverter.cs @ 1709

Last change on this file since 1709 was 1682, checked in by Paul Lelgemann, 11 years ago

o Work on the distributed KeySearcher presentation

File size: 990 bytes
RevLine 
[1619]1using System;
2using System.Globalization;
3using System.Windows;
4using System.Windows.Data;
5
[1682]6namespace KeySearcherConverter
[1619]7{
8    [ValueConversion(typeof (bool), typeof (Visibility))]
[1682]9    public class FalseToVisibleConverter : IValueConverter
[1619]10    {
11        #region IValueConverter Members
12
13        public object Convert(object value, Type targetType, object parameter,
14                              CultureInfo culture)
15        {
16            if (targetType != typeof (Visibility))
[1682]17                throw new InvalidOperationException("The target must be of Visibility");
[1619]18
19            if ((bool) value)
20            {
21                return Visibility.Hidden;
22            }
[1682]23
24            return Visibility.Visible;
[1619]25        }
26
27        public object ConvertBack(object value, Type targetType, object parameter,
28                                  CultureInfo culture)
29        {
30            throw new NotSupportedException();
31        }
32
33        #endregion
34    }
35}
Note: See TracBrowser for help on using the repository browser.