Is it possible to bind events using ContainerBinding?

2 posts, 0 answers
  1. Rob
    Rob avatar
    238 posts
    Member since:
    Jan 2009

    Posted 30 Aug 2010 Link to this post

    I am using ContainerBinding to bind some properties to a RadMenuItem like this....

    <Rad:ContainerBinding.ContainerBindings>
       <Rad:ContainerBindingCollection>
          <Rad:ContainerBinding PropertyName="Icon" Binding="{Binding VectorXaml}" />
          <Rad:ContainerBinding PropertyName="IsEnabled" Binding="{Binding IsEnabled}" />
       </Rad:ContainerBindingCollection>
    </Rad:ContainerBinding.ContainerBindings>


    Is there any way to attach events, for example the "Loaded" event through ContainerBinding?  Something like this would be ideal...
    <Rad:ContainerBinding.ContainerBindings>
       <Rad:ContainerBindingCollection>
          <Rad:ContainerBinding PropertyName="Loaded" Binding="{Binding SomeFunction}" />
       </Rad:ContainerBindingCollection>
    </Rad:ContainerBinding.ContainerBindings>

  2. Valeri Hristov
    Admin
    Valeri Hristov avatar
    2252 posts

    Posted 30 Aug 2010 Link to this post

    Hello Rob,

    Why do you need to attach event handlers on the item containers? Generally, you could set ItemTemplate and inside it, add a Loaded handler to the root element. In this handler you could get a reference to the item container using the ParentOfType<T>() extension method that comes in the Telerik.Windows.Controls namespace.

    Best wishes,
    Valeri Hristov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. DevCraft banner
Back to Top