There is a MultiBinding that returns an instance of a class, how to access its field? Path="ObjectLink" does not work, because Path in MultiBinding missing

  <TextBlock Foreground="Red"> <TextBlock.Style> <Style TargetType="{x:Type TextBlock}"> <Setter Property="Text"> <Setter.Value> <MultiBinding Path="ObjectLink" Converter="{StaticResource ResourceKey=m_GetObjectPropertyConverter}" StringFormat=' ({0})'> <Binding/> <Binding Source="{x:Static DataViewModels:PropertysViewModel.TypeSS}"/> </MultiBinding> </Setter.Value> </Setter> </Style> </TextBlock.Style> </TextBlock> 

PS: m_GetObjectPropertyConverter converter returns an instance of the class

    1 answer 1

    You can use double binding via Tag :

     <Setter Property="Tag"> <Setter.Value> <MultiBinding Converter="{StaticResource m_GetObjectPropertyConverter}"> <Binding/> <Binding Source="{x:Static DataViewModels:PropertysViewModel.TypeSS}"/> </MultiBinding> </Setter.Value> </Setter> <Setter Property="Text" Value="{Binding Tag.ObjectLink, RelativeSource={RelativeSource Self}}"/> 
    • And if, let's say, the result of MultiBinding changes the value of the Binding Tag does it catch it? - Dmitry Chistik
    • @Dmitry Chistik: Yeah, they’ll be supposed to catch changes along the chain. - VladD
    • I think it will suit me then ... - Dmitry Chistik