diff --git a/Wino.Mail.WinUI/BasePage.cs b/Wino.Mail.WinUI/BasePage.cs index d2a7bfe7..02229c36 100644 --- a/Wino.Mail.WinUI/BasePage.cs +++ b/Wino.Mail.WinUI/BasePage.cs @@ -41,7 +41,7 @@ public partial class BasePage : Page, IRecipient public abstract class BasePage : BasePage where T : CoreBaseViewModel { - public T ViewModel { get; } = WinoApplication.Current.Services.GetService(); + public T ViewModel { get; } = WinoApplication.Current.Services.GetService() ?? throw new ArgumentException($"Can't resolve '{typeof(T)}' as view model."); protected BasePage() {