Skip to content

Conversation

@Djohnnie
Copy link
Contributor

Pull request type

Please check the type of change your PR introduces:

  • Update
  • Bugfix
  • Feature
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation content changes

What is the current behavior?

The current VS extension uses the deprecated 3.0.1 version of WPF-UI.

Issue Number: N/A

What is the new behavior?

This updated VS extensions uses the new 4.0.0 version of WPF-UI.

Other information

I hope to have fixed the breaking changes between version 3.0.1 and version 4.0.0. I've tested the three project templates and they look to be working as expected.

private async void OnStartup(object sender, StartupEventArgs e)
{
_host.Start();
await _host.StartAsync();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider wrapping this in try/catch due to async void.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(Same for the other two templates.)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any suggestions on what to do if an Exception got caught? I basically copied this approach from the Wpf.Ui.Demo.Mvvm project and I'm not sure what else we can do when application initialization and startup fail.
We could call Environment.Exit(1)?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right, there's not much that can be done.

I believe not catching it will in this case just send the exception to Windows' Event Log, so the user may be confused why the app is just gone. IMHO, you should present the exception in a plain MessageBox, so it's at least clear that a crash occurred. (WinForms has a built in exception dialog, but I believe WPF does not.)

@pomianowski pomianowski self-assigned this Feb 16, 2025
@pomianowski pomianowski merged commit 2636287 into lepoco:main Feb 16, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants