1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
| using System.Windows;
using System.Windows.Controls;
using System.Windows.Navigation;
using test_passage_paramaitre.LoginUI;
using System.Windows.Data;
using System.Globalization;
using System;
[ValueConversion(typeof(string), typeof(Visibility))]
public class NameToVisibilityConverter : IValueConverter
{
public string Name { get; set; }
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
string s = (string)value;
if (value == Name)
return Visibility.Visible;
return Visibility.Collapsed;
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotSupportedException();
}
} |
Partager