Skip to content

Instantly share code, notes, and snippets.

@amay077
Created July 13, 2016 05:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amay077/a0dbbeeedf7b46b38066d8a2b31605f0 to your computer and use it in GitHub Desktop.
Save amay077/a0dbbeeedf7b46b38066d8a2b31605f0 to your computer and use it in GitHub Desktop.
App.xaml
<Application
xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="WorkingWithStyles.App">
<Application.Resources>
<ResourceDictionary>
<Color x:Key="Color1">#9CC9F5</Color>
<Color x:Key="Color2">#8CC9F5</Color>
<Color x:Key="LabelColor">{StaticResource Color1}</Color>
<Style TargetType="Label">
<Setter Property="TextColor" Value="{StaticResource LabelColor}" />
</Style>
</ResourceDictionary>
</Application.Resources>
</Application>
@amay077
Copy link
Author

amay077 commented Jul 13, 2016

「カラーパレットを定義、各パーツのスタイル色をパレットから選ぶ、ボタンにスタイルを適用」ってのをやりたいのだけど、Xamarin Forms XAML でどうかけばいいか分からない。。。

↑のように書いてみたけど、実行時にエラーになる。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment