2016-03-03 49 views
0

我有一個應用程序將輕微定製爲不同的租戶(主要服務層和輕的用戶界面變化),所以我設計了一個核心項目與租戶項目必須承繼的基礎應用程序類。所述基本應用程序類具有與一些隱含的應用程序範圍樣式相關聯的應用程序XAML,但是看起來應用程序不會選擇它們,因爲控件以完全本地樣式呈現。Xamarin表單是否支持基本應用程序資源?

它真的不被支持,或者我在這裏做錯了什麼?

這是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> 

BaseATApplication的構造具有所需的InitializeComponent()調用。

回答

0

我認爲,他們需要被明確提到

<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}" /> 
+0

我會嘗試,但它應該撿起來作爲隱含的,而我可能擊中類似https://bugzilla.xamarin.com/錯誤show_bug.cgi?ID = 27659。接得好 – Machinarius

相關問題