private void ClickDeleteImage(object sender, RoutedEventArgs e) { if (view.imageSelection == null || view.imageSelection == "") { return; } PersistentData data = new PersistentData(SettingsLoader.GetCurrentSettingsData()); //dont delete active wallpaper if (new Uri(view.imageSelection) == new Uri(Wallpaper.active)) { return; } for (int i = 0; i < data.imageData.Count; i++) { if (data.imageData[i].fileName == view.imageSelection) { ImageCacheLoader.UnloadImage(data.imageData[i].fileName, (WrapPanel)Scroll.Content); SelectedImageBox.Source = null; PathHandling.DeleteFile(data.imageData[i].fileName); return; } } }
private void InitializeApp() { Scroll.Content = ImageCacheLoader.LoadImages(); SettingsLoader.LoadSettingsFromDisk(); PersistentData currentData = SettingsLoader.GetCurrentSettingsData(); DisplaySettings(currentData); //weather data weatherHandler = new WeatherHandler(currentData.openWeatherMapAPIKey, currentData.plz); DispatcherTimer LiveTime = new DispatcherTimer(); UpdateDataPeriodic(this, null); //show immediatly after application start, then start thread LiveTime.Interval = TimeSpan.FromSeconds(30); LiveTime.Tick += UpdateDataPeriodic; LiveTime.Start(); FillComboboxes(); ImageChanger.StartImageCycling(weatherHandler); }
private void ClickImportImages(object sender, RoutedEventArgs e) { PathHandling.ImportFiles(); Scroll.Content = null; Scroll.Content = ImageCacheLoader.LoadImages(); }