Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5938755
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T15:43:50+00:00 2026-05-22T15:43:50+00:00

Recently I came across this Pete Blois’s behavior named Explode. This is the link

  • 0

Recently I came across this Pete Blois’s behavior named Explode. This is the link :-

http://blois.us/blog/2009/07/explode.html

When you click on the grid the grid just explodes looking like real 3D effect even though Silverlight doesn’t have a true 3D effect.

I studied the code but couldn’t get the core logic of the behavior. Can anybody explain me what is the function PrepareShards, ApplyForce doing? Also what is the purpose of Shards class? I think it is trying to simulate a point which has X,Y and Z. I studied the code for 1/2 hour but couldn’t get at all what it is doing. I know I don’t need to understand the logic behind this.

But what if I want to create some advanced effects like this? It’s always good to study what’s going under the hood. Has anybody written a blog post explaining what is this code or any book where the author teaches this type of real life stuff? Or if you all have the time can you explain me what is it doing?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T15:43:51+00:00Added an answer on May 22, 2026 at 3:43 pm

    The author gives you the code, but it is not commented. That turns it into a puzzle!

    The way this code works is:

    • It is a Behavior using System.Windows.Interactivity
    • The behavior is attached in XAML to the element you want to explode
    • Explode hooks the mouse events so it knows the mouse position when clicked
    • In StartExplode it first calls PrepareShards
    • PrepareShards creates a Popup which contains a Grid which contains a matrix of Rectangle elements
    • The new Popup looks exactly like the original but it is no longer interactive: it’s fake
    • It “hides” the original interactive element by setting its Opacity to zero
    • A Shard is a wrapper around each Rectangle to keep track of its position and animation
    • ApplyForce is called to animate all the rectangles

    What is ApplyForce doing? Physics. It’s just formulas.

    So this is just a combination of fakery and clever 2D and 3D graphics. Once you understand the overall structure of how it works, the individual steps are less daunting: just figuring out how to get the API to do what you want to do.

    For example, the author needs to convert the tiny grid region (2, 3) of the original interactive framework element into a bitmap image and draw it onto the corresponding rectangle in the grid. Once drawn, due to the retained-mode nature of the graphics subsystem, it never needs to be worried about again.

    Effects like this are not easy to write but they are not impossible either and they can be a lot of fun. You will definitely learn a lot of techniques that will serve you well when write other less “gimmicky” applications!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

No related questions found

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.