Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/wpf/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# WPF中的资源未更新_C#_Wpf_Xaml_Resources_Reload - Fatal编程技术网

C# WPF中的资源未更新

C# WPF中的资源未更新,c#,wpf,xaml,resources,reload,C#,Wpf,Xaml,Resources,Reload,我正在使用这些资源使我的wpf应用程序在其他语言中可用,所以我将其添加到我的 MainWindow.xaml xmlns:p="clr-namespace:MusicApp.Properties" 这是.xaml中的一个示例按钮 Text="{x:Static p:Resources.Test}" 最初,my Resources.resx只有一行: name -> Value Test -> testing 按钮文本“测试”都很好,但现在我将行改为 Prueba ->

我正在使用这些资源使我的wpf应用程序在其他语言中可用,所以我将其添加到我的 MainWindow.xaml

xmlns:p="clr-namespace:MusicApp.Properties"  
这是.xaml中的一个示例按钮

Text="{x:Static p:Resources.Test}"
最初,my Resources.resx只有一行:

name -> Value
Test -> testing
按钮文本“测试”都很好,但现在我将行改为

Prueba -> probando
以及.xaml到:

Text="{x:Static p:Resources.Prueba}"
现在我犯了这个错误(从西班牙语翻译过来,所以可能是错的)

无法访问成员“Prueba”

显然,资源是公共的,但如果我将.xaml改回旧的(带有Test),它仍然可以工作,尽管测试已从资源中删除


我认为Visual studio不是在重新加载表单或其他东西,有什么想法吗?

问题在于您没有绑定值,而只是为文本赋值。。。因此,请尝试下面的

 Text="{Binding Source={x:Static p:Resources.Prueba}}"

现在我在Resources.resx上遇到错误,有没有办法再创建一次?