简体   繁体   English

直接本地化到Windows Phone上的xaml代码?

[英]Localization directly to xaml code on windows phone?

How can I bind value from my resources files (es,en resources) to a element on page like text blocks and so on. 如何将资源文件(es,en resources)中的值绑定到页面上的元素(如文本块等)。

I've found this tutorial but in this case is using C#, I want to do it but just put some binding on the element markup not coding. 我已经找到了这个教程,但在这种情况下是使用C#,我想这样做,但只是对元素标记进行了一些绑定而不是编码。

That page clearly shows how to associate controls to resources: 该页面清楚地显示了如何将控件与资源相关联:

You need to associate every control that needs localized text with the .resw file. 您需要将需要本地化文本的每个控件与.resw文件相关联。 You do this using the x:Uid attribute on your XAML elements like this 您可以使用XAML元素上的x:Uid属性执行此操作

<TextBlock x:Uid="Greeting" Text="" />

Have you tried it? 你试过吗?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM