はい、コンバーター(実際にはマルチコンバーターでさえあるかもしれません)とTextBlockのインラインコレクションを使用することについては正しいです。では、検索項目 (あなたの場合は「Emi」という単語) をコンバーターに渡しているとしましょう。結果のテキストで TextBlock を何らかの方法で操作する必要もあります。簡単にするために、TextBlock の Tag プロパティ (Text ではない) に検索対象の文字列全体 (単語「Eminem」) が含まれていると仮定します。
class HighlightPartOfTextConverter : IValueConverter {
public object Convert(object value/*this is TextBlock*/, Type type, object parameter/*this is 'Emi'*/, CultureInfo ci){
var textBlock = value as TextBlock;
string str = textBlock.Tag as string;
string searchThis = parameter as string;
int index = str.IndexOf(searchThis);
if(index >= 0){
string before = str.Substring(0, index);
string after = str.Substring(index + searchThis.Length);
textBlock.Inlines.Clear();
textBlock.Inlines.Add(new Run(){Text=before});
textBlock.Inlines.Add(new Run(){Text=searchThis, FontWeight = FontWeights.Bold});
textBlock.Inlines.Add(new Run(){Text=after});
}
return "";
}
public object ConvertBack(...) {...}
}