Skip to content

Commit 6b7c635

Browse files
committed
Switch to the Loaded event for view init
1 parent f677c79 commit 6b7c635

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

YoutubeDownloader/Framework/ViewManager.cs

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,7 @@ public partial class ViewManager
3131
return null;
3232

3333
view.DataContext ??= viewModel;
34-
35-
if (view.IsInitialized)
36-
{
37-
_ = viewModel.InitializeAsync();
38-
}
39-
else
40-
{
41-
view.Initialized += async (_, _) => await viewModel.InitializeAsync();
42-
}
34+
view.Loaded += async (_, _) => await viewModel.InitializeAsync();
4335

4436
return view;
4537
}

0 commit comments

Comments
 (0)