protected virtual void OnPlayingDrum(PlayingDrumEventArgs e)
        {
            EventHandler <PlayingDrumEventArgs> handler = PlayingDrum;

            if (handler != null)
            {
                handler(this, e);
            }
        }
        public void SkeletonDrawingFinished(object sender, SkeletonDrawingFinishedEventArgs e)
        {
            //instrument interaction
            Brush brush = Brushes.Tomato;

            using (DrawingContext dc = this.drawingGroup.Open())
            {
                dc.DrawRectangle(Brushes.Transparent, null, new Rect(0.0, 0.0, 640, 480));
                Skeleton trackingSkel = e.LastTracked;
                if (trackingSkel != null)
                {
                    Joint joint    = trackingSkel.Joints[JointType.HandLeft];
                    Point leftHand = SkeletonPointToScreen(joint.Position);

                    joint = trackingSkel.Joints[JointType.HandRight];
                    Point rightHand = SkeletonPointToScreen(joint.Position);

                    if (isTouchingInstrumentEdgeRight(rightHand) || isTouchingInstrumentBody(rightHand) || isTouchingInstrumentEdgeTop(rightHand))
                    {
                        holdingInstrument = false;
                    }
                    else if (!holdingInstrument && isTouchingInstrumentBody(leftHand))
                    {
                        holdingInstrument = true;
                        touchOffsetLeftX  = leftHand.X - instrumentX;
                        touchOffsetLeftY  = leftHand.Y - instrumentY;
                    }
                    if (isTouchingInstrumentEdgeRight(rightHand))
                    {
                        brush = Brushes.Violet;
                    }
                    if (isTouchingInstrumentEdgeTop(rightHand))
                    {
                        brush = Brushes.Yellow;
                    }
                    if (isTouchingInstrumentEdgeTop(leftHand) || isTouchingInstrumentEdgeTop(rightHand))
                    {
                        PlayingDrumEventArgs args = new PlayingDrumEventArgs();
                        args.DrumHeight = instrumentHeight;
                        args.DrumWidth  = instrumentWidth;
                        args.Velocity   = 0;
                        OnPlayingDrum(args);
                    }

                    if (stretchingHorizontally && Math.Abs(rightHand.Y - leftHand.Y) >= stretchBreakThreshold)
                    {
                        stretchingHorizontally = false;
                    }
                    else if (isTouchingInstrumentEdgeLeft(leftHand) && isTouchingInstrumentEdgeRight(rightHand))
                    {
                        stretchingHorizontally = true;
                        stretchingVertically   = false;
                    }

                    if (stretchingVertically && Math.Abs(rightHand.X - leftHand.X) >= instrumentWidth)
                    {
                        stretchingVertically = false;
                    }
                    else if (isTouchingInstrumentEdgeTop(rightHand) && isTouchingInstrumentEdgeBottom(leftHand))
                    {
                        stretchingVertically   = true;
                        stretchingHorizontally = false;
                    }

                    if (stretchingHorizontally)
                    {
                        brush           = Brushes.SteelBlue;
                        instrumentWidth = Math.Abs(rightHand.X - leftHand.X);
                        instrumentX     = leftHand.X;
                    }
                    if (stretchingVertically)
                    {
                        brush            = Brushes.SkyBlue;
                        instrumentHeight = Math.Abs(leftHand.Y - rightHand.Y);
                        instrumentY      = rightHand.Y;
                    }
                    if (holdingInstrument)
                    {
                        brush       = Brushes.SpringGreen;
                        instrumentX = leftHand.X - touchOffsetLeftX;
                        instrumentY = leftHand.Y - touchOffsetLeftY;
                    }
                    if (holdingInstrument && stretchingHorizontally)
                    {
                        brush = Brushes.PeachPuff;
                    }
                    //Console.WriteLine("Hand: " + leftHand.X + "," + leftHand.Y);
                    //Console.WriteLine("Instrument: " + instrumentX + "," + instrumentY);
                }
                instrumentWidth  = (instrumentWidth > instrumentEdge * 2 + 10) ? instrumentWidth : instrumentEdge * 2 + 10;
                instrumentHeight = (instrumentHeight > instrumentEdge * 2 + 10) ? instrumentHeight : instrumentEdge * 2 + 10;
                dc.DrawRectangle(brush, null, new Rect(instrumentX, instrumentY, instrumentWidth, instrumentHeight));
            }
        }