private void RTFEditor_Loaded(object sender, RoutedEventArgs e) { var range = new TextRange(RichTextControl.Selection.Start, RichTextControl.Selection.End); Fonttype.SelectedValue = range.GetPropertyValue(FlowDocument.FontFamilyProperty).ToString(); Fontheight.SelectedValue = range.GetPropertyValue(FlowDocument.FontSizeProperty).ToString(); RichTextControl.Focus(); }
// // andere Font wurde vom Benutzer ausgewählt // private void Fonttype_DropDownClosed(object sender, EventArgs e) { string fontName = (string)Fonttype.SelectedItem; if (fontName != null) { RichTextControl.Selection.ApplyPropertyValue(System.Windows.Controls.RichTextBox.FontFamilyProperty, fontName); RichTextControl.Focus(); } }
// // Textgröße wurde vom Benutzer verändert // private void Fontheight_DropDownClosed(object sender, EventArgs e) { string fontHeight = (string)Fontheight.SelectedItem; if (fontHeight != null) { RichTextControl.Selection.ApplyPropertyValue(System.Windows.Controls.RichTextBox.FontSizeProperty, fontHeight); RichTextControl.Focus(); } }
private void Fonttype_DropDownClosed(object sender, EventArgs e) { var fontName = (string)Fonttype.SelectedItem; if (fontName == null) { return; } RichTextControl.Selection.ApplyPropertyValue(FontFamilyProperty, fontName); RichTextControl.Focus(); }
private void Fontheight_DropDownClosed(object sender, EventArgs e) { var fontHeight = (string)Fontheight.SelectedItem; if (fontHeight == null) { return; } RichTextControl.Selection.ApplyPropertyValue(FontSizeProperty, fontHeight); RichTextControl.Focus(); }
// // Nach dem Laden des Control // private void RTFEditor_Loaded(object sender, RoutedEventArgs e) { // Schrifttypen- und -größen-Initialisierung TextRange range = new TextRange(RichTextControl.Selection.Start, RichTextControl.Selection.End); ComboBox_FontFamily.SelectedValue = range.GetPropertyValue(FlowDocument.FontFamilyProperty).ToString(); ComboBox_FontSize.Text = range.GetPropertyValue(FlowDocument.FontSizeProperty).ToString(); // aktuelle Zeilen- und Spaltenpositionen angeben aktZeile = Zeilennummer(); aktSpalte = Spaltennummer(); RichTextControl.Focus(); }
public static void PopulateRichTextControlModel(IEditorControl ctl, EditorController controller, RichTextControl model) { if (ctl.GetBool("notextprocessor")) return; var commandDataList = controller.GetElementDataAttribute("_RichTextControl_TextProcessorCommands", "data") as IEnumerable; model.TextProcessorCommands = (from IDictionary<string, string> commandData in commandDataList select new RichTextControl.TextProcessorCommand { Command = GetDictionaryValue(commandData, "command"), Info = GetDictionaryValue(commandData, "info"), InsertBefore = GetDictionaryValue(commandData, "insertbefore"), InsertAfter = GetDictionaryValue(commandData, "insertafter"), Source = GetDictionaryValue(commandData, "source"), Extensions = GetExtensions(commandData) }); }
private void ComboBox_FontSize_DropDownClosed(object sender, EventArgs e) { RichTextControl.Focus(); }