Hi, I have Combobox with the city names. In Tag of each ComboboxItem I store the index to read it after selection made.
I'm using this code:
Dim TempItem As New ComboBoxItem
TempItem = City.SelectedItem
Dim TempTag as String = TempItem.Tag
Just here I have an exception: value of type 'String' cannot be converted to 'System.Windows.Controls.StackPanel. And I have no idea why it's happens.
If I try to change the last string as following, same problem occur in an editor (blue underline of the part after "=").
Dim TempTag as String = TempItem.Tag.ToString
How can I retrieve the value from the Tag?
P.s.
By the way, same problem here:
Dim TempTag as String = DirectCast(City.SelectedItem, ComboBoxItem).Tag.ToString
Aleksey