Use VS string resources in XAML

Ribbon for WPF Forum

Posted 14 years ago by Mina
Version: 9.2.0515
Avatar
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?
Thanks!

-Maggie.

Comments (2)

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

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


Actipro Software Support

Posted 14 years ago by Mina
Avatar
Oops.. yes, thank you!
The latest build of this product (v24.1.2) was released 2 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.