03-25-2016, 04:22 PM
Thank you for your sample code.
It really helped to reproduce the problems.
I have fixed the problems and will send you a link to the pre-release version in a private message.
You can also use the current version and use the following workaround:
before calling FitIntoView you need to "set the MainViewport's ActualWidth and ActualHeight" - this is done with first setting Width and Height and then calling Measure and Arrange:
The problem was that FitIntoView needs aspect ration of the viewport - it used Viewport3D'sActualWidth and ActualHeight. But when Viewport3D is inside DXEngine it is not actually visible - therefore the ActualWidth and ActualHeight are not set when your code is inside Loaded event. Later the DXEngine sets the Width and Height of Viewport3D (actually executed the code above) and therefore the FitIntoView gives you correct results when you call it from double click event.
It really helped to reproduce the problems.
I have fixed the problems and will send you a link to the pre-release version in a private message.
You can also use the current version and use the following workaround:
before calling FitIntoView you need to "set the MainViewport's ActualWidth and ActualHeight" - this is done with first setting Width and Height and then calling Measure and Arrange:
Code:
MainViewport.Width = MainDXViewportView.ActualWidth;
MainViewport.Height = MainDXViewportView.ActualHeight;
MainViewport.Measure(new Size(double.PositiveInfinity, double.PositiveInfinity));
MainViewport.Arrange(new Rect(0, 0, MainViewport.Width, MainViewport.Height));The problem was that FitIntoView needs aspect ration of the viewport - it used Viewport3D'sActualWidth and ActualHeight. But when Viewport3D is inside DXEngine it is not actually visible - therefore the ActualWidth and ActualHeight are not set when your code is inside Loaded event. Later the DXEngine sets the Width and Height of Viewport3D (actually executed the code above) and therefore the FitIntoView gives you correct results when you call it from double click event.
Andrej Benedik

