VSM.GoToState fails in RadTileViewItem

6 posts, 0 answers
  1. Clint Singer
    Clint Singer avatar
    133 posts
    Member since:
    Oct 2012

    Posted 14 Oct 2009 Link to this post

    I have created a class that derives from RadTileViewItem which has some VisualStates in it. 

    When I call VisualStateManager.GoToState it will only return false stating that it didn't work.  When I try the same code in a plain UserControl class the VisualStateManager works just fine. 

    Both RadTileViewItem and UserControl end up deriving from ContentControl so I am not sure why it doesn't work.    There is an internal method on Control called GoToState which makes me belive that it should work.

    Any ideas?

    I should point out that the reason that I have derived from RadTileViewItem is because I want to put a toolbar in the header area and have the clicks interact with the body of the RadTileViewItem.  It is a nice clean implementation that puts all of the required parts together; so I would prefer not to have to put another UserControl in the RadTileViewItem (which works BTW.)

    Cheers,
    Clint
  2. Tihomir Petkov
    Admin
    Tihomir Petkov avatar
    576 posts

    Posted 19 Oct 2009 Link to this post

    Hi Clint,

    There should not be any problems calling the GoToState() method. Two possible mistakes when working with the VisualStateManager are (1) not putting the VisualStateGroups in the root element of the control template, and (2) incorrect property paths in the VisualStates. Can you please check if both of the above requirements are satisfied and let me know if the problem still exists?

    Sincerely yours,
    Tihomir Petkov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. DevCraft banner
  4. Clint Singer
    Clint Singer avatar
    133 posts
    Member since:
    Oct 2012

    Posted 19 Oct 2009 Link to this post

    Hi Pavel,

    Before posting I had ensured that the VSM groups were directly under the LayoutRoot control (the topmost control) and that I had the names correct.   As I sort of mentioned before, the same code works fine when I take it from the RadTileViewItem derived control and placing it in a basic UserControl.

    Cheers,
    Clint
  5. Tihomir Petkov
    Admin
    Tihomir Petkov avatar
    576 posts

    Posted 22 Oct 2009 Link to this post

    Hi Clint,

    I prepared a sample project with a control inheriting the RadTileViewItem class and calling the GoToState() method did not cause any errors. Please take a look at it and if it is differing from your scenario, modify it so that I can investigate.

    Regards,
    Tihomir Petkov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  6. Clint Singer
    Clint Singer avatar
    133 posts
    Member since:
    Oct 2012

    Posted 23 Oct 2009 Link to this post

    Hi Tihomir,

    I tried your sample and it does work which then lead me to develop a simple sample that follows the scenario that I am using the control.  Since I have a solution to send in I will escalate this by opening a support ticket,

    Cheers,
    Clint
  7. Tihomir Petkov
    Admin
    Tihomir Petkov avatar
    576 posts

    Posted 24 Oct 2009 Link to this post

    Hello Clint,

    I am closing this thread, we will continue this discussion in the support ticket.

    Sincerely yours,
    Tihomir Petkov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Back to Top
DevCraft banner