Exemplo n.º 1
0
        /// <summary>
        /// Load uri and set data in cache
        /// </summary>
        private async void GetUriCommandAction()
        {
            var result = await WebDataCache.GetAsync(new Uri("http://microsoft.com"), forceGet : false);

            if (result == null)
            {
            }
        }
Exemplo n.º 2
0
        public async Task GetAsyncLongUriTest()
        {
            int length = 500;

            var baseUri = "http://www.google.com/favicon.ico?";
            var q       = new string('x', length - baseUri.Length);

            await WebDataCache.GetAsync(new Uri(baseUri + q), true);
        }
        public IllustrationViewModel(Uri imgSourceUri)
        {
            Content           = null;
            IsLoading         = true;
            NonCachedImageUri = imgSourceUri;
            var cacheingFileTask = WebDataCache.GetAsync(imgSourceUri);

            cacheingFileTask.ContinueWith(localUri =>
            {
                Deployment.Current.Dispatcher.BeginInvoke(() =>
                {
                    if (localUri.Status != TaskStatus.RanToCompletion)
                    {
                        Content = imgSourceUri.AbsolutePath;
                    }
                    else
                    {
                        Content = localUri.Result.Path;
                    }
                    IsLoading = false;
                });
            });
        }
Exemplo n.º 4
0
 public async Task GetAsyncTest()
 {
     await WebDataCache.GetAsync(new Uri("http://www.google.com/favicon.ico"), true);
 }