I'm trying to complete a toolbar-based font size editor for the RRTB.
I'm trying to emulate the behavior of the ribbon-based editor's font size combo. It displays the font size of the size of the span where the cursor is located. I can do this by listening to CurrentSpanStyleChanged (as recommended elsewhere in the forum), I can then grab the CurrentEditingStyle and update the current font size.
Its a little bit wonky, I know, but its the only way I know of now to keep my currently displayed font size in sync.
The problem arises when there is a selection. The correct way to display the current font size when there exist multiple font sizes within a selection is to show no font size. The ribbon UI does this. I'm trying to emulate this, however I can't figure out how to tell when
1. A selection event has triggered CurrentSpanStyleChanged
2. How to determine the font sizes for each span within the selection
How can I do this? Or how should I be keeping track of the current font size, if I'm totally off?
I'm trying to emulate the behavior of the ribbon-based editor's font size combo. It displays the font size of the size of the span where the cursor is located. I can do this by listening to CurrentSpanStyleChanged (as recommended elsewhere in the forum), I can then grab the CurrentEditingStyle and update the current font size.
var style = steRTB.CurrentEditingStyle;
SelectedFontSize = (
double
)_conv.ConvertBack(
style.GetPropertyValue(TSpan.FontSizeProperty),
typeof
(
double
),
null
,
null
);
Its a little bit wonky, I know, but its the only way I know of now to keep my currently displayed font size in sync.
The problem arises when there is a selection. The correct way to display the current font size when there exist multiple font sizes within a selection is to show no font size. The ribbon UI does this. I'm trying to emulate this, however I can't figure out how to tell when
1. A selection event has triggered CurrentSpanStyleChanged
2. How to determine the font sizes for each span within the selection
How can I do this? Or how should I be keeping track of the current font size, if I'm totally off?