MVVMを使用して、テキストファイルをロードし、そのコンテンツを表示しています。
モデル
MyFile.csNameおよびText//INotifyPropertyChangedを実装します
MyFileRepository.cs//ロードしたファイルのコレクション
ViewModel
OpenFileCommandファイルをロードして_filerepositoryオブジェクトに追加するには
FileCollectionそれはビューにバインドされています
意見
Button発射するOpenCommand
ComboBoxロードされたファイルの名前を表示します
TextBox選択したファイルの内容をcombobxで表示します
<Button Name="OpenFile" Command="{Binding OpenFileCommand}">
<ComboBox Name="FilesList" ItemsSource="{Binding Path=FileCollection}" DisplayMemberPath="Name" />
<TextBox Name="FileContent" Text="{Binding the Text of selected file in combobx "/>
combobxで選択したMyFileのTextプロパティをTextBoxにバインドするにはどうすればよいですか?