Usually WPF controls are designed in a way which doesn't require customer to include any resource dictionaries explicitly. Assembly with WPF controls has ThemeInfo
attribute:
[assembly: ThemeInfo(
ResourceDictionaryLocation.None,
ResourceDictionaryLocation.SourceAssembly
)]
which specifies where to look for default styles, and default styles are written to Themes/Generic.xaml
file.
Anyway, since resource dictionary key is an object
, you can define absolutely unique keys in some internal static class:
internal static class ResourceKeys
{
public static readonly object BooleanToVisibilityConverter = new object();
}
And use them in XAML instead of strings:
<ResourceDictionary xmlns:local="clr-namespace:YOUR_NAMESPACE_HERE">
<BooleanToVisibilityConverter x:Key="{x:Static local:ResourceKeys.BooleanToVisibilityConverter}" />
</ResourceDictionary>