I am trying to list a resource in XAML as follows:
<UserControl.Resources>
<StaticResourceExtension x:Key="newName" ResourceKey="oldName"/>
</UserControl.Resources>
oldNamejust refers to a resource of the type Imagedefined in App.xaml.
As far as I understand, this is the right way to do this, and it should work fine. However, the XAML code gives me a superbly useless error:
"The application XAML file failed to load. Fix errors in the application XAML before opening other XAML files."
This appears when I hover over a line StaticResourceExtensionin the code (which has an underlined underline). A few other errors are generated in the actual error list, but they seem rather irrelevant and obscene (messages such as "InitializeComponent name" do not exist in the current context "), since they all disappear when a line is deleted.
I'm completely here. Why is WPF complaining about this code? Any ideas regarding permission please?
. WPF .NET 3.5 SP1.
1:
, ( ), .
2:
...
App.xaml( Application.Resource):
<Image x:Key="bulletArrowUp" Source="Images/Icons/bullet_arrow_up.png" Stretch="None"/>
<Image x:Key="bulletArrowDown" Source="Images/Icons/bullet_arrow_down.png" Stretch="None"/>
MyUserControl.xaml( UserControl.Resources):
<StaticResourceExtension x:Key="columnHeaderSortUpImage" ResourceKey="bulletArrowUp"/>
<StaticResourceExtension x:Key="columnHeaderSortDownImage" ResourceKey="bulletArrowDown"/>
, , .