[DevExpress Support Team: CLONED FROM T344944: How to automatically resize the diagram page to fit all generated shapes]
I managed to implement the solution but found a strange behaviour. When I run an application and open the diagram on a normal windows environment with scaling disabled everything works great. When I run the application and open the diagram on a windows machine where scaling is enabled the entire application window resizes to what it would be like with scaling disabled.
I attached an immage to try and show the problem better.
Regards,
Pablo.
I've reproduced the issue and passed this ticket to our developers, so that they can research why DiagramControl disables DPI scaling. We will keep you posted.
Thanks,
Alex
Thank you Alexander
We ran into the same problem. Do you have any update on this issue? Will there be a fix available in the near future?
Regards,
Ralf
Hi Ralf,
I will check with our development team on the status of this issue and get back to you.
Thanks,
Alex
Hi Juan and Ralf,
We found that the issue occurs since the PresentationCore library used by DiagramControl affects the application DPI awareness in certain cases. As a temporary solution, make sure that the PresentationCore library is loaded before the main form is shown. You can do this by referencing any of the types declared in the PresentationCore library:
static void Main() { var type = typeof(System.Windows.Input.Cursor); ...
Thanks,
Alex
Thanks Alexander,
That actually solved the issue on my end, I hope that a permanent fix will come in the future releases of DevExpress.
Regards,
Pablo.
I'm happy to hear that pre-loading the PresentationCore library resolves the issue on your side. Since the effect that the PresentationCore library has on DPI scaling is the default WPF behavior, a permanent fix requires removing dependencies to the PresentationCore library in the diagram code. Our developers are going to do further research to see if such dependencies can be removed without affecting DiagramControl's functionality.
Thanks,
Alex