2

I have the following code:

<local:StaffAtMeetingEditor DataContext="{Binding Meeting}" Grid.Row="1">
    <local:StaffAtMeetingEditor.InEditMode>
        <MultiBinding Converter="{StaticResource myMeetingLogEditableMultiConverter}">
            <Binding Path="ParentSI.ItemInEditMode"/>
        </MultiBinding>
    </local:StaffAtMeetingEditor.InEditMode>
</local:StaffAtMeetingEditor>

The setup is that the containing control's datatype is "SIP_ServiceItem". This class has a property called "Meeting" (which is set as the DataContext for the local:StaffAtMeetingEditor control), which itself has a member called "ParentSI", pointing back to the parent SIP_ServiceItem object.

The issue is, that if I pass this through as a single binding (i.e. remove the start and end MultiBinding tags from the code above, leaving just the Binding), it works just fine. But when I make it a MultiBinding (I wish to add some other Bindings to this shortly), and try to pass the bound value through to myMeetingLogEditableMultiConverter, the values(0) parameter, which should correspond to the boolean ParentSI.ItemInEditMode is actually an MS.Internal.NamedObject, implying there's a null reference somewhere. Furthermore, the ParentSI property is never being evaluated, so something is going completely wrong. I am at a loss to know the difference between the single binding and multi binding cases.

Thanks.

Stephen Holt
  • 2,360
  • 4
  • 26
  • 34

2 Answers2

2

I know this is a bit old, and you have likely figured this out by now, but I came across this as I had a similar problem and thought I'd share the solution: I had the same problem and have added the attributes ElementName and Mode as below:

<Binding Path="CurrentProvider.IsBusy" ElementName="parent" Mode="OneWay" />

Hope this helps someone, even if the OP has fixed their issue.

Andrew
  • 1,963
  • 3
  • 25
  • 35
0

May be you should try to add any temporary unused bound value. For instance:

<local:StaffAtMeetingEditor DataContext="{Binding Meeting}" Grid.Row="1">
    <local:StaffAtMeetingEditor.InEditMode>
        <MultiBinding Converter="{StaticResource myMeetingLogEditableMultiConverter}">
            <Binding Path="ParentSI.ItemInEditMode"/>
            <Binding Path="ParentSI"/>
        </MultiBinding>
    </local:StaffAtMeetingEditor.InEditMode>
</local:StaffAtMeetingEditor>

If it doesn't work then your implementation is wrong, another case - it's MultiBinding limitations.

Y.Yanavichus
  • 2,387
  • 1
  • 21
  • 34
  • Hi, thanks for the tip but I don't think this is the issue - I initially had several inputs to the multiconverter and it still wasn't working (hence why I whittled it down to one, for simplicity). My issue appears to be similar to this one: http://stackoverflow.com/questions/3701732/cant-access-datacontext-in-multivalueconverter but I can't see a solution that will work in this case. – Stephen Holt Mar 14 '11 at 11:48