ConventionManager Syncfusion Controls

Topics: Conventions
Feb 27, 2012 at 9:01 AM

I've been trying to get a third party Editcontrol from Syncfusion to work with Caliburn Micro, but it doesn't seem to work:

The editcontrol has the following two Conventions i want to use, which i set in my bootstrapper. Somehow that doesn't seem to be enough since it doesn't work.

The Editcontrol itself inherits from Control, which in turn inherits from FrameWorkElement.

Anybody happen to know what i'm missing??:

 

protected override void Configure()
{

ConventionManager.AddElementConvention<EditControl>(EditControl.TextProperty, "Text", "TextChanged");
            
ConventionManager.AddElementConvention<EditControl>(EditControl.SelectedTextProperty, "SelectedText", " SelectedTextChanged");

base.Configure();
}

 

 

Feb 27, 2012 at 3:42 PM

do you have logging running when you run the app?  Reference the GamingLibrary for an example logger that spit out to the Debug Console, stuff that CM runs into while doing its thing..  It might help you see what is going with the bindings...

Feb 28, 2012 at 12:36 PM
Edited Feb 28, 2012 at 12:37 PM

I've enable Logging and i found out i forgot something.

By enabling both Items in conventionmanager the control does the following when importing text:

The Editcontrol gets filled with text. However, when i select something in my Editcontrol the whole content of editcontrol gets replace by string.empty

because that is my selection. So when i use conventionmanager twice on different properties it seems x:Name="BoxField"  gets bound to both properties???

So i'm assuming i only have to do the top conventionmanager line to get the Text property binding to work with the prop in the C# code.

I did that and that works, but somehow the Event Selectedtext does not get fired. And this is the line i use to get the selectedtext:

cal:Message.Attach="[Event SelectedTextChanged]=[Action Selection($source,$eventArgs)]"

But it doesn't get fired with the SelectedTextChanged event. However if i just put a random event there like KeyDown, the event does get fired.

Does this mean i have to perform additional steps in Caliburn in the bootstrapper to tell it that that specific event also exists?

XAML:

<EditControl x:Name="BoxField">

C#

private string _BoxField;

public BoxField
{

get{ return _BoxField};
set{ _BoxField = value; NotifyOfPropertyChange(()=>BoxField);
}

 

 

May 2, 2012 at 9:31 AM

To close this matter, this wasn't a bug in Caliburn but in the Editcontrol by Syncfusion, A patch has been given and everything works as should now :)