如何以编程方式为 Metro 应用程序控件设置 control x:Uid 属性? [英] How to set control x:Uid attribute programmatically for a metro app control?

查看:29
本文介绍了如何以编程方式为 Metro 应用程序控件设置 control x:Uid 属性?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要以编程方式设置某些控件的 x:Uid 属性吗?此属性用于本地化.

I need to set the x:Uid attribute of some control programmatically? this attribute is used for localization.

推荐答案

我不是很擅长这个话题,但是如果我们谈论的是同一件事,你可以在这里看到:BamlLocalizableResourceKey.Uid 属性

I am not really strong on this subject but if we are talking about the same thing, as you can see here: BamlLocalizableResourceKey.Uid Property

public 属性只有一个 get,因此您无法从 C# 代码中轻松更改它.

the public property has only a get, so you can't change it easily from C# code.

public string Uid { get; }

查看更多 x:Uid Directive 以了解此属性设置为指令,与 XAML 中的其他属性不同.

see more x:Uid Directive to find out that this property is set as directive and not like other attributes in XAML.

这篇关于如何以编程方式为 Metro 应用程序控件设置 control x:Uid 属性?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆