我的ListBox一个用户控件中有一个,我想在其中获取SelectedItem要在 ViewModel 中使用的 , 。由ListBox组成TextBlocks。
这个问题几乎是对我的问题的直接回答,但我不明白DisneyCharacter(他的收藏类型)来自哪里,或者它与ListBox.
我的会是类型TextBlock吗?
XAMLListBox按要求:
<ListBox Margin="14,7,13,43" Name="commandListBox" Height="470" MinHeight="470" MaxHeight="470" Width="248" >
<TextBlock Text="Set Output" Height="Auto" Width="Auto" />
<TextBlock Text="Clear Output" Height="Auto" Width="Auto" />
<TextBlock Text="Follow Left Tape Edge" Height="Auto" Width="Auto" />
<TextBlock Text="Follow Right Tape Edge" Height="Auto" Width="Auto" />
<TextBlock Text="Follow Tape Center" Height="Auto" Width="Auto" /></ListBox>