gpt4 book ai didi

c# - Xelement 不是有效的 Windows 运行时类型

转载 作者:太空宇宙 更新时间:2023-11-03 13:58:26 26 4
gpt4 key购买 nike

我正在将 Windows Phone 7 应用程序移植到 Windows 运行时。在我的 wp7 应用程序中,我有:

public sealed class Packet
{
public XElement _element;

public Packet(XElement element)
{


}
}

它表示 XElement 未被识别为有效的 Windows 运行时类型。

请任何人解释为什么会这样。

最佳答案

Windows 运行时组件公开的类型必须是 Windows 运行时类型 ...

在外部,您的类型的成员只能为其参数和返回值公开 Windows 运行时类型。

... 来自 Creating Windows Runtime Components in C# and Visual Basic .

关于c# - Xelement 不是有效的 Windows 运行时类型,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11408377/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com