public async void RestartTimer(object tickHandle)
{
if (tickHandle is DispatcherTimer)
{
((DispatcherTimer)tickHandle).Start();
}
else if (tickHandle is Task<DispatcherTimer>)
{
_uiDispatcher.BeginInvoke(async () =>
{
var timer = await (Task<DispatcherTimer>)tickHandle;
timer.Start();
});
}
else if (tickHandle is ThreadPoolTimer)
{
throw new NotImplementedException();
}
}