문제

Say I have:

<TextBlock Text="{Binding MyString}"/>

public class AlanViewModel {
  public string MyString {get; set;}
  public TextBlock Control { get; set; } //How to bind this to the TextBlock control?
}

Can I bind the instance of the control to the ViewModel, or must I continue to jump through hoops in the code-behind to couple them together?

I know this couples the ViewModel to the View, but it's for a good reason.

올바른 솔루션이 없습니다

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top