好的,我在MyProp
类中有这样的属性MyClass
:
public string MyProp
{
get
{
if (App.localSettings.Containers.ContainsKey(nameof(MyClass)) && App.localSettings.Containers[nameof(MyClass)].Values.ContainsKey(nameof(MyProp)))
return App.localSettings.Containers[nameof(MyClass)].Values[nameof(MyProp)].ToString();
return default(string);
}
private set
{
App.localSettings.Containers[nameof(MyClass)].Values[nameof(MyProp)].ToString();
}
}
但我如何才能使我return
看起来像这样:
return default(typeof(MyClass).GetProperty(nameof(MyProp)).PropertyType);
我在Windows Runtime下运行。