I am new to WPF. I want to know how can i get the selectedtext if the text that i want is placed inside a control inside comboboxitem and not directly inside comboboxitem. I know this is very basic,but would appreciate if someone could provide me a simple and quick solution
My simple combobox code is as follows:
<ComboBox x:Name="cmdTest">
<ComboBoxItem>
<TextBlock Text="RED" Background="RED" Foreground="White" FontFamily="Sans Serif" FontSize="14"/>
</ComboBoxItem>
<ComboBoxItem>
<Grid Width="250">
<TextBlock Text="GREEN" Background="GREEN" Foreground="White" FontFamily="Sans Serif" FontSize="14" Height="15"/>
</Grid>
</ComboBoxItem>
<ComboBoxItem>
<TextBlock Text="BLUE" Background="Blue" Foreground="White" FontFamily="Sans Serif" FontSize="14"/>
</ComboBoxItem>
</ComboBox>