On WinForm I have added WPF control (Infragistic's XamSyntaxEditor)
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 .
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.
Hi Stefan ,
Thanks for your reply , I already able to hook the event with contril .
But I am facing new problem with XamSyntaxEditor .
I have user Control 'codeEditor' ,which was previously using RTF as editor , now we want to replace RTF with XamSyntaxEditor.
Now this userControl is refered many places ,where we initialize text to Editor's document , user performs operation like modify,copy paste etc .
It works everywhere fine , but on Few forms where same control is refered (with XamSyntaxEditor ) ,I get exception :
"Value can not be null ,Parmeter name newOrReformattedLines"
Its really strange that same usercontrol works on similar kind of forms and on some forms EXE crashes with this exception.
'newOrReformattedLines' is related to XamsyntaxEditor ,I was debugging into code since 2 days and no clue how to resolve this exception.
-Aparna
I am just checking were you able to create a sample, where the issue is reproducible, so we can investigate this further for you?
In my project where exception occus ,there are lots of events getting called in baground.
I was trying to create simple application with similar flow in which exception occurs ,but I can not reproduce issue in stand alone application .
I have been looking into the exception, but since this is not a known issue, without a sample project, where this is reproduced we are not able to investigate this further for you.
I have attached sample which reproduce crash mentioned above .
(Note : To run EXE you need to change Infragistics DLL references to yur local DLL references,I have removed DLL as f they were causing huge size of zip file upto 6MB )
When you run EXE 1st time you will get Argumet exception in TextDocument and Compatability Error .
On Compatibility Error when youe click on Close button .
Again Run EXE now you will get argumentNullReference Exception in XamSyntaxEditor ,related to parameter 'newOrReformattedLines'
Looking forward for your feddback on this issue.
I have been looking into the sample you have attached and I was able to reproduce the first exception you mentioned and I can suggest you use the Document's Append method instead of InitializeText one on the setter of the Text property. Could you please try this and see if the second exception will continue to occurs.
I have logged this with development under ID: 156848 and I have also created a support ticket on your behalf: CAS-125241-B4Q3Y0 and have linked the development issue to it, so that you can get automatically updated, when a Service Release containing the fix is available for download. You can get the new version from our website’s “My IG”, “My Keys & Downloads” tags: https://ko.infragistics.com/Membership/Default.aspx?panel=Downloads#Downloads
You can also monitor the support ticket’s progress through the “My Support Activity” tag: https://ko.infragistics.com/Membership/MySupport.aspx
Using Append method crash doesnt occured in code which I have provided , But if I use append instead of initialize text in my actual class crash still exist.
Also if append intead of initialize text doesnt serv the actual purpose , even if I add condition checks etc in some scenarios text get appended .
What is exact cause of this error ? How I can resolve it ?