private void Timer_Tick(object sender, object e) { Now = Now.AddSeconds(1); if (DateTimeChanged != null) { var arg = new DateTimeChangedEventArgs(); arg.CurrentTime = Now; DateTimeChanged(this, arg); } }
private async void Internet_InternetConnectionChanged(object sender, InternetConnectionChangedEventArgs args) { if (args.IsConnected) { Now = (DateTime) await GetNistTime(); if (DateTimeChanged != null) { var arg = new DateTimeChangedEventArgs(); arg.CurrentTime = Now; DateTimeChanged(this, arg); } } }