如何在 Windows 通用应用资源中定义 XAML 边距?我试图将其定义为
<Thickness x:Key="MyMargin" Left="10" Top="20" Right="10" Bottom="20" />
Run Code Online (Sandbox Code Playgroud)
由此无法编译,我得到
XamlCompiler 错误 WMC0100:无法构造 XAML Thickness 类型。为了在 XAML 中构造,类型不能是抽象、接口、嵌套、泛型或结构,并且必须具有公共默认构造函数