Adding WPF Resource Rows

I want to add two static lines for the same content or title of a WPF object. Something like that:

<MenuItem 
    Header="{x:Static properties:Resources.SEARCH_FOR_DAYS} + 
            {x:Static properties:Resources.ELLIPSES}" /> 

I played with ContentStringFormat and the like, but can't get it to accept two resources.

+5
source share
2 answers
<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>    
+5
source

On top of my head you can 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>
+4
source

All Articles