question

ApptacularApps-8305 avatar image
0 Votes"
ApptacularApps-8305 asked ·

String appearing blank when trying to use it in 2 different components

I'm trying to use the same string resource for 2 different components but they both appear blank. How can this problem be fixed?

Resources.resw

  • ContactUs.Label - Contact Us

  • ContactUs.Text - Contact Us

Main page

         <AppBarButton Name="AppBarButtonContactUs" x:Uid="ContactUs.Label"/>

2nd page

         <TextBlock x:Uid="ContactUs.Text" Style="{StaticResource HeaderTextBlockStyle}" />
windows-uwpwindows-uwp-xaml
· 1
10 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi, can the following method help? If they can't, can you show some details about the problem what you have encountered?

0 Votes 0 ·
mrlacey avatar image
0 Votes"
mrlacey answered ·

Set the Uid of both to be "ContactUs".

Have two resource entries
"ContactUs.Label" and "ContactUs.Text" which both have the same value.

· 1
10 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

That didn't work for some reason. I got this error: Unable to resolve property 'Text' while processing properties for Uid 'ContactUs'.

0 Votes 0 ·
danielescipioni avatar image
1 Vote"
danielescipioni answered ·

The reason of "Unable to resolve property 'Text' while processing properties for x:Uid 'ContactUs'." is that AppBarButton has x:Uid ContactUs but no property Text, the x:Uid must be different if the target property is different.

You can do like that:

<TextBlock x:Uid="ContactUs_Text" />
<AppBarButton x:Uid="ContactUs_Label" />

and in Resource.resw

9245-resources.png



resources.png (10.7 KiB)
10 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.