public async Task LoadMediaAssets()
        {
            try
            {
                if (source.IsCancellationRequested)
                {
                    source = new CancellationTokenSource();
                    token  = source.Token;
                }
                else
                {
                    token = source.Token;
                }
                MediaAssets.Clear(); //clear list if already exists

                /*/
                 * Create default camera image as the first one
                 * so when click this image we can call camera action later
                 */
                MediaAssest defaultmedia = new MediaAssest();
                defaultmedia.PreviewPath  = "group.png";
                defaultmedia.IsSelectable = false;
                MediaAssets.Add(defaultmedia);
                await _mediaService.RetrieveMediaAssetsAsync(token);
            }
            catch (TaskCanceledException)
            {
                Console.WriteLine("Task was cancelled");
            }
        }
 private void OnMediaAssetLoaded(object sender, MediaEventArgs e)
 {
     try
     {
         MediaAssets.Add(e.Media);
     }
     catch (Exception ex)
     {
         Debug.WriteLine(ex);
     }
 }
Esempio n. 3
0
 private void OnMediaAssetLoaded(object sender, MediaEventArgs e)
 {
     MediaAssets.Add(e.Media);
 }