RadPane header not multibindable

5 posts, 1 answers
  1. Dwight
    Dwight avatar
    12 posts
    Member since:
    Feb 2013

    Posted 18 Feb 2014 Link to this post

    Hi all,

    I'm trying to bind a RadPane its header property to a multibinding with a specific converter on it.
    That doesn't seem to work, could someone please explain why?

    <code>
    <telerik:RadPane>
       <telerik:RadPane.Header>
          <MultiBinding Converter="{StaticResource StringFormatConverter}" ConverterParameter="{}{0} ({1})">
                                    <Binding Path="{loc:Res Id=SomeHeaderId, Default='Signal explorer', ResourceSet={StaticResource LocalResourceSet}}" />
                                    <Binding Path="{Binding SomeViewModel.SomeProperty}" />
          </MultiBinding>
       </telerik:RadPane.Header>
    </telerik:RadPane>
    </code>

    Thnx in advance!

    Kind regards,
    Dwight
  2. Dwight
    Dwight avatar
    12 posts
    Member since:
    Feb 2013

    Posted 18 Feb 2014 in reply to Dwight Link to this post

    Oh, forgot to add what exception is thrown:

    A 'Binding' cannot be set on the 'Path' property of type 'Binding'. A 'Binding' can only be set on a DependencyProperty of a DependencyObject.
  3. UI for WPF is Visual Studio 2017 Ready
  4. Answer
    Paul
    Paul avatar
    38 posts
    Member since:
    Feb 2014

    Posted 18 Feb 2014 in reply to Dwight Link to this post

    Dwight.

    The path property on the Binding property of MultiBinding is not a DependencyProperty.  Typically one would do something like this:

    <TextBlock Style="{StaticResource TopicItem}" >
    <TextBlock.Text>
    <MultiBinding StringFormat="{}{0}, {1} {2}">
    <Binding Path="City" />
    <Binding Path="State" />
    <Binding Path="Zipcode" />
    </MultiBinding>
    </TextBlock.Text>
    </TextBlock>

    Where the Path="XXX" entries are not Bindings, but the name of the property to use in the binding.

    Paul
  5. Dwight
    Dwight avatar
    12 posts
    Member since:
    Feb 2013

    Posted 18 Feb 2014 in reply to Paul Link to this post

    Ouch, I feel like a moron :)
    it struck me when I took a look at it again, just some dumb copy paste error and I was going to answer my own question here, but you beat me :)

    Thnx anyway for answering!
  6. Paul
    Paul avatar
    38 posts
    Member since:
    Feb 2014

    Posted 18 Feb 2014 in reply to Dwight Link to this post

    No problem.  I am always having face palm moments.  Glad to have helped.

    Paul
Back to Top
UI for WPF is Visual Studio 2017 Ready