Click here to Skip to main content
15,895,142 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi Everyone,

I have used main window which is having employee details and also having one child window. In parent window i have one button for employee achievements. when i click the button the achievements descriptions opened in child window. It works fine. But when i minimized the child window i need to access my parent window. Child window is used only for reference.

Can anyone please suggest me the solution.

Regards,
Arunkumar M
Posted
Comments
george4986 24-Sep-14 0:23am    
post ur code here
Arunkumar Murugesan 24-Sep-14 0:33am    
private void GetFullViewDescriptions()
{

if (SelectedRelateddescriptions != null)
Description= SelectedRelatedForum.Description;

RelateddescFullView fullView = new RelateddescFullView ();
fullView.DataContext = this;
fullView.ShowDialog();
}
george4986 24-Sep-14 0:34am    
try

fullView.Show();

instead of

fullView.ShowDialog();
Arunkumar Murugesan 24-Sep-14 1:28am    
Thank you so much george. It works fine. Thanks a lot.
george4986 24-Sep-14 1:31am    
U r always welcome ;-)
plz google and study difference of ShowDialog(); and Show();.
if u have time.good luck coding.

1 solution

You can have App.Current.Windows with you,with the help of this, you can find out your mainWindow(based on name or based on window name)and get it activated or get it shown by below mentioned code in your child window


C#
foreach (Window win in App.Current.Windows)
            {
                //In case of "Mainwindow" here you can set your respective Mainwindow object in wpf
                if (win.GetType() == typeof(MainWindow))
                {
                    win.Activate();
                    break;
                }
            }
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900