urho icon indicating copy to clipboard operation
urho copied to clipboard

MDI support for UrhoSharp Application

Open snkar opened this issue 6 years ago • 1 comments

I was trying to work on an MDI WPF application which will host different models in the UrhoSurface attached to each of the loaded windows. It is not working and the behavior displayed is that the last window is the only one which displays the model while the rest of the earlier loaded windows shows an empty grid/becomes non-responsive.

I was looking at the source code and realized that it is by design that only one active UrhoApplication is allowed with only one UrhoSurface. The UrhoSurface.Show() call exits any existing application and creates a new one in the Render Thread. So the behavior is as per design.

My queries were:

  1. Is there any specific reason why the library was designed to only support one active UrhoSurface where models can be swapped but multiple UrhoSurfaces cannot exist simultaneously?

  2. Also, is there any other workaround/trick/way to have one application load multiple windows with different content loaded in different UrhoSurface controls in the loaded windows?

snkar avatar May 10 '18 13:05 snkar

Look at how the WPF sample handles this. Rather simple ... once the pattern in use is understood.

That sample has all the feature samples in a menu and as you click, it paints.

https://github.com/xamarin/urho-samples/blob/b72d055a424d0e6be825c0239683c225d29ee723/FeatureSamples/WPF/MainWindow.xaml.cs#L35

utekai avatar Feb 02 '19 21:02 utekai