How can I get property from this:
<ComboBox x:Name="cmbCategory" Grid.Column="1" Grid.Row="5" HorizontalAlignment="Center" PlaceholderText="Categories">
<ComboBox.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal">
<TextBlock TextWrapping="Wrap" Width="100%" Text="{Binding name}" />
</StackPanel>
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
Because this code below doesn't work, because I don't have 'Content' property, I have only 'name' property. Then how can I get value from name
property?
string categories= (cmbCategory.Items[cmbCategory.SelectedIndex] as ComboBoxItem).Content.ToString();