Solved

Redraw A Window

Posted on 2013-11-11
4
334 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
Comment Utility
Can you show me the logic to show the 2nd window?
0
 

Author Comment

by:LouisM1979
Comment Utility
@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
Comment Utility
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
Comment Utility
Thank you for the information. Did some googling on ShowDialog and got to where I needed to be!
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Article by: Ivo
Anonymous Types in C# by Ivo Stoykov Anonymous Types are useful when  we do not need to follow usual work-flow -- creating object of some type, assign some read-only values and then doing something with them. Instead we can encapsulate this read…
In order to hide the "ugly" records selectors (triangles) in the rowheaders, here are some suggestions. Microsoft doesn't have a direct method/property to do it. You can only hide the rowheader column. First solution, the easy way The first sol…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

771 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

11 Experts available now in Live!

Get 1:1 Help Now