private void UpdateBackend() { if (_backend != null) { _backend.Render -= OnBackendRender; _backend.Resize -= OnBackendResize; _backend.Dispose(); } if (!IsLoaded) { Content = null; return; } _backend = GraphicsBackend.Create(Backend); _backend.Render += OnBackendRender; _backend.Resize += OnBackendResize; Content = _backend.GetControl(); OnContentChanged(EventArgs.Empty); }
public void Dispose() { _backend?.Dispose(); Instances.Remove(this); }