У меня есть ListView со множеством строк. В DataTemplate этого ListView вложен еще один ListView в DataTemplate которого есть изображения которые загружаются из URL. При быстрой прокрутке списка изображения не успевают загружаться и приложение падает с ошибкой System.ObjectDisposedException in Android.FastRenderers.ImageRenderer.
Я нашел такую же ошибку на GitHub, ее не смогли воспроизвести, я прокомментировал пост, может будет решение. https://github.com/xamarin/Xamarin.Forms/issues/2164
Собственно вопрос, пока ошибка существует, какие есть варианты для того чтобы приложение не падало? Может как-то можно ее обработать из моего кода?
Сейчас я убрал изображения из шаблона, все работает, но это плохой выход, они там нужны.
Ниже код DataTemplate
public class DataViewCustomCell : ViewCell
{
private Label _dataNameLabel, _scoreLabel;
private Image _dataIconimage;
public DataViewCustomCell()
{
Grid grid = new Grid
{
RowDefinitions =
{
new RowDefinition {Height = new GridLength(26, GridUnitType.Absolute)},
},
ColumnDefinitions =
{
new ColumnDefinition {Width = new GridLength(20, GridUnitType.Absolute)},
new ColumnDefinition {Width = new GridLength(70, GridUnitType.Absolute)},
new ColumnDefinition {Width = new GridLength(1, GridUnitType.Star)}
}
};
grid.Children.Add(_dataIconimage = new Image()
{
HorizontalOptions = LayoutOptions.Center,
VerticalOptions = LayoutOptions.Center,
Margin = new Thickness(2,0,2,0),
}, 0, 0);
grid.Children.Add(_scoreLabel = new Label { FontSize = 16, Margin = new Thickness(2, 0, 2, 0),
VerticalOptions = LayoutOptions.Center,
HorizontalOptions = LayoutOptions.Start,
LineBreakMode = LineBreakMode.NoWrap,
TextColor = ThemeManager.AlternativeTextColor}, 1, 0);
grid.Children.Add(_dataNameLabel = new Label { FontSize = 16, Margin = new Thickness(2,0,2,0),
VerticalOptions = LayoutOptions.Center,
HorizontalOptions = LayoutOptions.Start,
LineBreakMode = LineBreakMode.NoWrap,
TextColor = ThemeManager.TextColor}, 2, 0);
View = grid;
}
public static readonly BindableProperty DataNameProperty =
BindableProperty.Create("DataName", typeof(string), typeof(DataViewCustomCell));
public static readonly BindableProperty ImagePathProperty =
BindableProperty.Create("ImagePath", typeof(ImageSource), typeof(DataViewCustomCell));
public static readonly BindableProperty ScoreProperty =
BindableProperty.Create("Score", typeof(string), typeof(DataViewCustomCell));
public string DataName
{
get => (string)GetValue(DataNameProperty);
set => SetValue(DataNameProperty, value);
}
public ImageSource ImagePath
{
get => (ImageSource)GetValue(ImagePathProperty);
set => SetValue(ImagePathProperty, value);
}
public string Score
{
get => (string)GetValue(ScoreProperty);
set => SetValue(ScoreProperty, value);
}
protected override void OnBindingContextChanged()
{
base.OnBindingContextChanged();
if (BindingContext != null)
{
_dataNameLabel.Text = DataName;
_scoreLabel.Text = Double.TryParse(Score, out double dob) ? dob.RoundString() : Score;
_dataIconimage.Source = ImagePath;
_dataIconimage.WidthRequest = 16;//ImageWidth;
_dataIconimage.HeightRequest = 16; //ImageHeight;
}
}
Частный дом престарелых в Киеве: комфорт, забота и профессиональный уход
Имеется экземпляр Version, который необходимо приводить к определённому текстовому форматуНапример Version 12
Вопрос теоретический, как отследить нажатие левой кнопки мыши с помощью c#Делаю некую задачу, где по клику мышкой делается скриншет экрана
Выполняя сборку проекта через Tfs builds, проект выдает ошибку: