Beispiel #1
0
        async void SetImage(ImageCell cell, CellTableViewCell target)
        {
            var source = cell.ImageSource;

#pragma warning disable CA1416 // TODO: 'UITableViewCell.ImageView' is unsupported on: 'ios' 14.0 and later
            target.ImageView.Image = null;

            var uiimage = await source.GetNativeImageAsync().ConfigureAwait(false);

            if (uiimage != null)
            {
                NSRunLoop.Main.BeginInvokeOnMainThread(() =>
                {
                    if (target.Cell != null)
                    {
                        target.ImageView.Image = uiimage;
                        target.SetNeedsLayout();
                    }
                    else
                    {
                        uiimage?.Dispose();
                    }
                });
            }
#pragma warning restore CA1416
        }
Beispiel #2
0
        async void SetImage(ImageCell cell, CellTableViewCell target)
        {
            var source = cell.ImageSource;

            target.ImageView.Image = null;

            var uiimage = await source.GetNativeImageAsync().ConfigureAwait(false);

            if (uiimage != null)
            {
                NSRunLoop.Main.BeginInvokeOnMainThread(() =>
                {
                    if (target.Cell != null)
                    {
                        target.ImageView.Image = uiimage;
                        target.SetNeedsLayout();
                    }
                    else
                    {
                        uiimage?.Dispose();
                    }
                });
            }
        }