I wanna implement an editor that requires drawing RuleLines(Muted lins?) perline like the ones in the image below.
I'm going to use Richtextbox or avalonedit, can you help me creating this pattern?
Thanks in advance..
我想实现一个需要绘制规则线(静音线条?)的编辑器。Perline,如下图所示。我要用Richtextbox或avalonedit,你能帮我创建这个图案吗?提前谢谢你..
image
图像
更多回答
优秀答案推荐
In WPF RichTextBox
you can set border thickness for the Paragraph
style. It will look like on your screenshot.
在WPF RichTextBox中,您可以设置段落样式的边框粗细。它将看起来像在您的屏幕截图上。
<RichTextBox x:Name="richtextbox" >
<RichTextBox.Resources>
<Style TargetType="{x:Type Paragraph}">
<Setter Property="BorderThickness" Value="0,0,0,1"></Setter>
<Setter Property="BorderBrush" Value="#388FFA"></Setter>
<Setter Property="Margin" Value="3"/>
<Setter Property="Padding" Value="2"/>
</Style>
</RichTextBox.Resources>
</RichTextBox>
I've done it in AvalonEdit by myself.
add RulerLines(just need drawline via DrawingContext) class when VisualLine or TextView Rendering.
Image Done
我自己在AvalonEdit中完成了这项工作。在VisualLine或TextView渲染时添加RulerLines(只需通过DrawingContext绘制)类。图像完成
更多回答
this is what i wanna,but richtextbox input is very laggy in wpf
这就是我想要的,但在WPF中,richtextbox输入非常迟缓
This answer isn't clear - can you please edit it to clarify your solution in steps, and either embed your linked image and/or explain what it is in your link rather than "Image Done". You may find helpful info on how to answer in the help center.
这个答案并不清楚--您能否对其进行编辑,以按步骤阐明您的解决方案,并嵌入您的链接图像和/或解释它在您的链接中是什么,而不是“图像完成”。您可以在帮助中心找到有关如何回答的有用信息。
我是一名优秀的程序员,十分优秀!