Solved

Redraw A Window

Posted on 2013-11-11
4
342 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

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…
We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

820 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