PandaWood / ExceptionReporter.NET

ExceptionReporter is a .NET component that gathers detailed information on an Exception and the application/system running it. It allows the user to copy, save or send a custom-formatted report to the developer
MIT License
51 stars 32 forks source link

WPF Version #13

Closed llewelynrex closed 3 years ago

llewelynrex commented 6 years ago

Have you ever considered a WPF version? I've just forked the solution to check out a few things. I've had some issues with the scaling and positioning of the icons and text on the buttons on my laptop at work and I suspect it might be due to windows forms. Perhaps I could hack and slash on my side and see what I come up with. Would you want to incorporate something like that into your solution?

PandaWood commented 6 years ago

Hey @llewelynrex I had started a WPF version and tried to commonize the code but never had enough time or reason to finish it, so I took the code out, because the way I had done it was effecting the non-WPF version.

But yes, I would love to have a WPF version integrated into ExceptionReport.

PandaWood commented 6 years ago

BTW The code is designed with something like the MVP (Model/View/Presenter) pattern - so hopefully you can fairly easily separate the Xaml/View from the code needed to gather data etc

I remember deciding that a new assembly for WPF would be the way to go, given the different but similar libraries used (eg I remember something like WinForm.Clipboard and WpfClipboard)

llewelynrex commented 6 years ago

Thanks. Will look into it. Unfortunately might take a while for me too. Also a little busy at the moment.

Sent from BlueMailhttp://www.bluemail.me/r?b=13187 On 10 Jul 2018, at 11:28, Peter van der Woude notifications@github.com<mailto:notifications@github.com> wrote:

BTW The code is designed with something like the MVP (Model/View/Presenter) pattern - so hopefully you can fairly easily separate the Xaml/View from the code needed to gather data etc

I remember deciding that a new assembly for WPF would be the way to go, given the different but similar libraries used (eg I remember something like WinForm.Clipboard and WpfClipboard)

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FPandaWood%2FExceptionReporter.NET%2Fissues%2F13%23issuecomment-403760121&data=02%7C01%7C%7Cdd5766d9ae1148bf3fd508d5e6478560%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636668117204456906&sdata=b4%2Bmw%2Boj1yJaSO0hud%2BdilxUXVqJlx4GS64Wep1orJo%3D&reserved=0, or mute the threadhttps://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAJRSlzBP2RHVnHk91WgrwgXQ23Uvjrxoks5uFHPGgaJpZM4VC9EE&data=02%7C01%7C%7Cdd5766d9ae1148bf3fd508d5e6478560%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636668117204456906&sdata=gTcfLcviXlVEdxNNU4HiHWRolyyGRYvscxaeCTHa2Yw%3D&reserved=0.

cmkaus commented 5 years ago

I can start working on this if it still needed.

PandaWood commented 5 years ago

Thanks @cmkaus - I think the best thing about going XAML would be the improved support for high DPI graphics settings - which cause a lot of trouble in WinForms and seem to be much easier to solve by just using WPF

PandaWood commented 3 years ago

I've started this - see branch wpf

PandaWood commented 3 years ago

I've pushed the WPF version of ExceptionReporter into the master branch - see screenshot below.

It uses the same code base and incorporates the newish "Shared Project" (circa 2015?) in Visual Studio.

I've added a WPF demo project so you can see how it's used. I made it a UserControl- which seemed to be the best/easiest way to do it in WPF - happy for any WPF wisdom.

WPF version is not as featured, in terms of UI customisation, but I don't think it needs to be - I've kept it simpler. The demo shows creating your own Window in WPF and setting the Content property to the ExceptionReporter UserControl.

From there you have the same copy/emailbuttons and the show detail, just toggles between showing the main exception message and the full report in a textbox.

I need to add a "Save to file" button and incorporate resource/translations and a different/WPF method of taking screenshots but apart from that, I think it's ExceptionReporter KISS style.

I'll also need to incoporate a separate NuGet package for it.

The separation of code that enabled this work was pretty good already - but there was some work in there. Some logic that should have been common, I had to pull out of the WinForms presenter and the libraries to do screenshots are not compatible so I just left screenshots out of the WPF version for now. It wouldn't be that hard to incorporate screenshots but in my real life use of ExceptionReporter, I never use that feature so I wasn't that motiviated to do it yet.

I made 2 small breaking changes, to WinForms version, that is unlikely to affect anyone (to keep it common)

image