These are chat archives for AvaloniaUI/Avalonia

11th
Aug 2015
José Manuel Nieto
@SuperJMN
Aug 11 2015 08:27
hey @grokys ! I have a question
I have seen that in order to keep a Window running until it's closed, you have to do Application.Run(window)
In WPF, I have seen some differences
Or maybe I am attempting different things!
in WPF, I have a method "Application.OnStartup"
there, if you create a Window and you show it, you don't have to invoke the Application.Run(window)
window.Show() gets the window running with no further action
Steven Kirk
@grokys
Aug 11 2015 08:31
ah really? i thought you had to use Application.Run() anyway
José Manuel Nieto
@SuperJMN
Aug 11 2015 08:31
I don't know!
maybe after the call to OnStartup, Applicion does it automatically
Steven Kirk
@grokys
Aug 11 2015 08:32
perhaps
José Manuel Nieto
@SuperJMN
Aug 11 2015 08:32
this works in WPF
public partial class App
{
    protected override void OnStartup(StartupEventArgs e)
    {
        base.OnStartup(e);

        new MyWindow().Show();
    }     
}    
Steven Kirk
@grokys
Aug 11 2015 08:33
ok
José Manuel Nieto
@SuperJMN
Aug 11 2015 08:33
I think there's some plumbing there
in fact, Application has a ShutdownMode
Steven Kirk
@grokys
Aug 11 2015 08:34
yes, i know
José Manuel Nieto
@SuperJMN
Aug 11 2015 08:34
It seems that under the hood, it's managing the Windows that are shown/closed
it would be nice if Perspex has something like that
it's interesting: OnExplicityShutdown, OnMainWindowClose, OnLastWindowClose
so it seems, too, that the very first Window to be show is running Application.Run() automatically
Steven Kirk
@grokys
Aug 11 2015 08:38
the shutdown mode, yes
i'm not sure about running Application.Run automatically
José Manuel Nieto
@SuperJMN
Aug 11 2015 10:26
maybe after some "OnStartup" callback?
like WPF?
Steven Kirk
@grokys
Aug 11 2015 12:59
sure - add an issue with a use-case and i will add it at some point
just getting ready to go on holiday so it won't be for a week
José Manuel Nieto
@SuperJMN
Aug 11 2015 15:42
OK!
thanks, dude!
where are you going?
Steven Kirk
@grokys
Aug 11 2015 16:15
calabria
José Manuel Nieto
@SuperJMN
Aug 11 2015 16:56
Wow! should be a great place to go!
I hope you really enjoy your trip
suddenly I'm hungry :P
Steven Kirk
@grokys
Aug 11 2015 16:58
thanks! speak when i get back
José Manuel Nieto
@SuperJMN
Aug 11 2015 17:13
good bye, man!