2

フォーマットしたい複数行のテキストがあり、それがデータバインドされているとしましょう。したがって、XAML では次のようになります。

<TextBlock TextWrap="Wrap">
    <TextBlock.Inlines>
        <Run TextWeight="Bold" Text="{Binding Path=FirstName}" />
        <Run TextStyle="Italic Text="{Binding Path=LastName}" />
    </TextBlock.Inlines>
</TextBlock>

Run's Text は依存関係プロパティではないため、これは機能しません。それで、このようにインラインのデータバインドされたテキストをスタイルする最良の方法は何ですか?

前もって感謝します。

4

1 に答える 1

1

There is a workaround posted here. It basically involves subclassing Run to be bindable. Works though.

于 2009-03-06T23:47:19.090 に答える