Answered by:
Problems in Windows Runtime Component.

Question
-
I'm having some weird issues in my Windows Runtime Component. Please look at this screenshot
-
Monday, December 28, 2015 5:44 AM
Answers
-
You can change your code as follows for solution:
public sealed class VideoData { internal DateTime UploadDate { get; set; } public DateTimeOffset UpdateDate{ get; set; } }
The reason I think is you try to expose a .net type in your windows runtime component, since your runtime component is available to JavaScript and c++ projects you can rely on the .net framework.
Details you can see http://stackoverflow.com/questions/13778724/system-datetime-is-not-a-valid-windows-runtime-parameter-type.
- Edited by Sunteen Wu Tuesday, December 29, 2015 2:07 AM
- Proposed as answer by Fred Bao Tuesday, December 29, 2015 7:30 AM
- Marked as answer by Corona W10 Tuesday, December 29, 2015 3:00 PM
Tuesday, December 29, 2015 2:06 AM
All replies
-
You can change your code as follows for solution:
public sealed class VideoData { internal DateTime UploadDate { get; set; } public DateTimeOffset UpdateDate{ get; set; } }
The reason I think is you try to expose a .net type in your windows runtime component, since your runtime component is available to JavaScript and c++ projects you can rely on the .net framework.
Details you can see http://stackoverflow.com/questions/13778724/system-datetime-is-not-a-valid-windows-runtime-parameter-type.
- Edited by Sunteen Wu Tuesday, December 29, 2015 2:07 AM
- Proposed as answer by Fred Bao Tuesday, December 29, 2015 7:30 AM
- Marked as answer by Corona W10 Tuesday, December 29, 2015 3:00 PM
Tuesday, December 29, 2015 2:06 AM -
Hello,Please have a check this guide post to add a proper tag for the thread.>>I'm having some weird issues in my Windows Runtime Component. Please look at this screenshotThat is because you are trying to expose a .NET type in your windows runtime component, as we know the windows runtime component can also be accessed by other languages like javascript and C++, while the DateTime structure is not recognized by them, so for you encountered scenario, you could:1.Using theDateTimeOffset instead, it is the projection of Windows.Foundation.DateTime.2.Makred the modifier to be internal, protected or private so that it is not exposed to the outside world.Regards.
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click HERE to participate the survey.- Edited by Fred Bao Tuesday, December 29, 2015 7:30 AM not see there is already a reply and should be an answer
Tuesday, December 29, 2015 2:31 AM