relationship between HelixViewPort3D and ViewPort3D

Anonymous 9 years ago 0
This discussion was imported from CodePlex

Mrme wrote at 2013-08-05 11:09:

Hi, I hope someone would reply me this time, I don't understand the relationship between these two controls, there is a read only Viewport3D property for the HelixViewPort3D (thus we can't assign it a value), we can't have Viewport3D as a children/content for HelixViewPort3D. then when I export a HelixViewPort3D content to XAML file , I get instead a normal Viewport3D control. of course now the problem I want to load this back, since the Viewport3D property of HelixViewPort3D is read only I can't apply back this Viewport3D to the main HelixViewport3D , is there is any thing that I don't know or this is a bug needs to be corrected ? like not making the Viewport3D property of the HelixViewPort3D as read only ? any "comment" would be appreciated

Mrme wrote at 2013-08-06 10:17:

I found out there is no reason , at least at this stage , for the Viewport3D property on the HelixViewPort3D to be read only, I changed that and I made a new constructor for the HelixViewPort3D that takes a Viewport3D as an argument, so I extract my Viewport3D from the exported ResourceDictionary , I make a new HelixViewPort3D and I pass my Viewport3D to the constructor, that successfully load back my scene, I would like to submit these changes as well if there was really no reason to make the Viewport3D property read only in the first place.

objo wrote at 2013-08-08 08:26:

Yes, it should be possible to replace the Viewport3D control after the HelixViewport3D has been created, but I think you have to be careful with the Children collection and the cameras.
But do you need to replace the Viewport3D? Isn't it easier to replace the content of the viewport and update the properties of the camera?

Mrme wrote at 2013-08-08 10:41:

Viewport.Children is also read only, replacing the Viewport3D loaded the scene , but the CoordinateSystem control and the direction cube are not associated with this Viewport3D anymore, an overloaded constructor did the trick, you are right that the cameras are not preserved but that is not an issue, I don't see why I should worry about the Children collection ? I will keep experimenting and I will update the thread.