02-09-2026, 08:57 AM
Thank you for preparing a sample app that reproduces the issue. This way I was very quickly able to reproduce the problem and find the fix.
In your app the SharpEngineSceneView control is being disposed because in the _3DControl you have the following line:
this.Unloaded += (sender, args) => MainSceneView.Dispose();
This means that if the _3DControl is hosted in a TabControl and if the tab that shows the _3DControl is changed, then the SharpEngineSceneView is disposed. So the next time the tab is opened, you have a disposed SharpEngineSceneView that cannot be used anymore.
If you just comment out this line, the app will start working.
But a better option is to provide a Dispose method in the _3DControl. There you dipose the MainSceneView. That Dispose method can be called the parent MainWindow is Unloaded - so when you close the window, you can dispose the SharpEngineSceneView because it will not be used anymore.
In your app the SharpEngineSceneView control is being disposed because in the _3DControl you have the following line:
this.Unloaded += (sender, args) => MainSceneView.Dispose();
This means that if the _3DControl is hosted in a TabControl and if the tab that shows the _3DControl is changed, then the SharpEngineSceneView is disposed. So the next time the tab is opened, you have a disposed SharpEngineSceneView that cannot be used anymore.
If you just comment out this line, the app will start working.
But a better option is to provide a Dispose method in the _3DControl. There you dipose the MainSceneView. That Dispose method can be called the parent MainWindow is Unloaded - so when you close the window, you can dispose the SharpEngineSceneView because it will not be used anymore.
Andrej Benedik

