标签: avalonedit

AvalonEdit:TextEditor是否具有快速搜索/替换功能?

我用AvalonEdit:TextEditor.我可以为此控件启用快速搜索对话框(例如在Ctrl-F上)吗?或者也许有人将搜索词的代码转换为 AvalonEdit:TextEditor文本?

c# search avalonedit

12
推荐指数
3
解决办法
6152
查看次数

AvalonEdit突出显示匹配的字符

有没有一种简单的方法可以使用Avalon编辑来突出显示匹配的括号和其他字符,如{}""?

c# wpf avalonedit

10
推荐指数
1
解决办法
1603
查看次数

代码中的AvalonEdit更改语法突出显示

我想在我的代码中更改AvalonEdit的语法突出显示.

XAML:

 <avalonEdit:TextEditor Name="textEditor" SyntaxHighlighting="{Binding syntaxHighlighting}" />
Run Code Online (Sandbox Code Playgroud)

C#:

public string syntaxHighlighting { get; set; }

public MainWindow()
{
     InitializeComponent();
     syntaxHighlighting = "C#";
     DataContext = this;
}
Run Code Online (Sandbox Code Playgroud)

但语法高亮不会改变.我究竟做错了什么?对我的问题有更好的解决方案吗?

c# wpf syntax-highlighting text-editor avalonedit

10
推荐指数
2
解决办法
9202
查看次数

AvalonEdit中的双向绑定不起作用

我在我的项目中使用了AvalonEdit,它基于WPF和MVVM.阅读这篇文章后,我创建了以下课程:

public class MvvmTextEditor : TextEditor, INotifyPropertyChanged
{
    public static DependencyProperty DocumentTextProperty =
        DependencyProperty.Register("DocumentText", 
                                    typeof(string), typeof(MvvmTextEditor),
        new PropertyMetadata((obj, args) =>
        {
            MvvmTextEditor target = (MvvmTextEditor)obj;
            target.DocumentText = (string)args.NewValue;
        })
    );

    public string DocumentText
    {
        get { return base.Text; }
        set { base.Text = value; }
    }

    protected override void OnTextChanged(EventArgs e)
    {
        RaisePropertyChanged("DocumentText");
        base.OnTextChanged(e);
    }

    public event PropertyChangedEventHandler PropertyChanged;
    public void RaisePropertyChanged(string info)
    {
        if (PropertyChanged != null)
        {
            PropertyChanged(this, new PropertyChangedEventArgs(info));
        }
    }
}
Run Code Online (Sandbox Code Playgroud)

并使用以下XAML来使用此控件:

<avalonedit:MvvmTextEditor x:Name="xmlMessage"> …
Run Code Online (Sandbox Code Playgroud)

c# data-binding wpf dependency-properties avalonedit

9
推荐指数
1
解决办法
2799
查看次数

Avalon文本编辑器中的向上和向下键不会更改光标位置

我正在使用,Avalon text editor并且键和音频位置没有因按键向上和按键而改变.任何人都可以建议我如何克服这个问题?

键右右导航的光标位置正确变化.

我还检查了键盘事件中插入符号的值,并且对于上下键按下它没有改变.

.net wpf events caret avalonedit

9
推荐指数
1
解决办法
251
查看次数

突出显示AvalonEdit中所有选定单词的出现位置

我需要在AvalonEdit中突出显示所有选定单词.我创建了一个HihglinghtingRule类的实例:

 var rule = new HighlightingRule()
   {
       Regex = regex, //some regex for finding occurences
       Color = new HighlightingColor {Background = new SimpleHighlightingBrush(Colors.Red)}
   };
Run Code Online (Sandbox Code Playgroud)

我该怎么办?谢谢.

c# wpf highlighting textedit avalonedit

7
推荐指数
1
解决办法
2654
查看次数

Avalonedit显示语法错误

当我使用avalonedit开发自定义语言IDE时,我遇到了一个问题.我使用正则表达式检查语法,它按设计工作.但是,我想用波形文本标记显示语法错误.我在谷歌搜索,但解决方案已过时或不可行.有任何想法吗?谢谢你.

avalonedit

7
推荐指数
1
解决办法
1407
查看次数

使用AvalonEdit显示无效的XML语法

我试图在我的WPF应用程序中使用AvalonEdit作为XML文本编辑器.但是,它遇到无效语法时不会进行任何格式化(如波浪线).

我想知道是否可以使用AvalonEdit完成此类功能,或者是否有其他替代方法.谢谢!

c# xml avalonedit

6
推荐指数
1
解决办法
4408
查看次数

Avalonedit如何使Line Transformers无效

我添加了一个从DocumentColorizingTransformer派生到TextEditor的LineTransformerClass:

TxtEditCodeViewer.TextArea.TextView.LineTransformers.Add(new ColorizeAvalonEdit());
Run Code Online (Sandbox Code Playgroud)

是否有任何编程方式在Linetransformer上调用失效?

我很容易认为,因为它被添加到textview,以下应该工作:

TxtEditCodeViewer.TextArea.TextView.InvalidateVisual();
TxtEditCodeViewer.TextArea.TextView.InvalidateArrange();
TxtEditCodeViewer.TextArea.TextView.InvalidateMeasure();
Run Code Online (Sandbox Code Playgroud)

但他们没有.为了以防万一,我也尝试了以下内容:

//TxtEditCodeViewer.TextArea.TextView.InvalidateVisual();
//TxtEditCodeViewer.TextArea.TextView.InvalidateArrange();
//TxtEditCodeViewer.TextArea.TextView.InvalidateMeasure();
//TxtEditCodeViewer.InvalidateVisual();
//TxtEditCodeViewer.InvalidateArrange();
//TxtEditCodeViewer.InvalidateMeasure();
//TxtEditCodeViewer.TextArea.InvalidateArrange();
//TxtEditCodeViewer.TextArea.InvalidateMeasure();
//TxtEditCodeViewer.TextArea.InvalidateVisual();
Run Code Online (Sandbox Code Playgroud)

.net c# wpf invalidation avalonedit

6
推荐指数
1
解决办法
1139
查看次数

如何更改 AvalonEdit CodeCompletion 窗口的样式?

我试图弄清楚如何更改 AvalonEdit CodeCompletion 窗口的样式。但是,我无法找出 xaml 样式目标/属性的正确组合来更改它。我想做的主要事情是去掉边框,但也许还需要一些额外的改变。

这是我尝试过的 xaml。这些都不会影响 UI。

    xmlns:ae="clr-namespace:ICSharpCode.AvalonEdit.CodeCompletion;assembly=ICSharpCode.AvalonEdit"

    <Style TargetType="{x:Type ae:CompletionWindow}">
        <Setter Property="WindowStyle" Value="None" />
    </Style>
    <Style TargetType="{x:Type ae:CompletionWindowBase}">
        <Setter Property="WindowStyle" Value="None" />
    </Style>
    <Style TargetType="{x:Type ae:CompletionListBox}">
        <Setter Property="Background" Value="Red" />
    </Style>
    <Style TargetType="{x:Type ae:CompletionList}">
        <Setter Property="Background" Value="Orange" />
    </Style>
Run Code Online (Sandbox Code Playgroud)

wpf xaml avalonedit

6
推荐指数
2
解决办法
1820
查看次数