This error occurs: - System.InvalidOperationException: 'Window must be the root of the tree. Cannot add Window as a child of Visual.' I want to open another WPF window inside the stack panel. If WPF window can't open, then give some other good option.
private ObjectPlacement objectPlacement; private void Button_Click_4(object sender, RoutedEventArgs e) { ObjectPlacement W = new ObjectPlacement();// other WPF window settingpanel.Children.Add(objectPlacement);//setting panel is stack panel. W.Show(); }
private void Object_placement_Click(object sender, RoutedEventArgs e) { settingpanel.Children.Clear(); UserControl1 newFormControl = new UserControl1(); settingpanel.Children.Add(newFormControl); }
Frame
Pages
ContentControl
UserControls
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)