Is it possible to use Material.Avalonia.Dialogs on platforms that use Single View Application Lifetime (eg. mobile) ?
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.
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.
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.
DialogDemoViewModel.cs calls dialog.ShowDialog which requires a Window, but it seems impossible to get a Window unless
Application.Current?.ApplicationLifetime is IClassicDesktopStyleApplicationLifetimeso 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)
Recently I'm trying some workaround for solving show dialog results, and I researched that using await foreach a IAsyncEnumerable or foreach with IEnumerable to get one or more results until they returns yield break or reach to the end of the enumerable function (just like how the dialog demo works like) and they are actually pretty well to implement them than weird "event" workaround.
Also I'm thinking to make some DialogElement in DialogViewModel to make them more flexible to build dialog without making a lot variant of Dialog like CustomDialog, DatePickerDialog, TextFieldDialog, and TimePickerDialog, only one DialogWindow will be one for all. This would be how the new Dialog system looks like I guess. Any more ideas?
I'm working on DialogBuilder API, I have some scratch works already but still not ready, later gonna re-submit PR since first attempt quite broken thanks to git state But it will allows you to use builded control at anywhere, not only standalone window