コード例 #1
0
 private async void SetAsBackgroundBtn_Click(object sender, RoutedEventArgs e)
 {
     if (CurrentImage.DownloadedFile != null)
     {
         await WallpaperSettingHelper.SetAsBackgroundAsync(CurrentImage.DownloadedFile);
     }
 }
コード例 #2
0
 private async Task SetAsAsync()
 {
     if (DeviceUtil.IsXbox)
     {
         await WallpaperSettingHelper.SetAsBackgroundAsync(_resultFile as StorageFile);
     }
     else
     {
         IsMenuOn = !IsMenuOn;
     }
 }
コード例 #3
0
        private async Task HandleLaunchArg(string arg)
        {
            if (arg == Value.SEARCH)
            {
                ShowSearchBar = true;
            }
            else if (arg == Value.DOWNLOADS)
            {
                ShowDownloadsUC = true;
            }
            else
            {
                var queryStr = QueryString.Parse(arg);
                var action   = queryStr[Key.ACTION_KEY];
                if (!queryStr.Contains(Key.FILE_PATH_KEY))
                {
                    return;
                }
                var filePath = queryStr[Key.FILE_PATH_KEY];
                if (filePath != null)
                {
                    switch (action)
                    {
                    case Value.SET_AS:
                        await WallpaperSettingHelper.SetAsBackgroundAsync(await StorageFile.GetFileFromPathAsync(filePath));

                        break;

                    case Value.VIEW:
                        await Launcher.LaunchFileAsync(await StorageFile.GetFileFromPathAsync(filePath));

                        break;
                    }
                }
            }
        }