Resize Tiles Using Drag

3 posts, 0 answers
  1. Anthony
    Anthony avatar
    58 posts
    Member since:
    Aug 2011

    Posted 31 Jul 2014 Link to this post

    Hi,

    I have used the following blog to get some varying sized tiles which is great but I would like my users to be able to adjust tile sizes themselves.

    http://blogs.telerik.com/xamlteam/posts/11-06-25/new-tileview-features.aspx

    Is there any way that you can resize a tile by dragging on its bottom right corner?

    I can do it by putting a button on the tile and in the button press adjust the RestoredWidth and RestoredHeight of the tile but this is not a great UI experience.

    Thanks
    Anthony
  2. Huy
    Huy avatar
    10 posts
    Member since:
    Jul 2014

    Posted 31 Jul 2014 Link to this post

    I'm also interested in this problem

    Some sample code would be appreciated

    Thanks
  3. UI for WPF is Visual Studio 2017 Ready
  4. Anthony
    Anthony avatar
    58 posts
    Member since:
    Aug 2011

    Posted 03 Aug 2014 in reply to Huy Link to this post

    Hi,

    I figured this one out myself.

    I added a Thumb to the tile:

    <Thumb VerticalAlignment="Bottom" HorizontalAlignment="Right" Width="10" Height="10" DragDelta="Thumb_DragDelta"/>

    And handled the drag delta in code behind to set the height and width of the tile in my view model:

                (DataContext as DashboardItemViewModel).RestoredHeight += e.VerticalChange;
                (DataContext as DashboardItemViewModel).RestoredWidth += e.HorizontalChange;

    Thanks
    Anthony
Back to Top