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
Line 
1using System;
2using System.Globalization;
3using System.Windows;
4using System.Windows.Data;
5
6namespace KeySearcherConverter
7{
8    [ValueConversion(typeof (bool), typeof (Visibility))]
9    public class FalseToVisibleConverter : IValueConverter
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))
17                throw new InvalidOperationException("The target must be of Visibility");
18
19            if ((bool) value)
20            {
21                return Visibility.Hidden;
22            }
23
24            return Visibility.Visible;
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.