.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal

Home >> Forum >> WPF >> Post New QuestionBookmark and Share Subscribe to Forum

Capture event of a POP UP Window

Posted By: kuldeep     Posted Date: October 05, 2010    Points:2   Category :WPF
I have two .xaml pages in my application from the button click of 1st .xaml page i m doin secondpage.showDialog() so the second page comes up as a popup.
There is a button on the second page too.

Now i want that the click event of the button on the second page, to be captured on the first page.

How do i do that

Author: Dhiraj Ranka             
Posted Date: October 20, 2010     Points: 5   

Hi Kuldeep,

Rather than capturing the click event of button on second page on first page, handle the click event on second page it self and you can handle closing event of second page on first page.

Code will look some thing like this

Button click event on First.xaml

Button_Click(object sender, RoutedEventArgs e)
secondpage sp = new secondpage();
sp.Closing += new CancelEventHandler(sp_Closing);

void dlg_Closing(object sender, CancelEventArgs e)
//do your stuff here on closing of second page

Hope this helps.

Hope this helps.

Thanks & Regards,
Dhiraj Ranka
http://www.twitter.com/dhirajranka | http://www.dhirajranka.com

Post Reply

You must Sign In To post reply
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend