xaml - How to use x:Uid in windows phone 8? -


we can use x:uid in windows-8 as

where in .resw have define maintitle.text = "your name"

in way textblock's text becomes your name.

how can achieve same in windows phone 8?

when put maintitle.text in .resx gives error.

you have use binding in windows phone 8.

the simple way see in action create new project , take @ mainpage.xaml. binding demonstrated in following comment

for example:

text="{binding path=localizedresources.applicationtitle, source={staticresource localizedstrings}}" 

to localize text, bind localizedstrings class (created project) wraps static resource file.

<textblock text="{binding path=localizedresources.applicationtitle, source={staticresource localizedstrings}}" /> 

the localizedstrings resource there in app.xaml

<local:localizedstrings x:key="localizedstrings"/> 

Comments

Popular posts from this blog

android - getbluetoothservice() called with no bluetoothmanagercallback -

sql - ASP.NET SqlDataSource, like on SelectCommand -

ios - Undefined symbols for architecture armv7: "_OBJC_CLASS_$_SSZipArchive" -