Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Missing Type.GetProperty() method in Windows 8 Developer Preview

Tags:

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?

UPDATE

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

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

like image 391
Rico Suter Avatar asked Oct 22 '11 09:10

Rico Suter


1 Answers

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

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

like image 184
Nick Butler Avatar answered Sep 18 '22 06:09

Nick Butler