child window question.

May 12, 2011 at 11:04 PM

Hi,
     I have one question for child window: Is that possible we can open up unlimited same type child window?
     Example:
         I have a DataGird, when I click on any row, it will pop up new transaction view window (new instance). But I still need keep old transaction view window opened so they can compare the detail.

Thanks.

--Shuyang He

May 13, 2011 at 1:36 AM

It was not designed for this scenario but you may be able to do this.  You would have to create the ChildWindow in code and manage the different instances.

May 13, 2011 at 11:23 AM

ok. tried with this code, but the child window was not show up.

  ctlUserInfo = new UserControl1();
  ctlUserInfo.IsModal = false;
  ctlUserInfo.Show();

Any sugesstion?

 

Thanks.

--Shuyang he

 

May 13, 2011 at 1:16 PM

The ChildWindow must belong to the visual tree, so you must add it to your view: MainGrid.Children.Add(ctlUserInfo).  Where MainGrid is the x:Name of the root grid in your view.

May 13, 2011 at 3:02 PM

Thx. It works.