stiank81
stiank81

Reputation: 25686

C#: How to get the type definition of my enum..?

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)

Upvotes: 0

Views: 233

Answers (3)

user200783
user200783

Reputation: 14348

typeof(System.Windows.Visibility)

Upvotes: 9

Alastair Pitts
Alastair Pitts

Reputation: 19601

typeof(System.Windows.Visibility);

will do the trick :)

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

Upvotes: 5

Guillaume
Guillaume

Reputation: 13138

Are you asking for typeof ?

typeof(System.Windows.Visibility)

Upvotes: 5

Related Questions