These are chat archives for AvaloniaUI/Avalonia

31st
Dec 2017
Their documentation is omg terrible but it's essentially Avalonia (in haskell... supporting as many platforms as possible inc mobile) with functional reactive programming APIs (only)
Matthijs ter Woord
@mterwoord
Dec 31 2017 08:57
haskell??
haskell version for .net you mean?
i doubt it has to do with avalonia actually
danwalmsley
@danwalmsley
Dec 31 2017 10:22
@mterwoord he means its like Avalonia
Matthijs ter Woord
@mterwoord
Dec 31 2017 10:25
ah oke
misundestood then @ghuntley Sorry! :)
jp2masa
@jp2masa
Dec 31 2017 18:06
hi all, I have a window, which is a dialog, and I'd like to show it right after the main window is shown, but "freezing" the main window, is it possible?
MonkAlex
@MonkAlex
Dec 31 2017 19:36
Modal dialog?
jp2masa
@jp2masa
Dec 31 2017 19:36
yes
MonkAlex
@MonkAlex
Dec 31 2017 19:39
So, ShowDialog must be modal, i think
jp2masa
@jp2masa
Dec 31 2017 19:41
ShowDialog is async and it doesn't seem to be possible to specify the parent window, like system dialogs: https://github.com/AvaloniaUI/Avalonia/blob/master/src/Avalonia.Controls/SystemDialog.cs#L33
MonkAlex
@MonkAlex
Dec 31 2017 19:42
Oh, OpenFileDialog. No idea =_=
jp2masa
@jp2masa
Dec 31 2017 19:43
maybe it's possible to block the thread while awaiting ShowDialog?
MonkAlex
@MonkAlex
Dec 31 2017 19:44
Maybe ShowAsync().Wait() ?
Jeremy Koritzinsky
@jkoritzinsky
Dec 31 2017 19:52
There should be a way to specify an owner window.
Use the Window parameter to make it a modal dialog for your main window
I'd strongly suggest against blocking the thread.
If you're talking about the non-system ones, I'm not sure. I feel like it might always be modal if you call ShowDialog instead of Show.
jp2masa
@jp2masa
Dec 31 2017 20:09
where should I call ShowDialog if I want to show the modal right after the main window is shown? I tried some events and none of them worked
This one should work
We need to rework that API though
It needs to accept the parent window
jp2masa
@jp2masa
Dec 31 2017 20:12
as it's an async API, where should I call it? should I execute it synchronously?
Nikita Tsukanov
@kekekeks
Dec 31 2017 20:13
you need to await the result
Using Wait on any task returned from avalonia is not supported and will break your application
jp2masa
@jp2masa
Dec 31 2017 20:15
how would I get the async context then? using Avalonia.Threading?
Nikita Tsukanov
@kekekeks
Dec 31 2017 20:19
what do you mean by "async context"?
jp2masa
@jp2masa
Dec 31 2017 20:19
to await a task, I need to have an async context
MonkAlex
@MonkAlex
Dec 31 2017 20:20
Nope. U can await in console app
Nikita Tsukanov
@kekekeks
Dec 31 2017 20:22
He probably means SynchronizationContext.Current
Which is set for UI thread during avalonia initialization
jp2masa
@jp2masa
Dec 31 2017 21:51
is there an event which is invoked when the window finishes initialization?