Binding Silverlight UserControl custom properties to its' elements

后端 未结 6 595
长情又很酷
长情又很酷 2021-02-05 09:59

I\'m trying to make a simple crossword puzzle game in Silverlight 2.0. I\'m working on a UserControl-ish component that represents a square in the puzzle. I\'m having trouble wi

6条回答
  •  盖世英雄少女心
    2021-02-05 10:43

    As Silverlight cannot use FindAncestor technique you can use a trick similar to the one that sets the UserControl's name, but without breaking its functionality by using the name of the LayoutRoot...

    
        
            
                
                
            
    
            
                
                
            
    
            
            
        
    
    

    It worked in SL3 without having to add any additional code (I'm using it in a WP7 app), but don't know if you can use it in SL2. Well, I realize now how this question is old, hope it's still helpful, I've arrived here because the answers I got for the same problem in WP7 didn't convince me.

提交回复
热议问题