|
|
|
|
@ -5,7 +5,6 @@ using System.Collections.Generic; |
|
|
|
|
using System.Collections.Specialized; |
|
|
|
|
using System.ComponentModel; |
|
|
|
|
using System.Linq; |
|
|
|
|
using System.Runtime.CompilerServices; |
|
|
|
|
using System.Windows; |
|
|
|
|
using System.Windows.Controls; |
|
|
|
|
using System.Windows.Documents; |
|
|
|
|
@ -229,7 +228,7 @@ public class MultiFormatTextBox : Control |
|
|
|
|
// text as run with correct background brush |
|
|
|
|
run = new Run(formattedCharacter.Character) |
|
|
|
|
{ |
|
|
|
|
Background = this.currentlySelectedFormat!.BackgroundBrush |
|
|
|
|
Background = this.GetBackgroundBrushForFormat(formattedCharacter.Format) |
|
|
|
|
}; |
|
|
|
|
} |
|
|
|
|
else if(item is SpacingCharacter spacingCharacter) |
|
|
|
|
@ -410,4 +409,10 @@ public class MultiFormatTextBox : Control |
|
|
|
|
this.richTextBox!.Selection.Select(this.richTextBox.Selection.End, this.richTextBox.Selection.End); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private Brush GetBackgroundBrushForFormat(FormatType format) |
|
|
|
|
{ |
|
|
|
|
var formatObj = formats.Where(f => f.AssociatedFormatType == format).First(); |
|
|
|
|
return formatObj.BackgroundBrush; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|