モデル要素を表示するためにシルバーライト制御を結合しますか?

StackOverflow https://stackoverflow.com/questions/6403454

質問

私が持っていると言う:

<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にバインドできますか、それともコードビハインドのフープを飛び越えてそれらを結合し続ける必要がありますか?

私はこれがビューモデルをビューにカップルすることを知っていますが、それは正当な理由です。

正しい解決策はありません

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top