Exemple #1
0
        // If CurrentPoints is updated, run the animation and notify any subscribers of the fact (for instance, so that the ScoreBoard can reorder the items.)
        private void CurrentPoints_TargetUpdated(object sender, DataTransferEventArgs e)
        {
            var textBlock = e.Source as TextBlock;

            if (textBlock.Text != "0")
            {
                (Resources["ShowCurrentPointsStoryboard"] as Storyboard).Begin();

                if (int.TryParse(textBlock.Text, out int numPoints))
                {
                    CurrentPointsUpdated?.Invoke(this, numPoints);
                }
            }
        }
 private void ScoreBoardItem_CurrentPointsUpdated(object sender, int e)
 {
     CurrentPointsUpdated?.Invoke(sender, e);
 }