I'm trying to set the title of my window to a value in resources.resx. I know I can set it in the code behind but I'm sure it must be possible to set it in the Xaml.

Here's my best attempt to date.

<Window x:Class="TitleResources.Window1"



xmlnsStick out tongueroperties="clr-namespace:TitleResources.Properties"

Title="{xTongue Tiedtatic properties:Resources.MyWindowTitle}"

Height="300" Width="300"





Can anyone spot what I've done wrong or point me in the right direction


Re: Windows Presentation Foundation (WPF) Set Window Title to resources value

Ivan Shumilin

Resources class and MyWindowTitle property should be public.

For VS2005 you can use

For Orcas Beta 1:
Resources.resx - set
Access Modifier to public (or set Custom Tool to PublicResXFileCodeGenerator)

From readme:

1.3.73. Access Modifier ¡®Public¡¯ is not working in the managed resource editor

After you set the Access Modifier drop-down in the resource editor for a .resx file or for the Resources project properties page, you receive one of the following warnings in the task list:

* Cannot find custom tool 'PublicVbMyResourcesResXFileCodeGenerator' on this system.
* Cannot find custom tool 'PublicResXFileCodeGenerator' on this system. In addition, the resources are not publicly available outside of the assembly.

To resolve this issue:

1. Create a file on your computer named ¡°FixPublicRes.reg¡± and then add the following contents to it:

Windows Registry Editor Version 5.00

"Assembly"="Microsoft.VisualStudio.Design, Version=, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
"ThreadingModel"="Both" @="Microsoft.VisualStudio.Design.Serialization.PublicVBMyResXFileCodeGenerator"

"Assembly"="Microsoft.VisualStudio.Design, Version=, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
"ThreadingModel"="Both" @="Microsoft.VisualStudio.Design.Serialization.PublicResXFileCodeGenerator"

2. Click Start, and then click Run. Type <Path where you saved the file>\FixPublicRes.reg and then click OK.
3. You will be asked whether you want to add the information from FixPublicRes.reg into the registry. Click Yes.
4. In Solution Explorer, right-click the .resx file, and then click Run Custom Tool.

Re: Windows Presentation Foundation (WPF) Set Window Title to resources value


Thanks Ivan,

Your help is very much appreciated.