あなたが何をしたい達成するために、{ThemeResource}マークアップ拡張機能を使用することができます。あなたのPage.xamlをで :
<Page.Resources>
<ResourceDictionary>
<ResourceDictionary.ThemeDictionaries>
<ResourceDictionary Source="Dictionary2.xaml" x:Key="Dark"/>
<ResourceDictionary Source="Dictionary1.xaml" x:Key="Light"/>
</ResourceDictionary.ThemeDictionaries>
</ResourceDictionary>
</Page.Resources>
<StackPanel>
<TextBlock Text="{ThemeResource txt}"/>
</StackPanel>
Dictionary1.xaml:
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:Styles">
<x:String x:Key="txt">Light</x:String>
</ResourceDictionary>
Dictionary2.xaml:
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:Styles">
<x:String x:Key="txt">Dark</x:String>
</ResourceDictionary>
あなたはライト/ダークにまたはとしてのTextBlockのテキストを設定しますかこの質問の答えは? – AVK
@AVKNaiduはいたとえば –
テキストをテキストブロックに設定する方法に関する完全なコードを表示できますか? – AVK