This is a migrated thread and some comments may be shown as answers.

Richtextbox Custom SelectionMiniToolBar

3 Answers 107 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Wim van der Linden
Top achievements
Rank 1
Wim van der Linden asked on 25 Oct 2010, 08:42 PM
Hello,

First off I really like the new features of the richtextbox, nicely done.
now I was wondering if there are going to be examples for customizing the SelectionMiniToolBar (and the other pop ups).
I noticed the interface ISelectionMiniToolBar which got me going a bit and I looked at the code from the original popup content.

I noticed the use of two properties:
Span currentSpanStyle = this.radRichTextBox.CurrentSpanStyle
Paragraph currentParagraphStyle = this.radRichTextBox.CurrentParagraphStyle;

Both used in the UpdateUI method, but they are internal.
How am I supposed to get the style of the selected content?

Thanks in advance.
Kind regards,
Wim

Span currentSpanStyle = this.radRichTextBox.CurrentSpanStyle
Paragraph currentParagraphStyle = this.radRichTextBox.CurrentParagraphStyle;
Span currentSpanStyle = this.radRichTextBox.CurrentSpanStyle
Paragraph currentParagraphStyle = this.radRichTextBox.CurrentParagraphStyle;
Span currentSpanStyle = this.radRichTextBox.CurrentSpanStyle
Paragraph currentParagraphStyle = this.radRichTextBox.CurrentParagraphStyle;

3 Answers, 1 is accepted

Sort by
0
Iva Toteva
Telerik team
answered on 28 Oct 2010, 12:18 PM
Hi Wim van der Linden,

Thank you very much for your positive feedback.

There is no API on customizing the selection mini toolbar, but you can create a custom SelectionMinitoolBar, implementing ISelectionMiniToolBar (which you have already taken a look at), and load it through MEF. That is an option with all menus, windows and dialogs, too. With the context menu, however, you can also use the ContextMenuContentBuilder and the methods it provides.

As this is a prerelease, we haven't got round to examples and documentation, but hopefully, there will be some available by the official release (mid-November).

Currently, there is a known issue with CurrentEditingStyle. It will be fixed for the official release, however it's currently not usable for your scenario. Rather, all the RadRichTextBox commands have events when the respective value changes (e.g. RadRichTextBox.Commands.ChangeFontFamilyCommand.FontFamilyChanged). These events give you a value for the property when it's uniform across the selection and null (or Double.MaxValue) if the selection contains various values for this property.

If you have any other questions, do not hesitate to contact us again.

Regards,
Iva
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Wim van der Linden
Top achievements
Rank 1
answered on 01 Nov 2010, 09:56 AM
Hello Iva ,

I got it working now, but there was 1 strange thing I encountered.
When the popup is of the type system.windows.controls.primitives it works fine,
but when its of the type telerik.windows.controls.primitives it doesn't work (open event never triggers).

Is there a reason for the different behavior for the telerik popup class?

Kind regards,
Wim.
0
Iva Toteva
Telerik team
answered on 04 Nov 2010, 09:37 AM
Hello Wim van der Linden,

Telerik Popup was not meant to be used as a stand alone control. It was designed to be used in a very specific scenario, when it had to be placed inside ControlTemplate and bound to custom (not core) DependencyProperty.
If that is not your case, you should stick to MS Popup.

Sincerely yours,
Iva
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
General Discussions
Asked by
Wim van der Linden
Top achievements
Rank 1
Answers by
Iva Toteva
Telerik team
Wim van der Linden
Top achievements
Rank 1
Share this question
or