Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6052639
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T07:57:01+00:00 2026-05-23T07:57:01+00:00

I am using Window.ShowDialog() to open a modal window in my WPF (MVVM) application,

  • 0

I am using Window.ShowDialog() to open a modal window in my WPF (MVVM) application, but it lets me navigate to other windows using the Windows taskbar (Windows 7).

Consider this:
I have 3 non-modal windows open in my application. Now One of these opens a modal window using Window.ShowDialog(). I also set Application.MainWindow as the owner of the modal window. This is so because I am using MVVM messaging and the message handler to open a new window is centralized in App.xaml.cs. The window does opens modally – no issues there. However, Windows 7 allows me to swtich to the other application windows from the taskbar. This leads to a situation where the modal window goes behind another window, which I prefer not to have.

I can’t do anything on other windows as long as I have the modal open, but it would be nice if the modal window always remained on top as long as it’s open. Is there a way I can disable taskbar switching when the modal is open? FYI – all open windows launched from the app appear as separate entries on the taskbar.

Thanks in advance!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T07:57:02+00:00Added an answer on May 23, 2026 at 7:57 am

    There isn’t any code to base this off of, but it sounds like you have left off some properties on the Window you’ve created and expected ShowDialog to apply additional “dialog” semantics:

    Window window = new Window()
    {
        Title = "Modal Dialog",
        ShowInTaskbar = false,               // don't show the dialog on the taskbar
        Topmost = true,                      // ensure we're Always On Top
        ResizeMode = ResizeMode.NoResize,    // remove excess caption bar buttons
        Owner = Application.Current.MainWindow,
    };
    
    window.ShowDialog();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm writting an WPF application using the mvvm toolkint. In the main windows I
I have a window that I sometimes open using Show() and sometimes using ShowDialog()
I'm trying to open a modal dialog as soon as a WPF application has
A WPF window dialog is shown using the ShowDialog method in the Window class
I have a WPF application that has several modal window used for various purposes.
I have a WPF application which calls OpenFileDialog.ShowDialog. While this dialog is open it
In WPF we have Window.ShowDialog() which allows showing a modal dialog box. In WinForms
I try to rewrite my Application using the MVVM pattern. I have a window
I'm just creating my own AboutBox and I'm calling it using Window.ShowDialog() How do
I've been using ShowDialog() in following way for all my new Windows. SomeGui test

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.