我在几个页面上使用 Microsoft 的 AdControl ......但为了简化它,我想存储一次 ApplicationId 并将其作为资源读取。
是否可以在 App.xaml 中使用,然后在控件中设置绑定?但是怎么做?
我在几个页面上使用 Microsoft 的 AdControl ......但为了简化它,我想存储一次 ApplicationId 并将其作为资源读取。
是否可以在 App.xaml 中使用,然后在控件中设置绑定?但是怎么做?
"{StaticResource name}"
像你一样使用<Page.Resources>
要存储资源,请创建一个新<ResourceDictionary>
in<ResourceDictionary.MergedDictionaries>
并将您的资源放入其中。
例如:
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<!--
Styles that define common aspects of the platform look and feel
Required by Visual Studio project and item templates
-->
<ResourceDictionary Source="Common/StandardStyles.xaml"/>
<ResourceDictionary>
<x:String x:Key="Foo">Bar</x:String>
</ResourceDictionary>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>