Use the Loaded event in view init

This commit is contained in:
tyrrrz
2026-04-03 11:37:44 +03:00
parent ed33d19bc0
commit f1673cde77

View File

@@ -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;
}