I have defined my resourceDictionary in a separate library as below
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:cultures="clr-namespace:My_Localization.Cultures"
xmlns:properties="clr-namespace:My_Localization.Properties">
<ObjectDataProvider x:Key="Resources" ObjectType="{x:Type cultures:CultureResources}" MethodName="GetResourceInstance"/>
<ObjectDataProvider x:Key="CultureResourcesDS" ObjectType="{x:Type cultures:CultureResources}"/>
</ResourceDictionary>
I have used this library from another library as below (Header of xaml only)
<msRibbon:RibbonTab x:Class="Ribbon.Planner.PlannerRibbon"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:msRibbon="clr-namespace:Microsoft.Windows.Controls.Ribbon;assembly=RibbonControlsLibrary"
mc:Ignorable="d"
d:DesignHeight="100" d:DesignWidth="500" Header="{Binding Path=Ribbon_About, Source={StaticResource Resources}}"
>
<Grid>
...
...
...
</Grid>
I have added the reference of My_Localization lib and I am only changing the header. All works fine but the only problem is that in design time I have "Header="{Binding Path=Ribbon_About, Source={StaticResource Resources}}" underlined. When I hover my mouse there is hint "The resource "Resources" could not be resolved"
Why is there an error like hint in my xaml? and then why does it all work fine?
My Solution structure
- MainExe - Contains app.xaml. I have merged the resource dictionary here. No problems in xaml since the merge dictionary exists in app.xaml
- My_Localization - Lib containing the resource dictionary (code above)
- Lib1 - References My_Localization and there are problems in xaml as explained
- Lib2 - References My_Localization and there are problems in xaml as explained
- Lib3 - References My_Localization and there are problems in xaml as explained