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

asked 2020-06-05T14:02:26.617+00:00
Apptacular Apps 386 Reputation points

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}" />
Universal Windows Platform (UWP)
{count} votes

2 answers

Sort by: Most helpful
  1. answered 2020-06-05T14:49:20.82+00:00
    Daniele 1,991 Reputation points

    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

    No comments

  2. answered 2020-06-05T14:04:51.327+00:00
    Matt Lacey 786 Reputation points Microsoft MVP

    Set the Uid of both to be "ContactUs".

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