Question

I have a problem trying to convert existing XAML to MultiBinding.
The current code (which needs to be replaced) is

<TextBlock  Text="{Binding BarcodeCollection.Count}" />
<TextBlock  Text="{x:Static p:Resource.AllWN}" />


What I have now:

<control:MyControl>
    <control:MyControl.ControlText>
        <MultiBinding StringFormat="{}{0} {1}">
            <Binding Path="BarcodeCollection.Count"/> <!-- This part works fine -->
            <Binding ??? /> <!-- No idea how to re-write this part -->
        </MultiBinding>
    </control:MyControl.ControlText>
</control:MyControl>

I tried many things I could think of to make the 2nd part working but couldn't figure it out. I tried using Path but it's not a path so obviously it didn't work. I also tried all kinds of variations through StringFormat, Source & RelativeSource but nothing seemed to work.

Anyone have any ideas? Is it even possible?

Was it helpful?

Solution

You have to set Source like this:

<Binding Source="{x:Static p:Resource.AllWN}"/>

OTHER TIPS

According to the https://stackoverflow.com/a/3341536/1157021 the source should work in this form:

<Binding Source="{StaticResource p:Resource.AllWN}" />
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top