This is an old post I know but I have the same problem and couldn't find any solution on the net.
I think what he is asking is how to use a multibinding which doesn't bind to a GUI element instead binds to more than one property in the view model.
Something like this:
Xaml:
<MenuItem ItemsSource="{Binding MyMenuItem}">
<MenuItem.IsEnabled>
<MultiBinding Converter="{StaticResource IntsToEnabledConverter}">
<Binding Source="{Binding FirstInt}" />
<Binding Source="{Binding SecondInt}" />
</MultiBinding>
</MenuItem.IsEnabled>
</MenuItem>
ViewModel:
public class ViewModel
{
public int FirstInt{ get { return _firstInt;}}
public int SecondInt{ get { return _secondInt;}}
}
I haven't been able to figure this out either. Instead I used a SingleValueConverter and a binding to a parent object which holds both the variables FirstInt and SecondInt and in the converter use this parent, smth like:
public class IntsToEnabledConverter :IValueConverter
{
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
Parent parent = value as Parent;
if (parent.FirstInt == 1 && parent.SecondInt == 1)
return true;
else
return false;
}
public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
throw new NotImplementedException();
}
}
It's not as clean as if a Multibinding as the parent could be a bigger object with many more members but it worked in my case. I would have better looking code if I could use the Multibinding solution.