/// <summary> /// Handles piano key state change. /// </summary> /// <param name="pianoKey"></param> /// <param name="isPressed"></param> private void StateChanged(SurfaceControls.SurfaceButton pianoKey, bool isPressed) { if (isPressed) { // play the note and draw piano key in the pressed state PlayNote(pianoKey); DrawPianoKey(pianoKey, true); } else { // draw the piano key in unpressed state DrawPianoKey(pianoKey, false); } }
//---------------------------------------------------------// /// <summary> /// Occurs when a manipulationCompleted event is fired. /// </summary> /// <remarks> /// An item has been moved. See if it is placed near another item that to which it can be joined. /// </remarks> /// <param name="sender">The object that raized the event.</param> /// <param name="args">The arguments for the event.</param> void OnManipulationCompleted(object sender, SSC.ContainerManipulationCompletedEventArgs args) { // Validate input ScatterViewItem item = args.OriginalSource as ScatterViewItem; if (item == null) { return; } // If there are any pieces the can be joined, then join them StartJoinIfPossible(item); }