public static object GetItemData(object obj) { ComboBoxItem cbi = obj as ComboBoxItem; if (cbi != null) { if (cbi.ReadLocalValue(FrameworkElement.TagProperty) != DependencyProperty.UnsetValue) { return(cbi.GetValue(FrameworkElement.TagProperty)); } return(cbi.Content); } return(obj); }