-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Start app without windows? #857
Comments
@MonkAlex Try this: static void Main(string[] args)
{
var app = new Application();
AppBuilder.Configure(app)
.UsePlatformDetect()
.SetupWithoutStarting();
var dialog = new SimpleDialog();
dialog.Show();
app.Run(dialog);
} |
@wieslawsoltes its work, but i want dialog with custom buttons, need return it from ShowDialog method. |
Work this realization, but normal this or not, no idea:
MainLoop code hard for me, don't know, can i use it or not. |
I will introduce ShutdowmMode soon. That is next in my list. |
Has this been fixed by #1662? |
ShutdownMode (ExitMode) is fully implemented so it should be fixed. |
I do on start
Then try to create and show window (remove
And app closed. How to do it? |
I need to see more of your starting sequence to be sure what is going on. In general you need the main loop to run anything. So altering that isn't a good idea. You can run the application without an main window. |
https://github.com/MonkAlex/CommonLibraries/tree/exitmode |
Try to call https://github.com/AvaloniaUI/Avalonia/blob/master/src/Avalonia.Controls/Application.cs#L272 before you create any visual. Just create your own token source and pass in a token. You can the request a cancelation on your token source or call Exit on your Application. We should allow passing null to Run(Window mainWindow) instead of this. |
In WPF i can just run app and do nothing. I think, And, i can run MainLoop without ExitMode configuration, what it changed? |
You don't run the Application anywhere. That wouldn't work with WPF either. |
I want create ask dialog and then do any action. Show\ShowDialog methods only asynchronic, no idea, how to do it and dont close app. Where "ShutdownMode" analog with "OnExplicitShutdown" value from WPF?
The text was updated successfully, but these errors were encountered: