开发者

Wpf xaml window errors and warnings

开发者 https://www.devze.com 2023-03-13 20:43 出处:网络
I\'ve added resources to my window1.xaml file using MergedDictionaries like this: <ResourceDictionary.MergedDictionaries>

I've added resources to my window1.xaml file using MergedDictionaries like this:

   <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="\Resources\ListBox.xaml" />
        <ResourceDictionary Source="\Resources\ScrollBar.xaml" />
        <ResourceDictionary Source="\Resources\Button.xaml" />
        <ResourceDictionary Source="\Resources\Slider.xaml" />
      </ResourceDictionary.MergedDictionaries>

I'm getting 4 errors for this code:

Invalid URI: The format of the URI could not be determined.

and 2 Warnings like this:

The file '\Re开发者_C百科sources\Slider.xaml' is not part of the project or its 'Build Action' property is not set to 'Resource'.

The application is running fine and the resource dictionaries' build actions are set to "Resource".

Why am I getting these errors?

Using: vs2010, .net 4 on win7 64bit.


Reverse the backslashes

<ResourceDictionary.MergedDictionaries>
  <ResourceDictionary Source="/Resources/ListBox.xaml" />
  <ResourceDictionary Source="/Resources/ScrollBar.xaml" />
  <ResourceDictionary Source="/Resources/Button.xaml" />
  <ResourceDictionary Source="/Resources/Slider.xaml" />
</ResourceDictionary.MergedDictionaries>
0

精彩评论

暂无评论...
验证码 换一张
取 消