Databinding simplet string property To SyntaxEDitor

SyntaxEditor for WPF Forum

Posted 5 years ago by Jack Stephenson
Version: 14.1.0602
Avatar

Have implemented a class with property Text that supports INotofyPropertyChanged

Trying to bind it  to the SyntaxEditor.

Thried these 3 differen scenarios (at different times.

<!-- This Code Works -->
<TextBox x:Name="tempTextBox" />
<syntaxeditor:SyntaxEditor AreLineModificationMarksVisible="False"
                                            IsTextDataBindingEnabled="True"
                                            Text="{Binding ElementName=x:Name="tempTextBox", Path=Text, Mode=TwoWay}" />
 
This provied that the SyntaxEDitor can be bound to.
 
-------------
 
 
<!-- This Code Works -->
<TextBox Text="{Binding myObject.Text}"
 
This proved that myObject can be bound to
 
 
--------------
 
So why cant I bind myObject to the syntaxEDitor???
 
<!-- This Code Doesnt Works -->
<syntaxeditor:SyntaxEditor AreLineModificationMarksVisible="False"
                                            IsTextDataBindingEnabled="True"
                                            Text="{Binding myObject.Text}" />
 
Nothing happens here. Although if I debig it is hitting the getter in my text property.
 
 
What am I doing wrong?
 
Thanks
 
------
JES
 
 
 

Comments (3)

Posted 5 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Jack,

I'm not sure without debugging it.  If you'd like us to take a look, please make a new simple sample project that shows this happening and email that to our support address.  In your email, reference this thread and be sure to rename the .zip file extension so it doesn't get spam blocked.  Thanks!


Actipro Software Support

Posted 5 years ago by Jack Stephenson
Avatar

So you are saying it should work with a POC and any property not just a dependency property?

Posted 5 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

I would think so since as long as IsTextDataBindingEnabled = true, and the SyntaxEditor.Text property setter is called, it should update from your property to the SyntaxEditor.

For the other way around, I did notice that you didn't set a Mode=TwoWay on the last binding.  Perhaps that's the reason it's not working for you?  TextBox.Text property might be set up to two-way bind by default, which would mean you wouldn't need it there.  But you would need it in our case.


Actipro Software Support

The latest build of this product (v2019.1 build 0682) was released 4 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.