Visual Studio Generic Application Resource Not Found If in Public Folder

This problem mainly bothers some, as the Visual Studio IDE tells me that it cannot find the resource, but when I create the application, I have no problems.

In my Visual Studio, I have the following: enter image description here

Here is an example of my universal application architecture:

Example.windowsPhone

->MainPage.xaml 

Example.Share

 -> Style.xaml -> App.Xaml has Style.xaml referenced 

Eventhought I have a DmBlueBrush link on my style page, for example:

  <SolidColorBrush x:Key="DmBlueBrush" Color="{StaticResource DmBlue}" /> 

In Visual Studio, he will tell me that he cannot find it, but when I create the application, he will find this resource. Don't I refer to something correctly for my IDE to work?

I am using Visual Studio 2013 Professional Version 12.0.31101.00 Update 4.

Change 1:

in App.xaml in Shared I Have:

 <Application xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" > <Application.Resources> <ResourceDictionary> <ResourceDictionary.MergedDictionaries> <ResourceDictionary Source="Theme/Styles.xaml"/> <ResourceDictionary Source="Theme/Other.xaml"/> </ResourceDictionary.MergedDictionaries> </ResourceDictionary> </Application.Resources> </Application> 
+7
c # visual-studio xaml win-universal-app
source share
2 answers

The problem is that you need to combine ResourceDictionary directly from another ResourceDictionary, instead of including them in App.xaml.

See the full example here: http://blog.craftingbytes.com/2015/05/resource-sharing-in-windows-universal.html

0
source share

Have you linked your resource dictionary?

Right-click General Project> Add> New Item> Resource Dictionary

In this example, they called it MyStyles.xaml

Then in the App.xaml link

 <Application x:Class="YOUR_CLASS.App" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="using:YOUR_CLASS"> <Application.Resources> <ResourceDictionary Source="MyStyles.xaml"></ResourceDictionary> </Application.Resources> </Application> 

MyStyles.xaml example

 <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="using:YOUR_CLASS"> <SolidColorBrush x:Key="MyGreen" Color="Green"/> </ResourceDictionary> 
+1
source share

All Articles