【发布时间】:2017-11-18 02:09:09
【问题描述】:
我有这样的资源。
<ContentView.Resources>
<ResourceDictionary>
<x:String x:Key="LabelAutomationIdentifier">LBL_PD_L_PLV_LV_</x:String>
</ResourceDictionary>
</ContentView.Resources>
我需要像这样在Label的AutomationId属性中使用这个资源
<Label AutomationId="{StaticResource LabelAutomationIdentifier} + LabelName" />
但是,这是不正确的。我尝试了多种方法,但没有运气。
我试过了,
<Label AutomationId="{Binding Source={StaticResource LabelAutomationIdentifier}, StringFormat='{}{0}LabelName'}" />
还有
<Label AutomationId="{StaticResource LabelAutomationIdentifier, StringFormat='{0}LabelName'}" />
【问题讨论】:
-
你尝试了什么?所以我们不会在我们的建议中重复相同的内容
-
@GeraldVersluis 更新了问题。
标签: xaml xamarin xamarin.forms staticresource