Skip to content

Commit

Permalink
Fix for Ioc.ThrowInvalidOperationExceptionForMissingInitialization
Browse files Browse the repository at this point in the history
  • Loading branch information
AntonyCorbett committed Sep 6, 2024
1 parent d721c6c commit b82f4fd
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions OnlyM/Windows/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ public partial class MainWindow : Window
public MainWindow()
{
InitializeComponent();
}

protected override void OnSourceInitialized(System.EventArgs e)
{
AdjustMainWindowPositionAndSize();

var pageService = Ioc.Default.GetService<IPageService>();
if (pageService != null)
Expand All @@ -29,11 +34,6 @@ public MainWindow()
}
}

protected override void OnSourceInitialized(System.EventArgs e)
{
AdjustMainWindowPositionAndSize();
}

private void WindowClosing(object? sender, System.ComponentModel.CancelEventArgs e)
{
var activeMediaService = Ioc.Default.GetService<IActiveMediaItemsService>();
Expand Down

0 comments on commit b82f4fd

Please sign in to comment.