[BREAKING CHANGE]PropertyDefinition's Binding property is now of type BindingBase

2 posts, 1 answers
  1. Paul
    Paul avatar
    113 posts
    Member since:
    May 2009

    Posted 13 Mar 2013 Link to this post

    Hi,
        With this new breaking change how would I achieve the following that worked before this change.
    e.PropertyDefinition.Binding.Converter = new Classes.NumberToBooleanConverter();
    e.PropertyDefinition.EditorTemplate = GetCheckBoxDataTemplate(e.PropertyDefinition.Binding.Path.Path);

    Setting the converter and accessing the binding.Path
    Thanks
    Paul
  2. Answer
    Ivan Ivanov
    Admin
    Ivan Ivanov avatar
    1128 posts

    Posted 13 Mar 2013 Link to this post

    Hello,

    As BindingBase is a base type for Binding, you can check whether the e.PropertyDefinition.BInding is Binding and upcast it, like this:
    if(e.PropertyDefinition.Binding is Binding)
    (e.PropertyDefinition.Binding as Binding).Converter = 
    new Classes.NumberToBooleanConverter();
    Basically the autogenerated binding are always of type Binding so direct cast should be safe. We have changed the property type to be BindingBase in order to add support for Multibinding and PriorirtyBinding in WPF and since we maintain common codebase for both platforms we had to change it in SL too.

    Greetings,
    Ivan Ivanov
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. DevCraft banner
Back to Top