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