Getting System.Windows.ResourceDictionary Warning

WPF Studio, Themes, and Shared Library for WPF Forum

The latest build of this product (v2019.1 build 0686) was released 1 month ago, which was before this thread was created.
Posted 6 days ago by rex hui
Version: 19.1.0686
Platform: .NET 4.8
Environment: Windows 10 (64-bit)

If I have a PropertyGrid set to use display attributes like this:

<grids:PropertyGrid x:Name="xProp">
      <gridseditors:EnumPropertyEditor UseDisplayAttributes="True"/>
public enum FileDoubleClickAction
public class MyClass
   public FileDoubleClickAction DoubleClick { get; set; }
  xProp.DataObject = new MyClass();
  ThemeManager.CurrentTheme = "MetroDark";

If I have the theme set to a non default theme, I am getting this warning when the dialog is opened:

System.Windows.ResourceDictionary Warning: 9 : Resource not found; ResourceKey='PropertyGridPropertyEditorsModifierKey'

Comments (4)

Posted 5 days ago by Actipro Software Support - Cleveland, OH, USA

Hi Rex,

I used the code above but am not seeing that happen, at least with the latest codebase in Visual Studio 2019.  Which exact Actipro WPF Controls version and build are you on, and which Visual Studio?  Your original post said 2019.1 build 686.

The latest codebase does look for that key in PropertyGrid.OnApplyTemplate, but uses TryFindResource.  I wouldn't expect that to raise a "Resource not found" warning ordinarily though.  I even tried setting my VS 2019 "Options / Debugger / Output Window / Resource Dictionaries" entry to "All" and didn't see the warning in the VS Output.

Actipro Software Support

Posted 5 days ago by rex hui

I have the latest 686 code and I tested with both VS 2017 and 2019 both produce the same warning. I have the Debugging setting for "Resource Dictionaries" set to Warning. I am not sure why you are not able to get that.

Should I send my project in a zip file to support?

Posted 5 days ago by Actipro Software Support - Cleveland, OH, USA

I'm not sure why I'm not seeing it either.  You should be able to eliminate the warning by putting this in your Application.Resources:

<grids:PropertyGridPropertyEditorsModifier x:Key="{x:Static grids:PropertyGrid.PropertyEditorsModifierKey}" />

The lookup is basically trying to see if any global property editor modifiers have been supplied.  The above code should supply an "empty" modifier, but at least the resource will then be found.

Actipro Software Support

Posted 4 days ago by rex hui

Yeah, that fixed it. Thank you!

Add Comment

Please log in to a validated account to post comments.