开发者

Wpf xaml window errors and warnings

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜