У меня есть файл ресурсов (с именем StringResources
) в проекте xyz.mvvm.res
(res - это папка).xaml x: static не может найти пространство имен
<Window x:Class="xyz.MVVM.Views.ReadAllReportWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
mc:Ignorable="d" d:DesignHeight="300" d:DesignWidth="300"
xmlns:resources="clr-namespace:xyz.MVVM.res;assembly=xyz.MVVM"
Title="{x:Static resources:StringResources.Window_Title}"
WindowStartupLocation="CenterScreen">
<Grid>
</Grid>
</Window>
Я получаю сообщение об ошибке
"The name "StringResources" is not available in the Namespace "clr-namespace:xyz.MVVM.res;assembly=xyz.MVVM".
resourcefile установлен на публике! I'am отчаянный ..
Edit: StringResources.Designer.cs:
namespace xyz.MVVM.res {
using System;
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
public class StringResources {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal StringResources() {
}
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
public static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("TimeRecordReader.MVVM.res.StringResources", typeof(StringResources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
public static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
public static string Window_Title {
get {
return ResourceManager.GetString("Window_Title", resourceCulture);
}
}
}
}
Можете ли вы показать декларацию 'StringResources' (включить пространство имен и' Window_Title' - нет необходимости в ot ее свойства). Этот проект ссылается на «xyz», или это тот же проект? –
@CharlesMager Я добавил его выше –