Solved

Redraw A Window

Posted on 2013-11-11
4
339 Views
Last Modified: 2013-11-12
C#, .Net 4, WPF

I have an application that has 2 windows and an App.XAML file. Window 1 is the main window that shows content from the App.XAML file. Window is a settings window that allows a user to modify settings in the App.XAML file.

When the user hits submit it saves the settings to the file then closes itself (Window 2). I want Window 1 to reload that file and then display it.

How can I do this?
0
Comment
Question by:LouisM1979
  • 2
  • 2
4 Comments
 
LVL 96

Expert Comment

by:Bob Learned
ID: 39641464
Can you show me the logic to show the 2nd window?
0
 

Author Comment

by:LouisM1979
ID: 39641496
@TheLearnedOne,

Sure thing. I am an old VB6 developer so my execution may not be the best c# in the world.

private void lblAdmin_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
      var newWindow = new ConfigurationSettings();
      newWindow.Show();
        }

Open in new window

0
 
LVL 96

Accepted Solution

by:
Bob Learned earned 500 total points
ID: 39641501
I would suggest that you use ShowDialog, so that you know when the window is closed, and then you can add some code after the ShowDialog call to perform the required step.  ShowDialog creates a modal window, instead of the non-modal window that Show creates.
0
 

Author Closing Comment

by:LouisM1979
ID: 39641677
Thank you for the information. Did some googling on ShowDialog and got to where I needed to be!
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article introduced a TextBox that supports transparent background.   Introduction TextBox is the most widely used control component in GUI design. Most GUI controls do not support transparent background and more or less do not have the…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

816 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now