1 回答

TA貢獻1770條經驗 獲得超3個贊
不幸的是,Xamarin 不能使用 WPF 的 ResourceDictionary。
您可以創建和使用 Xamarin 的 ResourceDictionary,如下所示。
<Application ...>
? ? <Application.Resources>
? ? ? ? <ResourceDictionary>
? ? ? ? ? ? <Color x:Key="PageBackgroundColor">Yellow</Color>
? ? ? ? ? ? <Color x:Key="HeadingTextColor">Black</Color>
? ? ? ? ? ? <Color x:Key="NormalTextColor">Blue</Color>
? ? ? ? ? ? <Style x:Key="LabelPageHeadingStyle" TargetType="Label">
? ? ? ? ? ? ? ? <Setter Property="FontAttributes" Value="Bold" />
? ? ? ? ? ? ? ? <Setter Property="HorizontalOptions" Value="Center" />
? ? ? ? ? ? ? ? <Setter Property="TextColor" Value="{StaticResource HeadingTextColor}" />
? ? ? ? ? ? </Style>
? ? ? ? </ResourceDictionary>
? ? </Application.Resources>
</Application>
- 1 回答
- 0 關注
- 153 瀏覽
添加回答
舉報