Reputation: 33
I am not able to access static resources that created in app.xaml. its my app.xaml code
<Application.Resources>
<ResourceDictionary>
<Color x:Key="AppDefaultColor">#07bab7</Color>
<Color x:Key="PageDefaultColor">#f0f0f0</Color>
</ResourceDictionary>
</Application.Resources>
when i try to use this in my page as static resource it gives error. its my page code which i used to access static resource from app.xaml
<Label Text="Test" TextColor="{StaticResource AppDefaultColor}" />
Upvotes: 3
Views: 807
Reputation: 643
Please Check that your app.xaml.cs class call InitializeComponent() method. In the App constructor which is required when creating the App.xaml and associated code behind.
Please look into picture
Upvotes: 2