Set static resource in code

前端 未结 3 466
粉色の甜心
粉色の甜心 2021-02-05 07:20

I have a few styles in my App.xaml file:




        
3条回答
  •  爱一瞬间的悲伤
    2021-02-05 07:51

    If I understand correctly, you are wanting to set up a style that allows you to only change specific stackpanels, so you don't have to set them all. Give this suggestion a try (note: it is a suggestion and I have not tested it, but hopefully it is in the right direction)

    
    
    
    
    
    
    
    

    Or try TemplateBinding instead of Binding, like I said it is a suggestion and I haven't tested it. This would give you a binding for the background, and a fallback value for a stackpanel that you haven't set a background color for. Let me know how or if this works for you :)

提交回复
热议问题