我想風格的文本包含的TextBlocks和的TextBlocks爲複選框樣式複選框文本與內聯
的內容我想要做這樣的事情(如文本塊是包含在複選框內的TextBlock頁面上 - 或任何繼承自System.Windows.Controls.Control的東西)
textBlock.Inlines.Add("unstyledText");
textBlock.Inlines.Add(new Run { Text = "yellowBoldText ", Foreground = new SolidColorBrush(Colors.Yellow), FontWeight = FontWeights.Bold });
textBlock.Inlines.Add("unstyledText");
這適用於不在CheckBox內的TextBlocks。如果它們位於CheckBox中,則TextBlock的Text屬性將發生變化(即,textBlock.Text == "unstyledText yellowBoldText unstyledText"
返回true),但CheckBox中的文本不會在視覺上發生變化。
有無論如何讓CheckBox中的TextBlocks的行爲方式與其他TextBlocks相同嗎?
在這一點上是一個國家財產,你可以檢查,如果你可能需要從那裏設置它.. – MethodMan 2011-12-15 16:34:04