locked
Arranging scatterview items into a grid RRS feed

  • Question

  • Hi,

    I am trying to create a grid (not visible) that will allow me to arrange all the open items on the table. For the purpose of this application, I have limited open documents to 9. So what happens is, when clicked on the "Arrange" button, the open documents resize (for which do I need to apply animation??) and then randomly are placed in the grid. How do I go about doing this?

    My main concern is, how do I put the scatterview items into the grid? I have already created a grid.

     

    Tanya

    Thursday, March 25, 2010 1:10 PM

Answers

  • There is no pseudo-grid control. I think what Bradley is trying to say is that you could either do the grid calculations yourself or use a separate grid just for measurement purposes. Once you have calculated the target center/widht/height and orientation, you could an animation of the ScatterViewItem properties as follows: (Assuming svi is one of your ScatterViewItems)

              svi.BeginAnimation(ScatterViewItem.CenterProperty, new PointAnimation(svi.ActualCenter, targetCenter, duration, FillBehavior.Stop));
              svi.BeginAnimation(ScatterViewItem.WidthProperty, new DoubleAnimation(svi.ActualWidth, targetWidth, duration, FillBehavior.Stop));
              svi.BeginAnimation(ScatterViewItem.HeightProperty, new DoubleAnimation(svi.ActualHeight, targetHeight, duration, FillBehavior.Stop));
              svi.BeginAnimation(ScatterViewItem.OrientationProperty, new DoubleAnimation(svi.ActualOrientation, targetOrientation, duration, FillBehavior.Stop));

    thanks,
    Luis Cabrera
    Platform Program Manager - Microsoft Surface.


    Developer
    Thursday, April 1, 2010 3:39 PM

All replies

  • Tanya,

    You would have to create a puesdo grid. Setting the width / height / center property of each item, and the applying the animations to move them to where they need to be.

    ~brad


    Brad Foley | www.blfoley.com
    Thursday, March 25, 2010 1:29 PM
  • Is there somewhere I can look for reference for the pseudo grid? I have never used it before. :)

    If there are alternate solutions, do let me know too.

    Friday, March 26, 2010 1:38 AM
  • Does this arrange is something similar that the Concierge demo does that you are trying to achiev ?


    Your experience is build from the one of others
    Tuesday, March 30, 2010 8:14 AM
  • There is no pseudo-grid control. I think what Bradley is trying to say is that you could either do the grid calculations yourself or use a separate grid just for measurement purposes. Once you have calculated the target center/widht/height and orientation, you could an animation of the ScatterViewItem properties as follows: (Assuming svi is one of your ScatterViewItems)

              svi.BeginAnimation(ScatterViewItem.CenterProperty, new PointAnimation(svi.ActualCenter, targetCenter, duration, FillBehavior.Stop));
              svi.BeginAnimation(ScatterViewItem.WidthProperty, new DoubleAnimation(svi.ActualWidth, targetWidth, duration, FillBehavior.Stop));
              svi.BeginAnimation(ScatterViewItem.HeightProperty, new DoubleAnimation(svi.ActualHeight, targetHeight, duration, FillBehavior.Stop));
              svi.BeginAnimation(ScatterViewItem.OrientationProperty, new DoubleAnimation(svi.ActualOrientation, targetOrientation, duration, FillBehavior.Stop));

    thanks,
    Luis Cabrera
    Platform Program Manager - Microsoft Surface.


    Developer
    Thursday, April 1, 2010 3:39 PM