mirror of
https://github.com/Tyrrrz/DiscordChatExporter.git
synced 2026-04-10 21:32:05 +00:00
Use the Loaded event in view init
This commit is contained in:
@@ -29,15 +29,7 @@ public partial class ViewManager
|
||||
return null;
|
||||
|
||||
view.DataContext ??= viewModel;
|
||||
|
||||
if (view.IsInitialized)
|
||||
{
|
||||
_ = viewModel.InitializeAsync();
|
||||
}
|
||||
else
|
||||
{
|
||||
view.Initialized += async (_, _) => await viewModel.InitializeAsync();
|
||||
}
|
||||
view.Loaded += async (_, _) => await viewModel.InitializeAsync();
|
||||
|
||||
return view;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user