internal void newPermitOpen(MdiContainer container) { PermitView newPermit = new PermitView(container); container.Children.Clear(); container.Children.Add(new MdiChild() { //Title = " User Registration", Height = (System.Windows.SystemParameters.PrimaryScreenHeight - 15), Width = (System.Windows.SystemParameters.PrimaryScreenWidth - 15), Style = null, //Here UserRegistration is the class that you have created for mainWindow.xaml user control. Content = newPermit }); }
private void newPermit_Click(object sender, RoutedEventArgs e) { ChangeMenuColor(sender); DataService ser = new DataService(); PermitView newPermitView = new PermitView(MainMdiContainer); //newPermitView.DataContext = new PermitViewModel(ser); MainMdiContainer.Children.Clear(); MainMdiContainer.Children.Add(new MdiChild() { //Title = " User Registration", Height = (System.Windows.SystemParameters.PrimaryScreenHeight - 15), Width = (System.Windows.SystemParameters.PrimaryScreenWidth - 15), Style = null, //Here UserRegistration is the class that you have created for mainWindow.xaml user control. Content = newPermitView }); }