Fading out items

4 posts, 0 answers
  1. Jerome
    Jerome avatar
    87 posts
    Member since:
    Aug 2010

    Posted 29 Nov 2012 Link to this post

    I've managed to get a RadTileViewItem to fade in when it's added to the TileView. That was easy of course, as the item exists, and I can just set it's opacity to 0 and move it up.

    However, I also want to get an item to fade out. But, when the item is removed from the underlying collection, the RadTileViewItem is of course immediately removed, and so it's gone.

    How can I accomplish this? 
  2. Pavel R. Pavlov
    Admin
    Pavel R. Pavlov avatar
    1182 posts

    Posted 04 Dec 2012 Link to this post

    Hi Jerome,

    Let me get straight to your question. As you (manually) remove the RadTileViewItems from your business collection you can add the "fade out" animation just before you delete the item. In order to this you can use a DispatcherTimer to decrease the opacity of the item to 0 and then you can delete it. Please take a look at the attached project and let me know if it works for you.

    Regards,
    Pavel R. Pavlov
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. UI for WPF is Visual Studio 2017 Ready
  4. Jerome
    Jerome avatar
    87 posts
    Member since:
    Aug 2010

    Posted 04 Dec 2012 Link to this post

    I don't have RadTileViewItems in my business collection. I have business objects. I'm trying to stay as MVVM as possible.
  5. Pavel R. Pavlov
    Admin
    Pavel R. Pavlov avatar
    1182 posts

    Posted 07 Dec 2012 Link to this post

    Hi Jerome,

    In your case you can create a property in your business data (e.g. MyOpacity) and bind it in two way mode to the Opacity property of the RadTileViewItem using a Style.Setter in XAML. I have implement the approach in the attached project. Please take a look at it and let me know if it works for you.

    Kind regards,
    Pavel R. Pavlov
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Back to Top