void OnTick(object sender, EventArgs eventArgs) { // This will only be true if the target window is active // (or very recently has been, depends on your update rate) if (OverlayWindow.IsVisible) { OverlayWindow.Update(); } }
private void OnTick(object sender, EventArgs e) { if (!OverlayWindow.IsVisible) { OverlayWindow.Update(); } OverlayWindow.Update(); InternalRender(); }
private void OnTick(object?_, EventArgs e) { // This will only be true if the target window is active // (or very recently has been, depends on your update rate) if (!OverlayWindow.IsVisible) { return; } OverlayWindow.Update(); InternalRender(); }
void OnTick(object sender, EventArgs eventArgs) { // This will only be true if the target window is active // (or very recently has been, depends on your update rate) if (OverlayWindow.IsVisible) { Application.Current.Dispatcher.Invoke((Action) delegate { if (OverlayWindow != null) { OverlayWindow.Update(); } }); } }