Skip to content

Editor Not Rendering #426

Closed
Closed
@prestsauce

Description

I'm using WPF with AvalonEdit in a .netframework 4.8 project. I am using the latest stable package from the nuget feed (6.3.0.90) The exact usage looked like so:

<avalonEdit:TextEditor 
                x:Name="scriptEditor"
                HorizontalScrollBarVisibility="Auto"
                VerticalScrollBarVisibility="Auto"
                FontFamily="Consolas"
                ShowLineNumbers="True"
                SyntaxHighlighting="Python"
                BorderThickness="0"
                Margin="1"
                Document="{Binding ScriptDocument}"/>

Nothing else special. No special highlighting, or anything. Just out of the box usage. This was working great until recently. Suddenly, the element won't render. Using the visual studio live tree, I can see the TextEditor in the tree (complete with datacontext and bindings), but it will not appear within the GUI.

I tested the code in a different window, just to be sure it wasn't something to do with the styling I was using. The full code of the test window looks like this:

<Window x:Class="{namespace}.Windows.Window1"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:{namespace}.Windows"
        mc:Ignorable="d"
        Title="Window1" Height="450" Width="800">
    <Grid>
        <avalon:TextEditor
            xmlns:avalon="http://icsharpcode.net/sharpdevelop/avalonedit"
            SyntaxHighlighting="Python"
            ShowLineNumbers="True"/>
    </Grid>
</Window>

and this renders:
image

I don't really know how to debug this, as it doesn't seem like any errors are being thrown. Any help would be appreciated.

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions