Telerik controls

May 5, 2011 at 2:16 AM

In a new project I am building, I am planning on use the Telerik Silverlight controls. Should the automatic wiring up of buttons to a command in the viewmodel work with Telerik controls in the same way? I haven't had a chance to play with this yet.




May 5, 2011 at 2:08 PM

You should just need to add some custom conventions for the Telerik controls that you wish to use. After that, everything *should* work :)

May 5, 2011 at 3:34 PM


Two questions:

1) Would it be pretty simple to setup a spot somewhere to start sharing some of these things?  I'm sure there are lots of Telerik users, myself included, or other '3rd party controls, that could contribute their conventions.  I am just starting my migration into CM so I haven't even worried yet about my Telerik controls.  Obviously it needs someone to 'take charge' as there are probably half a dozen different implementations but it would be fantastic to be able to grab an add-on conventions package for different sets of 3rd party controls.

- Is there anyone with a stable implemented set of conventions for Telerik controls that wants to share as a starting point? (purely selfish request from me as well).

2) I know the conventions can easily be extended but is it setup that one could add in a shared library in one swoop (My MEF for dummies book is also open on my desk as this is my first foray with that as well.)  But my thought is if we could have a convention to import conventions (no pun intended) then I could set it up to pull in the IConventionsTelerik and IConventionsCsla and IConventionsToolkit, etc.

2a) That being said - if I don't like the community conventions for the Telerik Control xyz can I override that control after I have imported the IConventionsTelerik?

Any thoughts or is that just something better left to the individual and adding in each control.


May 5, 2011 at 4:41 PM

I would definitly find this useful... I am new to this framework and would like to see examples of "custom conventions" that are needed for Telerik or other 3rd party controls.


May 5, 2011 at 7:45 PM
Edited May 5, 2011 at 7:56 PM

            ConventionManager.AddElementConvention<RadDateTimePicker>(RadDateTimePicker.SelectedValueProperty, "SelectedValue", "SelectionChanged");
            ConventionManager.AddElementConvention<RadGridView>(DataControl.ItemsSourceProperty, "SelectedItem", "SelectionChanged")
                .ApplyBinding = (viewModelType, path, property, element, convention) =>
                    if (!ConventionManager.SetBinding(viewModelType, path, property, element, convention)) return false;
                    if (ConventionManager.HasBinding(element, DataControl.SelectedItemProperty)) return true;
                    var index = path.LastIndexOf('.');
                    index = index == -1 ? 0 : index + 1;
                    var baseName = path.Substring(index);
                    foreach (var selectionPath in
                        from potentialName in ConventionManager.DerivePotentialSelectionNames(baseName)
                        where viewModelType.GetProperty(potentialName, BindingFlags.IgnoreCase | BindingFlags.Public | BindingFlags.Instance) != null
                        select path.Replace(baseName, potentialName))
                        BindingOperations.SetBinding(element, DataControl.SelectedItemProperty, new Binding(selectionPath) { Mode = BindingMode.TwoWay });
                    return true;

 I have these custom conventions (and many more...) in my bootstrapper (config method) for the time being.  Works fine!

May 5, 2011 at 8:32 PM

Maybe you guys want to start up a codeplex project for Caliburn.Micro conventions? You could just create single file classes with an Install method and make those available. Something like this:

using Caliburn.Micro;

public static class TelerikConventions{

   public static void Install(){

      //the convention code goes here...



You wouldn't need to publish assemblies. Just make the source files available. You could even create NuGet packages for them. Just a thought...

May 5, 2011 at 8:49 PM

If someone wanted to remove/override an 'installed' convention is that straight forward? 

Or would it help to have an OnAddElementConvention( ) that allowed someone to peek at it and cancel if they had a different custom override for that particular scenario?

Or what about an AddInstalledElectionConvention as a non-default implemenatation so nothing impacts the current implementation?

May 6, 2011 at 1:47 PM

You can override a convention by calling AddElementConvention with the new convention.

Jun 5, 2011 at 11:34 PM

For those interested in integration with Telerik, I've put together a project on GitHub and a nuget package that contains some conventions, a basic implementation of IWindowManager and sample projects demoing all this stuff.

Check it out. Use it how you like, copy the code or use the package.

Feedback and contributions are welcome.

Jun 6, 2011 at 2:19 AM

Hi Valeriu

This is awesome! Thanks for putting this together...I've made good progress the past few days working with the CM framework and getting Telerik controls in the views.. this is a big help. Thanks for the effort!