Exemple #1
0
        private async void BtnApply_Click(object sender, EventArgs e)
        {
            string path = null;

            if (SelectMenu.IsFromWeb)
            {
                path = selectMenu.GetPathFromWeb();
            }
            else
            {
                path = selectMenu.GetImageLocalPath();
            }
            DesktopWallpaperChangerService wallpaper = new DesktopWallpaperChangerService();

            if (RbStretched.Checked)
            {
                await DesktopChangerMainMenuController.SetNewDesktopStretchedAsync(path, wallpaper);
            }
            else if (RbTiled.Checked)
            {
                await DesktopChangerMainMenuController.SetNewDesktopTiledAsync(path, wallpaper);
            }
            else
            {
                await DesktopChangerMainMenuController.SetDesktopCentredAsync(path, wallpaper);
            }
        }
Exemple #2
0
 public static async Task SetNewDesktopStretchedAsync(string path, DesktopWallpaperChangerService wallpaper)
 {
     await Task.Run(() => wallpaper.Set(path, DesktopWallpaperChangerService.Style.Stretched));
 }