- Home
- Forum
- Xamarin.Forms
- SfCircularProgressBarRenderer - System.ObjectDisposedException: Cannot access a disposed object.
SfCircularProgressBarRenderer - System.ObjectDisposedException: Cannot access a disposed object.
Hi,
I am getting the following error with the ProgressBar control:
System.ObjectDisposedException: Cannot access a disposed object.
Object name: 'Syncfusion.XForms.Android.ProgressBar.SfCircularProgressBarRenderer'.
I have a standard MasterDetail page arrangement:
On the main Page I have a SfListView Control within a PullToRefresh control.
The ProgressBar control is used in the HeaderTemplate of the SfListView control See below:
ProgressStrokeColor="Transparent" ProgressStrokeWidth="0"
TransitionMode="Push" IsRefreshing="False" VerticalOptions="FillAndExpand" PullingThershold="100" Refreshing="pullToRefresh_Refreshing" >
HeaderSize="256" ItemTemplate="{StaticResource JobListItem}" SelectionMode="None" ItemTapped="JobListView_ItemTapped">
<Button Text="" TextColor="{StaticResource accentColour}" Margin="0,0,12,0" BackgroundColor="Transparent" WidthRequest="40" HeightRequest="40" BorderWidth="1"
VerticalOptions="EndAndExpand" HorizontalOptions="EndAndExpand" Command="{Binding SyncJobsCommand}" IsVisible="{Binding AllowJobSync}"/>
Margin="0,0,22,12" WidthRequest="25" HeightRequest="25" ShowProgressValue="False" ProgressColor="{StaticResource accentColour}" TrackColor="Transparent"
VerticalOptions="EndAndExpand" HorizontalOptions="EndAndExpand"/>
...
The sync button control triggers the task that makes the ProgressBar visible while hiding the button. This all works fine until I switch to another page on the menu and come back to this page. If I then tap the sync button I get the reported error. I have tried to reproduce this error in another application without success. I am using 16.2.0.41 of SyncFusion.
Any ideas on what could be causing this issue?
SIGN IN To post a reply.
4 Replies
AE
Andrew Elliott
July 5, 2018 12:53 PM UTC
AE
Andrew Elliott
July 5, 2018 01:06 PM UTC
If I comment out the IsVisible property from the ProgressBar and make it always visible the problem doesn't seem to happen anymore. Obviously that doesn't solve my problem but it may highlight where the issue is happening.
Andrew
AE
Andrew Elliott
July 6, 2018 08:59 AM UTC
Sorry, It seems the code from the above post got truncated.
Attachment: CodeSnippet_33839396.zip
<Grid BackgroundColor="White" Padding="0">
<Grid.RowDefinitions>
<RowDefinition Height="74"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<pullToRefresh:SfPullToRefresh x:Name="pullToRefresh" BackgroundColor="Transparent" Grid.RowSpan="2" ProgressBackgroundColor="Transparent"
ProgressStrokeColor="Transparent" ProgressStrokeWidth="0"
TransitionMode="Push" IsRefreshing="False" VerticalOptions="FillAndExpand" PullingThershold="100" Refreshing="pullToRefresh_Refreshing" >
<pullToRefresh:SfPullToRefresh.PullableContent>
<syncfusion:SfListView x:Name="JobListView" ItemsSource="{Binding Jobs}" AutoFitMode="Height" HorizontalOptions="CenterAndExpand"
HeaderSize="256" ItemTemplate="{StaticResource JobListItem}" SelectionMode="None" ItemTapped="JobListView_ItemTapped">
<syncfusion:SfListView.HeaderTemplate>
<DataTemplate x:Name="JobListHeaderTemplate">
<Grid x:Name="JobHeaderGrid" BackgroundColor="Transparent" HeightRequest="256">
<Button Text="" TextColor="{StaticResource accentColour}" Margin="0,0,12,0" BackgroundColor="Transparent" WidthRequest="40" HeightRequest="40" BorderWidth="1"
VerticalOptions="EndAndExpand" HorizontalOptions="EndAndExpand" Command="{Binding SyncJobsCommand}" IsVisible="{Binding AllowJobSync}"/>
<progressBar:SfCircularProgressBar x:Name="pbBusySyncingJobs" IsIndeterminate="True"
Margin="0,0,82,8" WidthRequest="20" HeightRequest="20" ShowProgressValue="False" ProgressColor="{StaticResource accentColour}" TrackColor="Transparent"
VerticalOptions="EndAndExpand" HorizontalOptions="EndAndExpand"/>
<Label TextColor="{StaticResource accentColour}" Text="Syncing Jobs..." IsVisible="{Binding SyncingJobs}" VerticalOptions="EndAndExpand" HorizontalOptions="StartAndExpand"
Margin="12,0,0,12"/>
</Grid>
</DataTemplate>
</syncfusion:SfListView.HeaderTemplate>
...
I have attached this snippet as well.
Attachment: CodeSnippet_33839396.zip
MP
Michael Prabhu M
Syncfusion Team
July 6, 2018 01:38 PM UTC
Hi Andrew,
Thanks for the code snippet, we have tried to replicate the issue on our side by using your code snippet, but we were not able to reproduce the issue at our end, the sample we tried to replicate is in the below link.
In this sample we have created master detail arrangement, in first item page we have used your code snippet, while navigating to other pages we were not able to reproduce this issue, we tested this in Android 7.0
If this is not your scenario can you revert us by modifying the sample, this will help us to provide you a better solution at the earliest.
Thanks,
Michael
SIGN IN To post a reply.
- 4 Replies
- 2 Participants
-
AE Andrew Elliott
- Jul 5, 2018 12:04 PM UTC
- Jul 6, 2018 01:38 PM UTC