【问题标题】:using string values from resources.resx使用 resources.resx 中的字符串值
【发布时间】:2014-12-15 06:56:19
【问题描述】:

我想使用 resources.resx 文件来存储字符串。我在 Properties 中创建了 resources.resx 文件并创建了一个名为 st 的示例字符串。为了使用它,我编写了以下代码-

xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:p="clr-namespace:Brand_Boyz.Properties"

并使用文本块文本值作为

但它给出的错误是 Windows Silverlight 项目不支持静态。 那么如何使用呢?

【问题讨论】:

  • "和使用文本块文本值作为"文本作为什么??

标签: c# xaml windows-phone-8 windows-phone


【解决方案1】:

您可以使用thisthis

TextReader sr = new StringReader("<Root><Child/></Root>");
XElement xmlTree = XElement.Load(sr);
sr.Close();
Console.WriteLine(xmlTree);

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-06-15
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-11-12
    相关资源
    最近更新 更多