I have a tab control inside which there are number of tab items.I am trying to apply multivalue converter to the visibility property of tabitem.
<TabControl>
<TabItem
DataContext="{Binding TabModel[3]}"
x:Name="Tab3"
Header="Test">
<TabItem.Visibility>
<MultiBinding Converter="{StaticResource settingsvisibility}">
<Binding Path="UserRole"/>
<Binding Path="UserName"/>
</MultiBinding>
</TabItem.Visibility>
<tabView:view />
</TabItem></tabControl>
My converter code is as follow as
public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
{
Visibility visiblity = Visibility.Collapsed;
int id = System.Convert.ToInt32(values[0]);
string tabName = values[1].ToString();
...
....
...
}
But the values are not getting passed properly. I am getting the below exception
Unable to cast object of type 'MS.Internal.NamedObject' to type 'System.IConvertible . Can anyone help me to get rid of this issue?