TopContainer Property always Null

3 posts, 0 answers
  1. Adam
    Adam avatar
    38 posts
    Member since:
    Oct 2010

    Posted 12 Jan 2011 Link to this post

    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. Maya
    Admin
    Maya avatar
    4062 posts

    Posted 17 Jan 2011 Link to this post

    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>>
  3. UI for WPF is Visual Studio 2017 Ready
  4. Adam
    Adam avatar
    38 posts
    Member since:
    Oct 2010

    Posted 17 Jan 2011 Link to this post

    Maya,

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

    Adam Burdette
Back to Top