public void OnLoaded() { _timer = new DispatcherTimer { Interval = TimeSpan.FromSeconds(0.5), IsEnabled = true }; _timer.Tick += OnTick; }