DotNetExtension / BlazorDesktop

Create desktop apps using Blazor.
MIT License
47 stars 9 forks source link

[Nice to have] Multi Window Support #42

Open russkyc opened 1 month ago

russkyc commented 1 month ago

Is there an existing issue for this?

Is your feature request related to a problem? Please describe the problem.

No

Describe the solution you'd like

Currently the BlazorDesktop platform runs on a single window, understandably so. For some advanced cases, it might be useful to have multi window support. Maybe having an extension to the NavigationManager or having something like an IWindowManager service where it will also handle the main window as well as managing other windows, this might be a great addition in the future.

@inject NavigationManager Navigation
@inject IWindowManager WindowManager

@code
{

    void OnOpenInNewWindow()
    {
        Navigation.NavigateToInNewWindow("/products");
    }

    void OnOpenNewWindow()
    {
        WindowManager.Create("window-identifier");
        var window = WindowManager.GetWindow("window-identifier");
        window.NavigateTo("/products");
    }

}

Additional context

No response

AndrewBabbitt97 commented 1 month ago

This has been something I have wanted to do for a while, and have known there would be some who want or need this. I just haven't had the time / need to work on it yet. I do have a project using this that could see some benefit from this, however its just not needed at this current moment.

Most of the work & patches lately have been focused on bug fixes and gaps from initial releases.

russkyc commented 1 month ago

Happy to say that everything else have been smooth, I'll try to play around and see if I can do a contribution for this if time allows. Thanks for working on this package!