private async void _timer_Tick(object sender, EventArgs e) { try { VoteCount.Text = $"{await LiveViewService.VoteCountAsync(_position)}"; } catch (SqlException exception) { _logger.Log(exception); } catch (Exception exception) { _logger.Log(exception); } //finally //{ // VoteCount.Text = $"{await LiveViewService.VoteCountAsync(_position)}"; //} }
private async void MainWindow_Loaded(object sender, System.Windows.RoutedEventArgs e) { try { _positions = await LiveViewService.Positions(); } catch (SqlException exception) { SystemEventLoggerService.Log(exception.StackTrace); } catch (Exception exception) { _logger.Log(exception); } finally { foreach (var position in _positions) { CastedVotesHolder.Children.Add(new TileControlLarge(position.PositionName?.Trim())); SkippedVotesHolder.Children.Add(new TileControlSmall(position.PositionName?.Trim())); } } }