It is necessary by pressing the button to display the form on the panel (stackpanel) or another component (TabControl etc). For winforms is not difficult:
Form2 frm = new Form2(); frm.TopLevel = false; frm.Visible = true; frm.FormBorderStyle = FormBorderStyle.None; frm.Dock = DockStyle.Fill; this.Panel1.Focus(); this.Panel1.Controls.Add(frm); But how to do it in wpf? Tried like this:
Form2 frm = new Form2(); panel_info.Children.Add(frm); //stackpanel so
Form2 frm = new Form2(); tb.Children.Add(frm); //TabControl I get an error Объект Window должен быть корнем дерева. Нельзя добавить объект Window как дочерний объект для Visual. Объект Window должен быть корнем дерева. Нельзя добавить объект Window как дочерний объект для Visual.
a little googling stumbled upon the link http://www.codescratcher.com/wpf/mdi-parent-window-in-wpf/ , but because there you need to connect a third-party libu, it does not suit me. Is there a way to implement this in standard ways? I do not resort to third-party libs and TP
SelectedItemfrom theListViewto theContentPresenter- user227049