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 6737345
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T11:14:17+00:00 2026-05-26T11:14:17+00:00

This is a WPF/C# application and I’m having more of a design problem than

  • 0

This is a WPF/C# application and I’m having more of a design problem than a code problem.

I have 5 separate *.xaml files implementing a class derived from window. So, 5 windows. This is a wizard-type of application so each window has back/next buttons that will create a new window, hide itself, and show the new window.

This isn’t purely navigation based (so I’m not using pages) because sometimes I want to skip a window, or go back to the first window, etc.

Every time a new window is opened the parent window sets itself as the owner of the new window and hides itself. When the back button is used the new window shows the owner and closes itself. This works fine for navigation.

I’m having a problem when someone actually closes the window as opposed to using the navigation. If they close the window, Alt-F4, hit the X, etc it should close the whole app.

My ‘go back’ button also closes the window, which triggers Window_Closed, closing the whole app.

I’m trying to think of a way to close the whole app when the user closes the window, but close only the window (not hide it, actually dispose of it) and show the owner when they click back. I can’t seem to do the latter without triggering the former.

Any suggestions? I’m just not thinking about this the right way.

  • 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-26T11:14:17+00:00Added an answer on May 26, 2026 at 11:14 am

    Instead of flipping between Windows, I would recommend flipping between UserControls in panels. You have the full functionality of a Window except you don’t have to worry about its open/closed state. Just have the UserControls toggle visibility based on the Next/Previous commands.

    You might consider looking into doing navigation for your wizard. You can do this in WPF as demonstrated here.

    With navigation, you have a single window that hosts pages. You can then issue a command to navigate to a particular page and it will automatically flip to the page without you having to worry about control visibility.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a problem in a WPF application. I wrote this code: public partial
I'm building a WPF application and this WPF application is having a toolbar-like panel
In my WPF application, I have a treeview. This treeview is bound to a
In my WPF application I have some drawing functionality. I have solved this using
I have a simple WPF application that uses ClickOnce to handle installing. Within this
I have a WPF application written in C#. This application has dialog windows in
I have a Window that serves as a dialog in a WPF application. This
I have this WPF application using NHibernate and lazy data loading. I also use
I have a WPF application and I use external library for generating documents. This
This code is from my C# WPF application: public MainWindow() { InitializeComponent(); status(Getting dl

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.