C#:如何获取我的枚举的类型定义..?
这感觉像是一个非常基本的问题,但我无论如何都无法弄清楚。
如何获取 System.Windows.Visibility 的类型?我需要将类型定义传递给函数。更准确地说,我正在为我正在编写的 IValueConverter 编写单元测试,其中目标类型是 System.Windows.Visibility。调用 Convert.. 时,我应该传递什么作为目标类型?
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
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)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
typeof(System.Windows.Visibility)
typeof(System.Windows.Visibility)
您是否要求 typeof ?
Are you asking for typeof ?
就可以了:)
哈哈,一分钟之内就有 3 个完全相同的答案:/
will do the trick :)
lol, 3 exactly the same answers within a minute of each other :/