TackBall Duration

I find a code online to add duration in trackball through code it occurs to me that it didn't work on UWP as for android it works sometime but mostly app crashed. 

System.ObjectDisposedException: Cannot access a disposed object.
Object name: 'Android.Widget.LinearLayout'.


public class ChartTrackballExt : ChartTrackballBehavior
    {
        public double TrackballDuration { get; set; }

        public double ToolTipDuration { get; set; }

        ChartSeries series;

        public ChartTrackballExt()
        {
            //series = _series;
        }

        protected override void OnTouchUp(float x, float y)
        {
            
                Device.StartTimer(TimeSpan.FromSeconds(TrackballDuration), () =>
                {
                    Hide();
                    return false;
                });
           
        }

        protected override void OnTouchDown(float x, float y)
        {

                Show(x, y);
        }
    }

----------------------------------------

if i remove device.startTimer & add 

 protected async override void OnTouchUp(float x, float y)
        {

            await Task.Delay(10000);
            this.Hide();

        }



it still didn't work on UWP but on android Delay works but template of trackBall goes empty. It didn't show any content.

Still didn't check on iOS

Any Solution?

1 Reply

DV Divya Venkatesan Syncfusion Team June 4, 2018 04:32 PM UTC

Hi Umair, 
 
Sorry for the inconvenience caused. 
 
We are able to reproduce the issue at our end. For UWP, we have achieved your requirement to add duration for Trackball in UWP by overriding OnPointerExited method of TrackballBehaviorHelper. Please refer CustomRenderer.cs file in UWP project in the following sample. 
 
 
Note: For Android, the fix for the issue will be available in our 2018 Volume 2 release which is expected to be rolled out in the first week of June 2018. 
 
Regards,  
Divya Venkatesan 
 


Loader.
Up arrow icon