Each Dictionary entry must have an associated key attribute

后端 未结 1 1134
遇见更好的自我
遇见更好的自我 2020-12-16 09:56

I am programming w Windows 8.1 App using C# and the MVVM-Light Toolkit from GalaSoft.

All I have is the code below:


            


        
1条回答
  •  清歌不尽
    2020-12-16 10:18

    Note that Application.Resources requires an instance of ResourceDictionary, so you have to do something like this:

        
      
        
        
            
        
            
    
    

    So it's not strange at all, it's also not a bug. If you want your ResourceDictionary to be treated as a resource, you of course have to provide some Key for it, however in this case you really want to assign an instance of ResourceDictionary to the Application.Resources

    0 讨论(0)
提交回复
热议问题