AutomaticUpdater's owner Window problem

The login page in our application is a WPF page, not a window. Unfortunately the updater control throws an exception when the page is loaded. Is there a workaround for this little problem?

We thought we could change the login page to be a window, but it breaks up the user interface.

"Application Unhandled Error, Initialization of 'wyDay.Controls.AutomaticUpdater' threw an exception., System.Exception: Could not find the AutomaticUpdater's owner Window. Make sure you're adding the AutomaticUpdater to a Window and not a View, User control, etc.

at wyDay.Controls.AutomaticUpdater.System.ComponentModel.ISupportInitialize.EndInit()

at MS.Internal.Xaml.Runtime.ClrObjectRuntime.InitializationGuard(XamlType xamlType, Object obj, Boolean begin)"

The AutomaticUpdater must be added to a Window. That's by-design. Don't you have access to the underlying Window that the page is on?

For WPF I have the following workaround.Download the source files for AutomaticUpdater control.In AutomaticUpdater.cs change line 1388 from:

ownerForm = Window.GetWindow(this);

to:

ownerForm = Application.Current.MainWindow;

Works for me. Your milage may vary. 🙂