views:

26

answers:

0

I want to take the following xml node

<fragment>
    <b0>This is normal</b0>
    <b1>This has a yellow background</b1>
    <b2>This has a red background</b2>
    <b0>Back to normal</b0>
</fragment>

And use data binding to create

<TextBlock>
    <Run>This is normal</Run>
    <Run Background="Yellow">fragment</Run>
    <Run Background="Red">fragment</Run>
    <Run>Back to normal</Run>
</TextBlock>

The fragment node can contain a variable number of child nodes and they can be in any order.

I am using WPF4.