Adding a Merged Dictionary to a Merged Dictionary

后端 未结 3 1633
灰色年华
灰色年华 2020-12-03 01:19

I can\'t seem to be able to add a merged dictionary to a collection of merged dictionaries within XAML.

Theme.xaml



        
3条回答
  •  余生分开走
    2020-12-03 02:15

    Your sample code has a double equal sign in the App.xaml merged resource dictionary source for Palette.Blue.xaml. I'm assuming this is a typo for your example posted here, and not your real problem though.

    It can be tricky to figure out how to link all the resources directly in XAML. The easiest way to do it is from the Resources panel in Blend. I created a Silverlight app with resource files named like your example, then opened the project in Blend and very quickly linked them together.

    App.xaml

    
        
            
                
                    
                    
                
            
        
    
    

    Theme.xaml

    
        
            
            
        
    
    

    Template.xaml

    
        
        
    
    

    Palette.Blue.xaml

    
        
    
    

    MainPage.xaml

    
        
            
            
            
        
    
    

    Of course, if you're linking resources from different assemblies it will look different. Actually, in that case, I'd suggest looking into merging your dictionaries in the code behind.

提交回复
热议问题