I want to append two static strings for a single content or header of a WPF object. Something like this:
<MenuItem
Header="{x:Static properties:Resources.SEARCH_FOR_DAYS} +
{x:Static properties:Resources.ELLIPSES}" />
I've played around with ContentStringFormat and the like but can't get it to accept two resources.
<MenuItem>
<MenuItem.Header>
<StackPanel Orientation="Horizontal">
<TextBlock Text="{x:Static properties:Resources.SEARCH_FOR_DAYS}" />
<TextBlock Text="{x:Static properties:Resources.ELLIPSES}" />
</StackPanel>
</MenuItem.Header>
</MenuItem>
Alternatively (closer to what you requested):
<MenuItem>
<MenuItem.Header>
<MultiBinding StringFormat="{}{0}{1}">
<Binding Path="{x:Static properties:Resources.SEARCH_FOR_DAYS}"/>
<Binding Path="{x:Static properties:Resources.ELLIPSES}"/>
</MultiBinding>
</MenuItem.Header>
</MenuItem>
Off the top of my head, you might be able to do:
<MenuItem>
<MenuItem.Header>
<TextBlock>
<Run Text="{x:Static properties:Resources.SEARCH_FOR_DAYS}" />
<Run Text="{x:Static properties:Resources.ELLIPSES}" />
</TextBlock>
</MenuItem.Header>
</MenuItem>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With