JitMagic icon indicating copy to clipboard operation
JitMagic copied to clipboard

Migrated to WPF, refactored monolith class to several, light MVVM lib

Open mitchcapper opened this issue 1 year ago • 1 comments

In a very fantastic screw up I put this commit in the other branch right before merging it. There is this commit and undo in the history now but I didn't want a force push done (impressive start as a second merge I know).

I spent some time trying to fix WinForms scaling issues that still remained. Between login session DPI, and current monitor DPI I couldn't get WinForms to behave correctly (even forcing into the newer DPI settings). Likely just due to the limited amount I use modern WinForms, but none of the hacks online seemed to work without me manually trying to handle some of the scaling.

This mostly came as I tried to moving to use some of the winforms autosizing options as well.

Given the simplicity of the UI I figured to see about a quick WPF rewrite of it. This would make adding additional/dynamic buttons (and potentially additional windows like config/ managing other debuggers) easier. It also fixes scale mostly for free due to the seemingly better scaling habits of WPF.

In the progress I refactored into individual classes rather than just the main window class.

if WPF is not the direction desired I can strip it and the MVVM added and am happy to just put together the refactoring.

I tried to keep the entire look and functionality exactly the same. There are two minor additional features: *) Ability to set the JIT window size from the UI (so resize it and then hit the button to set as the default size) *) Remove debuggers that are not desired

mitchcapper avatar Aug 28 '24 07:08 mitchcapper

For me personally I do not know WPF and I think it's an overengineered mess that makes it difficult to understand what's going on. But you're free to do as you see fit, I didn't touch the project for years 🤷🏻‍♂️

mrexodia avatar Aug 28 '24 09:08 mrexodia

OK I redid this PR into two commits. The first commit includes the refactoring of all the code, along with a new simplified winforms code behind seen at: https://github.com/mrexodia/JitMagic/blob/aa9f828980c9f6b5911355e51cf027b6c813d089/JitMagic/JitMagic/Views/JitMagic.cs (but uses the exact same winform designer). I did some modest testing and all functionality seems to work in this winforms version.

The second commit is the actual migration to WPF. I deleted the WinForm views but will leave the #defines for non WPF support.

It should make it possible to migrate back to WinForms much easier if ever desired.

mitchcapper avatar Nov 26 '24 23:11 mitchcapper

Assuming this is good I will also commit a CI script up after to automatically do builds and will use it to generate a release: https://github.com/mitchcapper/JitMagic/actions/runs/12041280101

mitchcapper avatar Nov 27 '24 00:11 mitchcapper

Yeah sounds good to me! Feel free to merge it whenever you feel it's ready!

mrexodia avatar Dec 02 '24 12:12 mrexodia

Perfect done and done.

mitchcapper avatar Dec 02 '24 18:12 mitchcapper

Just wanted to say thanks for your interest and contributions on the project. Finally had some time to try it yesterday and everything seems much nicer!

mrexodia avatar Jan 13 '25 20:01 mrexodia