2

Within a UserControl I have one toolbar where all the buttons use a pre-defined routed command (e.g. ApplicationCommands.Cut & ApplicationCommands.Copy). This toolbar is effictively reused by 2 RichTextBoxes. All works as expected.

I'm now trying to add Extended WPF Toolkit's ColorPicker to the same toolbar. I've successfully added the control to the toolbar and caught the SelectedColorChanged event in the code-behind but I can't determine with RichTextBox to change the color on?

Tim Murphy
  • 4,892
  • 4
  • 40
  • 48

1 Answers1

0

I think you could add (assuming there isn't one already) a custom command (fired on SelectedColorChanged) and then add a CommandBinding to each of your RichTextBoxes.

See: UIElement.CommandBindings Property

and this question is pretty similar: Custom Command WPF

Oh it would be pretty neat to use an Event to Command binding so you don't require any code behind.

Community
  • 1
  • 1
David Hollinshead
  • 1,710
  • 17
  • 18