Here is my object model
private class ShellItem
{
public string Name { get; set; }
public string Command { get; set; }
public List<ShellMenu> ShellMenus { get; private set; }
public ShellItem()
{
ShellMenus = new List<ShellMenu>();
}
}
public class ShellMenu
{
public string ExtName;
public string KeyName;
public string FileType;
public string MenuName { get; set; }
public string Command { get; set; }
}
Here is my xaml.
<ListView Name="listViewRightClick" HorizontalAlignment="Stretch" Height="Auto" Margin="10,10,26.667,107.667" VerticalAlignment="Stretch" Width="Auto">
<ListView.View>
<GridView>
<GridViewColumn Width="200" Header="Name" DisplayMemberBinding="{Binding Name}"/>
<GridViewColumn Width="600" Header="Command" DisplayMemberBinding="{Binding Command}"/>
<GridViewColumn Width="200" Header="FileTypes">
<GridViewColumn.CellTemplate>
<DataTemplate>
<ComboBox ItemsSource="{Binding ShellMenus}"
SelectedValue="{Binding MenuName}"
Margin="-6, 0, -6, 0"/>
</DataTemplate>
</GridViewColumn.CellTemplate>
</GridViewColumn>
</GridView>
</ListView.View>
</ListView>
My problem is instead of showing MenuName of shellMenu it shows MyNamespace.ShellMenu on every item of combobox.