icsharpcode / AvalonEdit

The WPF-based text editor component used in SharpDevelop
http://avalonedit.net/
MIT License
1.85k stars 469 forks source link

Editor Not Rendering #426

Closed prestsauce closed 3 months ago

prestsauce commented 3 months ago

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.

prestsauce commented 3 months ago

Looks like this was some sort of compilation error on my end. Ignore.