public MainWindow(IEliteProvider provider, IClockProvider clockProvider) { InitializeComponent(); _eliteProvider = provider ?? throw new ArgumentNullException(nameof(provider)); _clockProvider = clockProvider ?? throw new ArgumentNullException(nameof(clockProvider)); _currentDate = PlayerRankingDto.RankingStart[SelectedGame]; _timer = new Timer(TimerDelay); _timer.Elapsed += _timer_Elapsed; ChangeButtonStyle(false); RankingDatePicker.SelectedDate = _currentDate; }
public LevelHeatMapWindow(IEliteProvider eliteProvider, IClockProvider clockProvider) { InitializeComponent(); _eliteProvider = eliteProvider; _clockProvider = clockProvider; _timer = new Timer(2000); _timer.AutoReset = false; _timer.Elapsed += (a, b) => { Dispatcher.Invoke(() => { GridScreenshot(); MainGrid.Children.OfType <TextBox>().ToList().ForEach(t => t.Text = string.Empty); }); System.Threading.Thread.Sleep(2000); Dispatcher.Invoke(() => { GridScreenshot(); }); }; Task.Run(() => Initialize()); }