缺少Type.GetProperty()C#方法在Windows 8开发者预览版 [英] Missing Type.GetProperty() C# method in Windows 8 Developer Preview

查看:150
本文介绍了缺少Type.GetProperty()C#方法在Windows 8开发者预览版的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图端口一个简单的应用程序到Windows 8地铁(WinRT的)。看来一些非常基本的方法是失踪。一个基本的例子: Type.GetProperty()。它可为Windows Phone 7,Silverlight和.NET客户端配置文件。我是否需要安装的东西(例如,一个特殊的库)或者是这种方法根本就不是在.NET地铁轮廓?

I'm trying to port a simple application to Windows 8 Metro (WinRT). It seems that some very basic methods are missing. One basic example: Type.GetProperty(). It is available for Windows Phone 7, Silverlight and .NET client profile. Do I have to install something (eg. a special library) or is this method simply not available in the .NET metro profile?

更新

OK,谢谢。现在我用 this.GetType()。GetTypeInfo的()。DeclaredProperties

OK, thank you. Now I use this.GetType().GetTypeInfo().DeclaredProperties.

使用的System.Reflection; 需要有这个 GetTypeInfo的()扩展方法。

using System.Reflection; is needed to have this GetTypeInfo() extension method.

推荐答案

反射已经改变了在地铁位:看的 MSDN (反思的变化 - 在底部附近)。

Reflection has changed a bit in Metro: see MSDN ( "Reflection changes" - near the bottom ).

基本上,你现在需要: type.GetTypeInfo()

Basically, you now need: type.GetTypeInfo().

这篇关于缺少Type.GetProperty()C#方法在Windows 8开发者预览版的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆