rename to Editor
Browse files- CustomRichTextBox.cs → Editor.cs +4 -4
- MainWindow.xaml +1 -1
- WpfRichTextBox.sln +1 -1
CustomRichTextBox.cs → Editor.cs
RENAMED
|
@@ -7,13 +7,13 @@ using System.Windows;
|
|
| 7 |
namespace WpfRichTextBox
|
| 8 |
{
|
| 9 |
|
| 10 |
-
public class
|
| 11 |
{
|
| 12 |
public List<RichChar> RichChars { get; private set; } = new List<RichChar>();
|
| 13 |
|
| 14 |
-
public
|
| 15 |
{
|
| 16 |
-
TextChanged +=
|
| 17 |
DataObject.AddPastingHandler(this, OnPasteHandler);
|
| 18 |
}
|
| 19 |
|
|
@@ -23,7 +23,7 @@ namespace WpfRichTextBox
|
|
| 23 |
InvalidateVisual();
|
| 24 |
}
|
| 25 |
|
| 26 |
-
private void
|
| 27 |
{
|
| 28 |
SyncRichChars();
|
| 29 |
InvalidateVisual();
|
|
|
|
| 7 |
namespace WpfRichTextBox
|
| 8 |
{
|
| 9 |
|
| 10 |
+
public class Editor : RichTextBox
|
| 11 |
{
|
| 12 |
public List<RichChar> RichChars { get; private set; } = new List<RichChar>();
|
| 13 |
|
| 14 |
+
public Editor()
|
| 15 |
{
|
| 16 |
+
TextChanged += Editor_TextChanged;
|
| 17 |
DataObject.AddPastingHandler(this, OnPasteHandler);
|
| 18 |
}
|
| 19 |
|
|
|
|
| 23 |
InvalidateVisual();
|
| 24 |
}
|
| 25 |
|
| 26 |
+
private void Editor_TextChanged(object sender, TextChangedEventArgs e)
|
| 27 |
{
|
| 28 |
SyncRichChars();
|
| 29 |
InvalidateVisual();
|
MainWindow.xaml
CHANGED
|
@@ -4,6 +4,6 @@
|
|
| 4 |
xmlns:local="clr-namespace:WpfRichTextBox"
|
| 5 |
Title="MainWindow" Height="350" Width="525">
|
| 6 |
<Grid>
|
| 7 |
-
<local:
|
| 8 |
</Grid>
|
| 9 |
</Window>
|
|
|
|
| 4 |
xmlns:local="clr-namespace:WpfRichTextBox"
|
| 5 |
Title="MainWindow" Height="350" Width="525">
|
| 6 |
<Grid>
|
| 7 |
+
<local:Editor x:Name="customRichTextBox" Width="400" Height="200"/>
|
| 8 |
</Grid>
|
| 9 |
</Window>
|
WpfRichTextBox.sln
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
|
| 2 |
Microsoft Visual Studio Solution File, Format Version 12.00
|
| 3 |
# Visual Studio Version 17
|
| 4 |
-
VisualStudioVersion = 17.14.35806.103
|
| 5 |
MinimumVisualStudioVersion = 10.0.40219.1
|
| 6 |
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WpfRichTextBox", "WpfRichTextBox.csproj", "{D9FDC891-69E4-4747-86B2-25F554977569}"
|
| 7 |
EndProject
|
|
|
|
| 1 |
|
| 2 |
Microsoft Visual Studio Solution File, Format Version 12.00
|
| 3 |
# Visual Studio Version 17
|
| 4 |
+
VisualStudioVersion = 17.14.35806.103
|
| 5 |
MinimumVisualStudioVersion = 10.0.40219.1
|
| 6 |
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WpfRichTextBox", "WpfRichTextBox.csproj", "{D9FDC891-69E4-4747-86B2-25F554977569}"
|
| 7 |
EndProject
|