Adding Tiles Dynamically In Minimized State

6 posts, 1 answers
  1. Barry
    Barry avatar
    90 posts
    Member since:
    Jul 2011

    Posted 22 Feb 2012 Link to this post

    I have a TileView that I add tiles to dynamically by just adding a RadTileViewItem to the collection that the TileView is bound to. I use a FluidContentControl with the TileView in order to have the three different views - maximized, minimized, and restored. The issue that I am having is that when I add a RadTileViewItem when a tile is maximized it will put the newly added tile in the minimized section, which is fine, but it shows the restored content instead of the minimized content.

    I have set the TileState of the RadTileViewItem to Minimized, but it seems to need the FluidContentControl's FluidContentControlState set to small... how would I access this from my View Model to set it (MVVM style)? Is there some easy way to have the content show up correctly?
  2. Barry
    Barry avatar
    90 posts
    Member since:
    Jul 2011

    Posted 23 Feb 2012 Link to this post

    As a work-around I just restore the maximized tile when new tiles are added... I bind to the MaximizedItem property and just set that to nothing when I add a new tile.

    I would still like to know why it shows the "restored" content in the minimized state when a new tile is added while one of the tiles is maximized.
  3. DevCraft banner
  4. Barry
    Barry avatar
    90 posts
    Member since:
    Jul 2011

    Posted 23 Feb 2012 Link to this post

    In a related issue... when there is only one tile left on the TileView it shows the "restored" content. I would like it to show the "maximized" content. When I set the MaximizedItem to the only remaining tile it changes the togglebutton to the minus sign but the content still shows the "restored" content. How do I change the content with the state of the tile?
  5. Answer
    Zarko
    Admin
    Zarko avatar
    755 posts

    Posted 27 Feb 2012 Link to this post

    Hello,
    Could you please send us some code snippets or a project which shows how do you change the State of the RadFluidContentControl (do you bind it to a property in the ItemViewModel, use the (Preview)TileStateChanged to manually change the state or something else). Also do you use business objects in you RadTileView or you're directly adding RadTileViewItems?
    I've attached the sample project that I used for testing and as far as I could see everything seems to be working fine, so could you please examine it and see if it helps you. 

    Greetings,
    Zarko
    the Telerik team
    Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
  6. Barry
    Barry avatar
    90 posts
    Member since:
    Jul 2011

    Posted 27 Feb 2012 Link to this post

    Actually I found a way to make everything work the way that I wanted to. I just set the "ContentChangeMode" to automatic and set the thresholds on the RadFluidContentControl, like so:

    <telerik:RadFluidContentControl ContentChangeMode="Automatic"
              SmallToNormalThreshold="200 200"
              NormalToSmallThreshold="200 200"
              NormalToLargeThreshold="400 400"
              LargeToNormalThreshold="400 400"
              State="Normal"
              TransitionDuration="0:0:.5">
    <!-- Content Templates-->
    </telerik:RadFluidContentControl>



    Now the correct content is displayed depending on the size of the tile. When I add a new tile that is minimized it shows the minimized content and when only one tile is left on the screen it shows the maximized content.

    P.S. Thanks for the demo!
  7. Zarko
    Admin
    Zarko avatar
    755 posts

    Posted 29 Feb 2012 Link to this post

    Hello,
    I'm glad you've found solution for you problem, but I'd like warn you that the Thresholds are not 100% accurate and if you can you'd better use bindings or handle the TileStateChanged event.
    If you need further assistance please feel free to ask.

    Regards,
    Zarko
    the Telerik team
    Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
Back to Top
DevCraft banner