Use VS string resources in XAML

Ribbon for WPF Forum

Posted 9 years ago by Mina
Version: 9.2.0515
Hi, I was able to create a ribbon button with the follwing line...
<ribbon:Button Label="Open" Command="MyAppCommands.Open"/>

Now I am trying to use the VS's string resources feature (Resources.resx) to replace the Label (for the localization purpose). I replaced the above code with the following line...
<ribbon:Button Label="{x:Static properties:Resources.MyOpenString}" Command="MyAppCommands.Open"/>
But then I got this error...
"Unknown build error, 'Key cannot be null, Parameter name: key Line xx Position xx.'"

Can I refer the resource in the XAML like that? Any idea?


Comments (2)

Posted 9 years ago by Actipro Software Support - Cleveland, OH, USA
Hi Maggie,

That error probably means that your "properties" xmlns isn't defined.

Actipro Software Support

Posted 9 years ago by Mina
Oops.. yes, thank you!
The latest build of this product (v2019.1 build 0681) was released 1 month ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.