i have a page which displays either text information or its chart representation with radio button switching the view
also, there is a share button to share information. on tap of this button the chart will be shared .
currently i sort it out bit rude ;) switching chart visible, sharing it and switching back
bool bShowChart = ShowChart.IsToggled;
if (!bShowChart)
{
ShowChart.IsToggled = true;
Device.StartTimer(new TimeSpan(0, 0, 0, 0, 10), () =>
{
if (!chartData.IsVisible) return (true);
try
{
DependencyService.Get<iUtility>().ShareChartAsImage(chartData);
}
catch (Exception ex)
{
}
if (!bShowChart) ShowChart.IsToggled = false;
return (false);
});
return;
}