Add ResourceDictionary to class library

后端 未结 7 1885
旧巷少年郎
旧巷少年郎 2020-12-14 01:53

I created a class library which is contained of WPF Windows and some user controls inherited from my c# classes that helps me to customize certain wpf controls.

Now

7条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-14 02:22

    To transform a classical library project to a WPF library project (in order to add UserControls, Windows, ResourcesDictionaries, etc.) you can add the following XML in the .csproj file in the first PropertyGroup Node :

    {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
    

    Full example :

    
    
      
        
          Debug
          AnyCPU
          {50E8AAEA-5CED-46BE-AC9A-B7EEF9F5D4C9}
          Library
          Properties
          WpfApplication2
          WpfApplication2
          v4.6.1
          512
          {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
          4
          true
          
        
            
    

提交回复
热议问题