In my opinion, the best way to achieve what you need is:
Create an class like:
public class Item
{
public object Tag{get;set;}
public object Value{get;set;}
}
then in your ViewModel, you add a collection of Items and a Property to get the selected item of the Item Collection like:
public ObservableCollection<item> Items{get;set;}
private Item _selectedItem;
public Item SelectedItem
{
get{return _selectedItem;}
set
{
if(_selectedItem != value)
{
_selectedItem = value;
if(PropertyChanged!=null)
PropertyChanged(this, new PropertyChangedEventArgs("SelectedItem");
}
}
}
</item>
Then by using the SelectedItemProperty of the ComboBox you will get both the Value and Tag, but instead of adding the items of the ComboBox in XAML, you will add it by a BindingExpression in the ItemsSourceProperty, like:
<ComboBox Height="23" Margin="396,487,0,0" Name="PlaybackVideoChannelCombo" VerticalAlignment="Top" ItemsSource="{Binding Items}" SelectedItem="{Binding SelectedItem, Mode=TwoWay}" Background="YellowGreen" HorizontalAlignment="Left" Width="93">
<ComboBox.ItemTemplate>
<TextBlock Text="{Binding Value}"/>
</ComboBox.ItemTemplate>
</ComboBox>
Hope this helps.
Best regards,
Raul Mainardi Neto