-
Notifications
You must be signed in to change notification settings - Fork 462
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
Add a Single-Instance option for WinUI 3 #4662
Comments
Single-instance samples are shown at https://learn.microsoft.com/en-us/windows/apps/windows-app-sdk/applifecycle/applifecycle-instancing#how-the-windows-app-sdk-instancing-differs-from-uwp-instancing. Have you been able to get that working? |
I get it working (kind of). But it would be quite a boost if TemplateStudio comes with an option to setup a Single-Instance app. |
Can you share your code? There's quite a few ways to handle things so there'd need to be a canonical way to handle it that most people would want to put it in the templates. The samples seem pretty simple for the basic case of redirecting all instances to another single instance. |
I have been able to get it working with a Blank WinUI Project app, But when I try to make the App single instanced with the project which is created using Templated studio is failing to raise OnActivated() event. It goes well till keyinstace.RedirectActivationToAsync(args).AsTask().Wait(); After this line of code, execution won't continue and throws an Aggregate exception. OnActivated() event won't be triggerred forever. |
https://blogs.windows.com/windowsdeveloper/2022/01/28/making-the-app-single-instanced-part-3/ |
Is your feature request related to a problem? Please describe.
WinUI apps are multi-instance by default, and it isn't straightforward to make an app single-instance.
Describe the solution you'd like
If the TemplateStudio had a Single-Instance option for WinUI that would save us all some time and effort.
Describe alternatives you've considered
No response
Additional context
No response
Applies to the following platforms:
The text was updated successfully, but these errors were encountered: