SharpDevelop Community

Get your problems solved!
Welcome to SharpDevelop Community Sign in | Join | Help
in Search

AvalonEdit: Binding Document-Property

Last post 10-12-2010 5:37 PM by MrSparkle. 0 replies.
Page 1 of 1 (1 items)
Sort Posts: Previous Next
  • 10-12-2010 5:37 PM

    AvalonEdit: Binding Document-Property

    Hi,

    how can I bind the Document-Property to my ViewModel? I have the following XAML markup:

    <AvalonEdit:TextEditor x:Name="Editor"
      Document="{Binding Path=AXMLFile.Document, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
      ShowLineNumbers="True"
      FontFamily="Consolas"
      FontSize="10pt" />


    I create the TextDocument object like this:

      content = File.ReadAllText(Path);
      Document = new TextDocument(content);

    But all I got is an empty Editor control, although the Document has the content of the file (I checked this).There are no DataBinding errors displayed in the output window, so that should work correctly.

    Another issue is that I can't write anything into the editor, although the IsReadOnly property is set to false.

    What could cause these problems with the data binding? Can somebody help me find the cause of the problem?

    Thanks, Christian

Page 1 of 1 (1 items)
Powered by Community Server (Commercial Edition), by Telligent Systems
Don't contact us via this (fleischfalle@alphasierrapapa.com) email address.