Exemplo n.º 1
0
        private void Collect_Click(object sender, RoutedEventArgs e)
        {
            string extrass = "";

            if (Extras.Items.Count > 0 && Extras.SelectedItem != null)
            {
                extrass = Extras.SelectedItem.ToString();
            }
            imagePreviev.Source = new BitmapImage(new Uri(@"f:\loading.jpg"));
            Thread thread = new Thread(new ThreadStart(delegate() {
                Thread.Sleep(200);
                try
                {
                    this.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Send, new Action(delegate() {
                        Console.WriteLine(Websites[WebList.SelectedItem.ToString()]);
                        GetWallpaper getW = new GetWallpaper();

                        Collect.IsEnabled = true;
                        bi3 = getW.CollectWallpaper(Websites[WebList.SelectedItem.ToString()], extrass);
                        imagePreviev.Source = bi3;
                    }));
                }
                catch { }
            }));


            if (WebList.SelectedItem != null)
            {
                Collect.IsEnabled = false;
                Collect.Content   = "Next";
                thread.Name       = "GetImage";
                thread.Start();
            }
        }
Exemplo n.º 2
0
 private void SetWallpaper_Click(object sender, RoutedEventArgs e)
 {
     if (Collect.Visibility == Visibility.Visible)
     {
         GetWallpaper getW = new GetWallpaper();
         getW.ChangeWallpaper(bi3);
     }
 }