public static IMessageBox Owner([NotNull] this IMessageBox definition, [NotNull] IWindowsApplicationHost host) { if (definition == null) { throw new ArgumentNullException(nameof(definition)); } if (host == null) { throw new ArgumentNullException(nameof(host)); } var mainWindow = host.View as Window; if (mainWindow != null) { return(definition.Owner(mainWindow)); } return(definition); }