private void OnVisibilityChanged(object sender, VisibilityChangedEventArgs e) { if (e.Visible) { _imageDecoder?.Start(); } else if (!e.Visible) { _imageDecoder?.Stop(); // Prevent unnecessary work } }
private void OnVisibilityChanged(object sender, VisibilityChangedEventArgs e) { if (e.Visible) { _imageDecoder?.Start(); } else if (!e.Visible) { _imageDecoder?.Stop(); // Prevent unnecessary work } }