1

私が持っているとしましょう:

<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?
}

コントロールのインスタンスを ViewModel にバインドできますか、それともコード ビハインドのフープをジャンプして結合し続ける必要がありますか?

これが ViewModel を View に結合していることは知っていますが、それには正当な理由があります。

4

1 に答える 1

0
<ContentControl Content="{Binding TextBlock}" />
于 2011-06-19T15:57:53.393 に答える