Search code examples
xamlwindows-8windows-phone-8

How to use x:Uid in windows phone 8?


We can use x:Uid in windows-8 as

Where in .resw I have define mainTitle.Text = "Your Name"

In this way TextBlock's text becomes Your Name.

How can I achieve the same in windows phone 8?

When I put mainTitle.Text in .resx it gives error.


Solution

  • You can use binding here

    <TextBlock Text="{Binding Path=LocalizedResources.ApplicationTitle, Source={StaticResource LocalizedStrings}}"/>
    

    For more about localization read How to build a localized app for Windows Phone

    And to know about x:Uid read x:Uid Directive