I have a ListBox
in one of my user controls in which I would like to get the SelectedItem
, to be used in the ViewModel. The ListBox
is composed of TextBlocks
.
This question is pretty much a straight up answer to my question, but I don't understand where DisneyCharacter
(his collection type) comes from, or how it relates to the ListBox
.
Would mine be of type TextBlock
?
XAML for ListBox
as requested:
<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>