This is a migrated thread and some comments may be shown as answers.

Is it possible to bind events using ContainerBinding?

1 Answer 57 Views
Menu
This is a migrated thread and some comments may be shown as answers.
Rob
Top achievements
Rank 1
Rob asked on 30 Aug 2010, 02:42 PM
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>

1 Answer, 1 is accepted

Sort by
0
Valeri Hristov
Telerik team
answered on 30 Aug 2010, 04:11 PM
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
Tags
Menu
Asked by
Rob
Top achievements
Rank 1
Answers by
Valeri Hristov
Telerik team
Share this question
or