void RegistrationService_Subscribed(object sender, RegistrationService.SubscriptionEventArgs e)
 {
     Dispatcher.BeginInvoke((Action)(() =>
     { UpdateStatus(); })
     );
 }
        void RegistrationService_DataRequested(object sender, RegistrationService.DataRequestEventArgs e)
        {
            if (!componentsSentData.ContainsKey(e.ComponentName))
            {
                return;
            }

            SentData latestData = componentsSentData[e.ComponentName];

            // Send raw message
            byte[] payload = prepareRAWPayload(e.ComponentName, latestData.PassRate, latestData.ImageType, latestData.TestProgress, latestData.TestCoverage, latestData.CodeCoverage);

            rawPushNotificationMessage.RawData = payload;

            rawPushNotificationMessage.SendAsync(e.ChannelUri,
                (result) => OnMessageSent(NotificationType.Raw, result),
                (result) => { });

            // send tile message
            tilePushNotificationMessage.BackgroundImageUri = new Uri("/Images/" + latestData.ImageType + ".png", UriKind.Relative);
            if (double.Parse(latestData.PassRate) <= 99)
                tilePushNotificationMessage.Count = Convert.ToInt32(double.Parse(latestData.PassRate));
            else
            {
                tilePushNotificationMessage.Count = 0;
            }
            tilePushNotificationMessage.Title = e.ComponentName;
            tilePushNotificationMessage.SecondaryTile = MakeTileUri(e.ComponentName).ToString();
        }