I am trying to show another WPF window in my project, but it keeps giving me an error CS1061 (missing using directive). My code is representated below.
My project consists of two pages, one main, and one window that should open after the click.
The code of the click is where I get the error. It gives the error code showed before...
the click:
} private void Win_Click(object sender, RoutedEventArgs e) { var form = new Window(); form.ShowDialog(); //ERROR CS1061 } I am using following Using-Directives:
using System; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Threading; using System.Threading.Tasks; using System.Windows; using System.Xml; using System.Xml.Linq; using System.Windows.Navigation; using System.Linq; using System.Text; 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.Shapes; using System.Windows.Forms; I also tried changing my click code to this, but I still get the same error:
} private void Win_Click(object sender, RoutedEventArgs e) { var form = new Window(); form.Show(); //ERROR CS1061 } I hope you can help me finding the issue with my code snippet, why I keep getting that error. Thanks for taking your time to help me!