Solved

Redraw A Window

Posted on 2013-11-11
4
345 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying 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

Suggested Solutions

Title # Comments Views Activity
abstract class C# 1 44
Set custom font WPF 2 25
Run software updates from the website 6 50
Which is best Image Resizing Web service 11 39
Extention Methods in C# 3.0 by Ivo Stoykov C# 3.0 offers extension methods. They allow extending existing classes without changing the class's source code or relying on inheritance. These are static methods invoked as instance method. This…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.

739 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