Merged Dictionaries in the App.xaml
At first, my window1.xaml displays fine in the designer.
In Application.xaml, I add a ResourceDictionary.
Code Snippet
<!-- change this comment to fix designer -->
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries> <ResourceDictionary Source="themes/test.aero.normalcolor.xaml"/> </ResourceDictionary.MergedDictionaries> </ResourceDictionary></Application.Resources>
After I build (or rebuild), the Design tab of Window1.xaml displays Whoops, and the following error is listed:
Value 'themes/test.aero.normalcolor.xaml' cannot be assigned to property 'Source'. ResourceDictionary LoadFrom operation failed with URI 'winfxprojectresource:///C:/Documents and Settings/Andrew/My Documents/Workstation/themes/test.aero.normalcolor.xaml?5/11/2007 4:46:20 PM;themes/test.aero.normalcolor.xaml'.
If I change anything about the application.xaml file , even just the comment, then Window1.xaml will redisplay in the Design tab. But every time i rebuild, the same Whoops reappears.
Any ideas?
Andrew
btw:
I am using C# Orcas beta 1
I have checked out all the "Load limitations" at the Cider Wiki.
If you converted your project from VS2005 to Orcas, you'll find that the Custom Tool property for the Application.xaml file is not set but it needs to be. Orcas apparently uses this custom tool attribute to manage files at design time but I don't know the specifics. In any case, select your Application.xaml file and in the properties panel, set the Custom Tool property to MSBuild:Compile. This should solve your problem.
Note 1: I believe you need to set this property on all .XAML files in your project or you'll be missing intellisense in codebehind, etc. until the project is built...
Note 2: If you create a new WPF Application in Orcas, you'll see that this property is already set for you on XAML files.
I've downloaded one of the examples from the web, Family.show, and I've tried to play with it in Orcas beta 1. I can't get any of the CIDR pages to load. I've been having pretty much the same issues as the origional post. I've added the MSBuild:Compile to all XAML pages, but it doesn't seem to work. I see that creating a new project sets the property correctly, but is there a way to make a converted project work? Thanks in advance.
I'm also seeing this problem. My App.xaml looks like this:
<
Application x:Class="
MyApp"
xmlns="
http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="
http://schemas.microsoft.com/winfx/2006/xaml"
Startup="
AppStartup"
Exit="
AppExit"
> <
Application.Resources> <
ResourceDictionary> <
ResourceDictionary.MergedDictionaries> <
ResourceDictionary Source="
Resources\AppStyles.xaml"
/> <
ResourceDictionary Source="
Resources\SimpleStyles.xaml"
/> <
ResourceDictionary Source="
Resources\Shared.xaml"
/> <
ResourceDictionary Source="
Resources\ScrollBar.xaml"
/> <
ResourceDictionary Source="
Resources\ResizeGrip.xaml"
/> </
ResourceDictionary.MergedDictionaries> </
ResourceDictionary> </
Application.Resources> </
Application> Visual Studio won't open any of my controls in the designer, giving me the warning:
Error 1 Value 'Resources\AppStyles.xaml' cannot be assigned to property 'Source'. C:\MyApp\App.xaml 12 31 MyApp
Note that this doesn't effect compilation -- just the designer. Does anyone have a workaround?
Many thanks.
Drew.