protected override void OnClosing(System.ComponentModel.CancelEventArgs e) { if (_player != null) { videoGrid.Children.Remove(_player); _player.Dispose(); } base.OnClosing(e); }