SledgeHammer
SledgeHammer

Reputation: 7690

Can you have a "non-PROCESS-blocking" window in WPF?

I have an app that has a regular main window (Window). It also has various little popup windows that display widgets. They are modeless. When I close my main window, the process is blocked by the little popup windows. Is there some style I need to set on the popup windows to prevent them from blocking the process exit? Right now I just have:

    <Setter Property="AllowsTransparency" Value="True" />
    <Setter Property="SizeToContent" Value="WidthAndHeight" />
    <Setter Property="ShowInTaskbar" Value="False" />
    <Setter Property="ResizeMode" Value="NoResize" />
    <Setter Property="Background" Value="#7FFF0000" />
    <Setter Property="WindowStyle" Value="None" />

Or do I need to trap the main window closing and manually close the popup windows?

Upvotes: 0

Views: 56

Answers (1)

SLaks
SLaks

Reputation: 887453

Set Application.ShutdownMode to ShutdownMode.OnMainWindowClose.

Upvotes: 2

Related Questions