I’m building a combobox in WPF that has a ContentPresenter and Image in a stack panel. The combobox items show up fine. What I’d like to do now is be able to get the content value in the contentpresenter from the selected item programatically using C#.
How would I go about doing this? Thanks in advance.
Here is my XAML:
<ComboBox x:Name="cbo1" Width="140" TextBlock.FontSize="12">
<ComboBoxItem>
<StackPanel Orientation="Horizontal">
<ContentPresenter Width="90" TextBlock.FontSize="12" HorizontalAlignment="Left" Content="Item1"/>
<Image Width="16" Height="11" Source="Images\Item1.png"/>
</StackPanel>
</ComboBoxItem>
</ComboBox>
This snippet should do it