tags:

views:

102

answers:

3

This feels like a really basic question, but I can't figure it out anyway..

How do I get the type of System.Windows.Visibility? I need to pass the type definition to a function. More precisly I'm writing unit tests for a IValueConverter I'm writing where the target type is a System.Windows.Visibility. What do I pass as target type when calling Convert..?

public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+8  A: 

typeof(System.Windows.Visibility)

Paul Baker
Woot?! Well, of course I tried typeof, but I got some odd errors I didn't understand, so I got misled.. The errors turns out not to address the typeof, so I just got confused at the end of a long day. Of course typeof is correct. Thanks! I said it felt basic ;-)
stiank81
+5  A: 

Are you asking for typeof ?

typeof(System.Windows.Visibility)
Guillaume
+5  A: 
typeof(System.Windows.Visibility);

will do the trick :)

lol, 3 exactly the same answers within a minute of each other :/

Alastair Pitts