In my .xaml file I have my combo box as below:
You can do it like following
private void ComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
var comboBoxItem = e.AddedItems[0] as ComboBoxItem;
if (comboBoxItem == null) return;
var content = comboBoxItem.Content as string;
if (content != null && content.Equals("some text"))
{
//do what ever you want
}
}
You can use the SelectedItem property of the combobox
(CLengthCombo.SelectedItem as ComboBoxItem).Content
https://msdn.microsoft.com/library/windows/apps/windows.ui.xaml.controls.combobox.aspx#properties
Get your combobox to work this, c.(...) has SelectedItem, SelectedText ...:
private void ComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
var c = sender as ComboBox;
var item = c.(...);
}