Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
500
Wnt to WPF XamSyntaxtEditor on WinForm
posted

On WinForm I have added WPF control (Infragistic's XamSyntaxEditor)

I have added ElementHost on my Form .(Need to add reference to System.Windows.Forms.Integration)
In my Form Load after Initialise component.
I have writtn below code :

Dim Document As TextDocument = New TextDocument()
Document.Language = New Infragistics.Documents.VisualBasicLanguage
' WPF control which I want to add on Form
Dim editor As XamSyntaxEditor = New XamSyntaxEditor()
editor.ErrorDisplayMode = SyntaxErrorDisplayMode.Never
editor.SplitOptions = EditorDocumentViewSplitOptions.SplittingNotAllowed
editor.Document = Document
host.Dock = DockStyle.Fill
host.Child = editor
Control is getting added on  ,works fine .
But I am not able to trap any input /change evnt on this control.
How to communicate with Control .
I tried to hook event mentioned as below link :

http://stackoverflow.com/questions/4350862/wpf-events-in-winforms

But I am not sure how to write or hook custom event with WPF control events .

Parents
  • 138253
    Verified Answer
    Offline posted

    Hello Aparna,

     

    Thank you for your post. I have been looking into it and I can suggest you use the XamSyntaxEditor’s Document’s TextChanged event in order to achieve the result you want. I put a sample together which shows how to do so. Please let me know if this helps you or you need further assistance on this matter.

     

    Looking forward for your reply.

    XamSyntaxEditorTextChangedEvent.zip
Reply Children