XAML: The property 'Resources' is set more than once

前端 未结 2 1124
你的背包
你的背包 2021-02-02 05:55

I\'m getting the following error:

The property \'Resources\' is set more than once.

Here is my XAML:



        
2条回答
  •  情话喂你
    2021-02-02 06:49

    The .Resources property in Xaml is clever: it's type ResourceDictionary but, if you don't explicitly put a tag around its content, the compiler will magically assume one for you. That's why you can usually just put your brushes straight into the markup.

    However, you've started off by putting in your own ResourceDictionary - which I suspect has prevented that automatic behaviour - and so the compiler now thinks you're trying to set more than one value. If you rewrite like this you should get the result you're after:

    
        
        
            
            
            
            
            
    
    
            
            
                
            
        
    
    

提交回复
热议问题