예제 #1
0
 private async void Temp_IsInViewChanged(bool b, DynamicImage sender)
 {
     if (b)
     {
         await LoadDynamicImage((DynamicImage)sender);
     }
     else
     {
         await UnloadDynamicImage((DynamicImage)sender);
     }
 }
예제 #2
0
        private async Task LoadDynamicImage(DynamicImage DynamicImage)
        {
            if (DynamicImage.IsLoading && DynamicImage.IsUnloading)
            {
                if (DynamicImage.CancelUnload != null)
                {
                    DynamicImage.CancelUnload.Cancel();
                }
            }
            else
            {
                await LoadRestrictor.WaitAsync(); // wait for our turn

                await DynamicImage.Load();

                LoadRestrictor.Release();
            }
        }
예제 #3
0
 private async Task UnloadDynamicImage(DynamicImage DynamicImage)
 {
     DynamicImage.CancelUnload = new CancellationTokenSource();
     await DynamicImage.Unload(DynamicImage.CancelUnload.Token);
 }