예제 #1
0
        //Advance Images Download Completed Event
        private void AdvanceDownloadCompleteA(object sender, DownloadDataCompletedEventArgs e)
        {
            BitmapImage image = new BitmapImage();

            image.BeginInit();
            image.StreamSource = new MemoryStream(e.Result);
            image.EndInit();

            image1 = image;
            currentImage.Source = image1;
            WinConfigWrapper.SetWallPaper(image, wallpaperStyle);
        }
예제 #2
0
        //Advance next image only
        private void AdvanceDownloadAsync(string url)
        {
            WebClient client = new WebClient();

            client.DownloadDataCompleted += AdvanceDownloadComplete;

            WinConfigWrapper.SetWallPaper(image2, wallpaperStyle);

            try
            {
                client.DownloadDataAsync(new Uri(url));
            }
            catch (Exception ex)
            {
                //General catch all
                //Silently fail
            }
        }