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

TopContainer Property always Null

2 Answers 55 Views
Carousel
This is a migrated thread and some comments may be shown as answers.
Adam
Top achievements
Rank 1
Adam asked on 12 Jan 2011, 03:56 PM
Hi, I am trying to write a behavior for a radcarousel panel such that when the top most item gets a MouseEnter event a state is activated.  However, the TopContainer property always comes up as null.  Is this because the TopContainer property is not set at this point?  Below is the line of code I am running.

this.AssociatedObject.TopContainer.MouseEnter += new MouseEventHandler(TopContainer_MouseEnter);

Thanks,
Adam Burdette

2 Answers, 1 is accepted

Sort by
0
Maya
Telerik team
answered on 17 Jan 2011, 03:34 PM
Hi Adam,

The null result is caused by the fact that the TopContainer is not yet realized. I am sending you a sample project illustrating a slightly different approach for achieving the required behavior - you need to subscribe to the TopContainerChanged event first and only then to invoke the MouseEnter and MouseLeave events. Thus you will ensure that the TopContainer will be available.
 

All the best,
Maya
the Telerik team
Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
0
Adam
Top achievements
Rank 1
answered on 17 Jan 2011, 04:54 PM
Maya,

I suspected that was the case but didn't know how to get it to realize, thank you very much!

Adam Burdette
Tags
Carousel
Asked by
Adam
Top achievements
Rank 1
Answers by
Maya
Telerik team
Adam
Top achievements
Rank 1
Share this question
or