I am trying to create a child window in WPF.this child window should open when a button is clicked
I am using the generic code
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
private void Click_setupClass(object sender, RoutedEventArgs e)
{
ChildWindow child = new ChildWindow();
}
For some reason Childwindow cannot be intitialized.It gives me Childwindow cannot be found Are you missing an assembly reference.
Isn’t childWindow accesible through System.Windows.Controls;.What am i doing wrong?
ChildWindow is made only for Silverlight, as far as I know. You should use Window class in WPF. Just call
window.ShowDialog()to display the modal window.