Xaml Xamarin表单是否支持基本应用程序资源?

Xaml Xamarin表单是否支持基本应用程序资源?,xaml,xamarin.forms,Xaml,Xamarin.forms,我有一个应用程序,可以为不同的租户(主要是服务层和轻UI更改)轻松定制,因此我设计了一个核心项目,其中包含租户项目必须继承的基本应用程序类。所述基本应用程序类有一个关联的应用程序XAML,其中包含一些隐式应用程序范围的样式,但应用程序似乎没有拾取这些样式,因为控件以完全本机样式呈现 是真的不支持还是我做错了什么 这是XAML <Application xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://

我有一个应用程序,可以为不同的租户(主要是服务层和轻UI更改)轻松定制,因此我设计了一个核心项目,其中包含租户项目必须继承的基本应用程序类。所述基本应用程序类有一个关联的应用程序XAML,其中包含一些隐式应用程序范围的样式,但应用程序似乎没有拾取这些样式,因为控件以完全本机样式呈现

是真的不支持还是我做错了什么

这是XAML

<Application
    xmlns="http://xamarin.com/schemas/2014/forms"
    xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
  xmlns:branding="clr-namespace:AT.UI.Common.Branding;assembly=AT.UI.Common"
    x:Class="AT.UI.Common.BaseATApplication">

  <!-- TODO: Find out how to make this work for subclasses -->
  <Application.Resources>
    <ResourceDictionary>
        <Style TargetType="Button">
          <Setter Property="BackgroundColor" Value="{x:Static branding:UIBranding.StandbyButtonBackgroundColor}" />
          <Setter Property="TextColor" Value="{x:Static branding:UIBranding.ButtonForegroundColor}" />
        </Style>
      </ResourceDictionary>
  </Application.Resources>
</Application>


BaseAApplication的构造函数具有所需的InitializeComponent()调用。

我认为需要显式引用它们

<Style x:Key="ButtonStyle" TargetType="Button">
          <Setter Property="BackgroundColor" Value="{x:Static branding:UIBranding.StandbyButtonBackgroundColor}" />
          <Setter Property="TextColor" Value="{x:Static branding:UIBranding.ButtonForegroundColor}" />
</Style>

<Button Style="{StaticResource ButtonStyle}" />

我会尝试,但它应该会将它们视为隐式的,但我可能遇到了类似的错误。抢手货