This question is locked. New answers and comments are not allowed.
Hi, I'm using RadRichTextBox of Telerik version 2013.3.1016.1050. I'm trying to visualize FontPropertiesDialog using context menu.
If I use the default context menu behavior the dialog doesn't appear, if I call explicitly the FontPropertiesDialog constructor:
dialog.ShowDialog(new FontPropertiesDialogContext(new Action<StyleDefinition>((style) => SetFontValuesToTextBoxText(style)),
AssociatedRichTextBox.Document.Style, AssociatedRichTextBox));
this code raise this error:
Message = Reference is not a valid visual DependencyObject.
StackTrace = at System.Windows.Media.VisualTreeHelper.GetRelative(DependencyObject reference, RelativeKind relativeKind)
at System.Windows.Media.VisualTreeHelper.GetParent(DependencyObject reference)
at Telerik.Windows.Controls.RichTextBoxUI.Dialogs.WindowHelper.GetParentWindow(RadRichTextBox radRichTextBox)
at Telerik.Windows.Controls.RichTextBoxUI.Dialogs.RadRichTextBoxWindow.SetOwner(RadRichTextBox owner)
at Telerik.Windows.Controls.RichTextBoxUI.Dialogs.FontPropertiesDialog.ShowDialogInternal(StyleDefinition defaultStyle, Action`1 applyCallback, RadRichTextBox owner)
at Telerik.Windows.Controls.RichTextBoxUI.Dialogs.FontPropertiesDialog.ShowDialog(FontPropertiesDialogContext context)
at Siemens.SimaticIT.ALT.Engineering.Controls.FontCommandExt.ExecuteOverride(Object parameter)
at Telerik.Windows.Documents.RichTextBoxCommands.RichTextBoxCommandBase.Execute(Object parameter, Boolean focusCaret)
If I use the default context menu behavior the dialog doesn't appear, if I call explicitly the FontPropertiesDialog constructor:
dialog.ShowDialog(new FontPropertiesDialogContext(new Action<StyleDefinition>((style) => SetFontValuesToTextBoxText(style)),
AssociatedRichTextBox.Document.Style, AssociatedRichTextBox));
this code raise this error:
Message = Reference is not a valid visual DependencyObject.
StackTrace = at System.Windows.Media.VisualTreeHelper.GetRelative(DependencyObject reference, RelativeKind relativeKind)
at System.Windows.Media.VisualTreeHelper.GetParent(DependencyObject reference)
at Telerik.Windows.Controls.RichTextBoxUI.Dialogs.WindowHelper.GetParentWindow(RadRichTextBox radRichTextBox)
at Telerik.Windows.Controls.RichTextBoxUI.Dialogs.RadRichTextBoxWindow.SetOwner(RadRichTextBox owner)
at Telerik.Windows.Controls.RichTextBoxUI.Dialogs.FontPropertiesDialog.ShowDialogInternal(StyleDefinition defaultStyle, Action`1 applyCallback, RadRichTextBox owner)
at Telerik.Windows.Controls.RichTextBoxUI.Dialogs.FontPropertiesDialog.ShowDialog(FontPropertiesDialogContext context)
at Siemens.SimaticIT.ALT.Engineering.Controls.FontCommandExt.ExecuteOverride(Object parameter)
at Telerik.Windows.Documents.RichTextBoxCommands.RichTextBoxCommandBase.Execute(Object parameter, Boolean focusCaret)