void linkImg_Tapped(object sender, TappedRoutedEventArgs e) { bo.Play(); if (firstBlock == null) { firstImg = sender as LinkImage; firstBlock = (sender as LinkImage).DataContext as LinkBlock; firstImg.StartFlash(); } else { LinkBlock secondBlock = (sender as LinkImage).DataContext as LinkBlock; (sender as LinkImage).StopFlash(); firstImg.StopFlash(); if (linkmap.isCanDead(firstBlock, secondBlock)) { firstBlock.IsAlive = false; secondBlock.IsAlive = false; firstBlock = null; } else { firstBlock = null; } } }