In WPF, is there a way to bind to sibling properties?

后端 未结 2 513
轻奢々
轻奢々 2020-12-28 15:14

I have a series of TextBlock and TextBox controls. Is there a way to apply a Style to the TextBlocks such that they can

2条回答
  •  感情败类
    2020-12-28 15:48

    I think the best thing to do in this case is bind by ElementName:

    
    this is the textBox's 1 text
    
    this is the textBox's 2 text
    

    It will achieve something similar. Does this work for you?

提交回复
热议问题