Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update .net version from v4.8 to .NET 7 and create a new WinUI 3 interface #97

Open
terrymacdonald opened this issue Apr 20, 2022 · 3 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@terrymacdonald
Copy link
Owner

terrymacdonald commented Apr 20, 2022

Is your feature request related to a problem? Please describe.
The existing DisplayMagician UI uses Windows.Forms and uses the .NET Framework 4.8. The UI looks a bit ancient, and has a few bits that annoy me due to the limitations of Windows Forms in .NET Framework 4.8. Additionally, .NET Framework 4.8 is pretty old now, and although it currently doesn't have an end date for support, it makes sense to make use of the new .NET 7.

Describe the solution you'd like
.NET 7 consolidates the .NET Framework and .NET Standard together into a single version of .NET. This consolidation will help ensure that any libraries we use are more likely to be maintained because there is only one version of .NET to support. Additionally it provides a much wider range of more modern API functionality which should mean I have to do much less development support myself.

WinUI 3 is based on Xamarin.Forms, and provides an upgrade path from Windows.Forms. WinUI3 was chosen over MAUI due to the fact that we won't be supporting for display control in other operating systems in the future. It allows us to make use of the modern UI functionality provided by Windows itself, without having to find band-aids to work around problems caused by using old technology such as Windows.Forms. It also still lets us make use of Process Invocation and adds in some cool dependency injection and other cool things.

What the impact is
The amount of work this generates is extremely large. I'll need to:

  • Learn .NET 7 and WinUI 3 - Currently underway
  • Build an initial single instance .NET 7 WinUI for Desktop application - Currently underway
  • Check existing libraries to see if they support .NET 7, and if not find alternatives - Done
  • Develop UI design using existing as a reference - Currently underway
  • Port across existing UI functionality to the new UI following standard .NET WinUI 3 design patterns (major amount of work!)
  • Integrate NVIDIALibrary, AMDLibrary and WindowsLibrary functionality into DisplayMagician
  • Test UI with some test users
  • Update documentation to reflect new designs
  • Build migration functionality into DisplayMagician for transitioning users to new version.
  • Build update functionality into DisplayMagician for upgrading users to new version.
  • Test with some test users
  • Update documentation

It's quite a bit of work, which is why it will have to be a completely new version.

@terrymacdonald terrymacdonald added the enhancement New feature or request label Apr 20, 2022
@terrymacdonald terrymacdonald self-assigned this Apr 20, 2022
@terrymacdonald terrymacdonald added this to the 3.0 milestone Apr 20, 2022
@terrymacdonald
Copy link
Owner Author

This isn't going to be a quick fix. At this stage I am contemplating creating a completely new codebase from scratch, and then migrating the existing code over bit by bit to the new codebase. In this way, I can add functionality in bitesized chunks, which should make it easier to handle.

I am planning to move to .net6 and MAUI at this stage, with a move to .net7 once that is completed. The reason for .net6 target at first is to ensure that I get the widest range of libraries to use, which will hopefully minimise the impacts on the project and hhopefully avoid the need to find replacement libraries.

@terrymacdonald
Copy link
Owner Author

Ok - researching this over the last few days, I now think it's best to move to .Net 7 directly, and then work on getting DisplayMagician having a PackageIdentity so that it can monitor the state of UWP apps. Once that is done then I can start working on a new MAUI interface to make it look much prettier.

@terrymacdonald terrymacdonald changed the title Update .net version from v4.8 to .NET 6 and create a new .NET 6 MAUI interface Update .net version from v4.8 to .NET 7 and create a new WinUI 3 interface Jan 18, 2023
@terrymacdonald
Copy link
Owner Author

And further research means another pivot. Am now starting a completely new WinUI 3 .Net 7.0 application from scratch, and then I plan on slowly adding in functionality to that application until it reaches feature parity. The main reason for this is that the recommended structure of the WinUI 3 application is COMPLETELY different to a Windows.Forms application. The UI lifecycle is a bit different too, meaning that the existing code I have wouldn't really work in WinUI 3 land.

So, rather than port the existing Windows.Forms code to .Net 7.0, I'm going to take the hit and rewrite the application again directly in WinUI3, moving across functionality bit by bit until the new code has feature parity.

A WinUI 3 for Desktop app will allow all the background code like WinLibrary, NVIDIALibrary and AMDLibrary to work in exactly the same way, as well as all the game library interaction logic, as the P/Invoke code can still be used in this style of application. A MAUI UI didn't seem to allow that sort of functionality easily.

Additionally, the WinUI 3 for Desktop App provides newer packaging options, allowing generation of MSIX files that can either be installed standalone or can be uploaded to the Microsoft Store for easy distribution. The use of MSIX provides a 'PackageIdentity' for DisplayMagician, and that allows me to request extra permissions like the ability to access diagnostic info objects. This will allow DisplayMagician to detect when UWP applications are started or stopped (which Windows currently denies with the MSI installation package).

So, all in all DisplayMagician will be a much better place if I head down this path. WinUI functionality is being actively developed, and in the future additional functionality and features will be added to it, which DisplayMagician will be in a great position to take advantage of. The future is bright :D.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant