private async void WallpaperChanging(object state) { Wallpaper currentWallpaper = _tempWallpapers[_currentWallpaperIndex++]; Phrase phrase = _tempPhrases[_currentPhraseIndex++]; var image = await currentWallpaper.GetFixedSignedImage(new Signature(phrase.OriginalText, phrase.TranslatedText, DefaultSignature.Format)); if (_currentWallpaperIndex >= Wallpapers.Count) { _currentWallpaperIndex = 0; } if (_currentPhraseIndex >= _tempPhrases.Length) { _currentPhraseIndex = 0; } if (!Directory.Exists(WallpaperTempPath)) { Directory.CreateDirectory(WallpaperTempPath); } string wallpaperPath = Path.Combine(WallpaperTempPath, TEMP_FILE_NAME); image.Dispatcher.Invoke(() => currentWallpaper.SaveToFile(image, wallpaperPath)); WinAPI.SetWallpaper(wallpaperPath); WinAPI.SetWallpaperStyle(currentWallpaper.Style); _callBack?.Invoke(currentWallpaper, phrase); }
public WallpaperRemovedEventArgs(Wallpaper item) { RemovedItem = item; }
public WallpaperAddedEventArgs(Wallpaper item) { AddedItem = item; }
public void RemoveWallpaper(Wallpaper wallpaper) { Wallpapers.Remove(wallpaper); }
public void AddWallpaper(Wallpaper wallpaper) { Wallpapers.Add(wallpaper); }