wpf propertyGrid

前端 未结 4 1899
逝去的感伤
逝去的感伤 2021-01-06 03:39

I need a propertyGrid for my WPF application . after lots of searches I have found this I have added the assembly (exe file) when I add the propertyGrid to my form and I run

4条回答
  •  遥遥无期
    2021-01-06 03:58

    This is due to a bug in the WPFPropertyGrid code.

    It appears from his ThemeInfoAttribute that the author of that code intended to use a generic theme, but he mistakenly put his resources in the file "Themes/default.xaml" instead of "Themes/generic.xaml". Because of this the resources were not automatically loaded. He worked around the bug by loading the resources manually from his App.xaml.

    When you referenced his .exe from yours, his App.xaml wasn't loaded so his workaround wasn't activated.

    The best solution is to correct the filename in the original code to "Themes/generic.xaml". If that is not possible, the second-best solution is to manually load the resources from your App.xaml:

      
    
        
          
            
          
        
    
      
    

    Or if you prefer, you can put this in a tag in your window.

    Note that the above XAML assumes other resources will be used so a merge will be necessary. If not, you can skip the steps of creating a seperate dictionary and merging, and instead just set the WPGDemo dictionary as your App or Window dictionary.

    Have a great day!

提交回复
热议问题