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?