The code in Listing 4-2 shows the event handler for the SkeletonFrameReady event. Each time the
event handler executes it retrieves the current frame by calling the OpenSkeletonFrame method on the
event argument parameter. The remaining code iterates over the frame’s array of Skeleton objects and
draws lines on the UI that connect the skeleton joints. This creates a stick figure for each skeleton. The
UI for our application is simple. It is only a Grid element named “LayoutRoot” and with the background
set to white.