title | author | date | CreateTime | categories |
win10 uwp 从Type使用构造 | lindexi | 2018-2-13 17:23:3 +0800 | 2018-2-13 17:23:3 +0800 | Win10 UWP |
本文主要:如何从 Type new一个对象
原本从 WPF ,要想 new 一个对象从 type ,可以使用type.Assembly.CreateInstance(type.FullName);
但是在 UWP ,需要使用type.GetConstructor(Type.EmptyTypes).Invoke(parameters);
多谢 durow ,找了很久在他写的 刚好有这个