Skip to content
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

Is it possible to use Material.Avalonia.Dialogs on platforms that use Single View Application Lifetime (eg. mobile) ? #396

Open
buzzware opened this issue Aug 9, 2024 · 3 comments
Assignees
Labels
enhancement New feature or request up for grabs You can submit PR with implementation

Comments

@buzzware
Copy link

buzzware commented Aug 9, 2024

DialogDemoViewModel.cs calls dialog.ShowDialog which requires a Window, but it seems impossible to get a Window unless Application.Current?.ApplicationLifetime is IClassicDesktopStyleApplicationLifetime so I don't see how to use dialogs on mobile.

Material.Avalonia is actually currently the best path to building mobile apps with Avalonia at present, so this issue is particularly frustrating.

@SKProCH
Copy link
Collaborator

SKProCH commented Aug 9, 2024

Hello, probably there is an option with DialogHost, but I don't know how dialogs are implemented, so I've also try to take a look at the weekend. If you can manage it by yourself - let me know.

@SKProCH
Copy link
Collaborator

SKProCH commented Aug 21, 2024

I've look at code, and seems like - currently no way to reuse it for non-windowed dialogs (without faking the window in some way).

Seems like material dialogs should be rewritten to support it, and currently i've doesn't have a time for it. Also, the author of dialogs - @appleneko2001 currently unavailable up to next year. I don't think what i can find time to rewire dialogs by myself before next year (since i still need to find time to develop other features of Material). So, probably you shouldn't expect to me or @appleneko2001 will do something with dialogs before next year, sorry.

It you want you can try to do something by yourself - i'll review that.

@SKProCH SKProCH added enhancement New feature or request up for grabs You can submit PR with implementation labels Aug 21, 2024
@appleneko2001
Copy link
Collaborator

DialogDemoViewModel.cs calls dialog.ShowDialog which requires a Window, but it seems impossible to get a Window unless Application.Current?.ApplicationLifetime is IClassicDesktopStyleApplicationLifetime so I don't see how to use dialogs on mobile.

Material.Avalonia is actually currently the best path to building mobile apps with Avalonia at present, so this issue is particularly frustrating.

Actually hit to the point, the old dialog system I made is a prototype, and the APIs are also not a good practice to use in production builds. I can't do anything before this year ends (I can't tell where I am sorry it's quite sensitive)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request up for grabs You can submit PR with implementation
Projects
None yet
Development

No branches or pull requests

3 participants