views:

29

answers:

1

I'm new to WPF but I need to implement following functionality:

I have a window that contains one Grid (might be changed to stack panel or something else). In that Grid I have 2 columns, each of them contains another Grid. Lets call them gridFirst and gridSecond. There is also GridSplitter in first column allowing to resize the columns.

I want to provide a button that will allow to separate gridFirst from this window and display it "as it is" in another window. How do I do that?

It would be nice if the new window had a same menu as the original window without me having to copy-paste (that not a good coding practise) all its code to the new window.

Thanks for answers

+2  A: 

It sounds to me like you'd want to create a UserControl and put gridFirst in it. That way you can add your user control to your main grid and your window.

If the DataContext of your control is the same then it should look the same where ever you put it.

Jon Mitchell
+1 Nicely said.
luvieere