WPF EditingCommands is not working when RichTextBox is just load/empty?

Up vote 0 down vote favorite share g+ share fb share tw.

Here is a very simple code example: B when I run it, after typing something into the RichTextBox, I can use the ToggleButton to get the BOLD effect, and everything is fine. But if I click ToggleButton before typing in anything into RichTextBox (no matter RichTextBox get focus or not), although ToggleButton became Checked, my RichTextBox still using the normal style (not BOLD) until I click ToggleButton again. Is this a bug?

How can I get around? Thanks! C# wpf richtextbox togglebutton link|improve this question asked Sep 16 '11 at 18:58Bolu1,8141212 70% accept rate.

Mainwindow. Xaml B Mainwindow.xaml.cs private void SynchronizeWith(object sender, RoutedEventArgs e) { object currentValue = XAMLRichBox.Selection. GetPropertyValue(TextElement.

FontWeightProperty); boldButton. IsChecked = (currentValue == DependencyProperty. UnsetValue)?

False : currentValue! = null && currentValue. Equals(FontWeights.

Bold); }.

Thanks, this will synchronize togglebutton's status with the RichTextBox. But still, EditingCommands. ToggleBold will not work util user entered something.

– Bolu Sep 17 '11 at 9:33.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions