現在、作業中の Win8 アプリにある種のカラー テーマ機能を追加しようとしています... vm からバインディングを作成しましたが、すべてが静的 UI 要素に対して正常に機能します。しかし、私はいくつかのメモ (私のモデル) を DB に追加しています。それらは画面にも GridView に表示されます。
しかし、GridView ItemTemplate の宣言された DataTemplate では、Color Binding はまったく機能しません...
私のテンプレートは次のようになります:
<Grid Grid.Row="3" HorizontalAlignment="Left" Width="200" Height="200">
<Grid.RowDefinitions>
<RowDefinition Height="100"/>
<RowDefinition Height="60"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Border Grid.Row="0" Background="Lavender" Opacity="50"/>
<ScrollViewer Grid.Row="0">
<TextBlock Grid.Row="0" Text="{Binding Content}" Foreground="DodgerBlue" />
</ScrollViewer>
<Border Grid.Row="1" Background="DodgerBlue" Opacity="70"/>
<ScrollViewer Grid.Row="1">
<TextBlock Grid.Row="1" Text="{Binding Subject}" Foreground="LightBlue" />
</ScrollViewer>
<Border Grid.Row="2" Background="DodgerBlue" Opacity="70"/>
<TextBlock Grid.Row="2" Text="{Binding Importance}" Foreground="Black" FontSize="{StaticResource ComboBoxArrowThemeFontSize}" />
</Grid>
私が試したのは単にtoの代わりでしForeground="DodgerBlue"
たForeground="{Binding ColorTheme}"
が、効果SolidColorBrush
がなく、vmから取得されませんでした....
これに対する回避策はありますか?
よろしくお願いします。