Hi, @Marino Liranzo . Welcome Microsoft Q&A.
Is your class library Class Library (.NET Framework), Class Library or WPF Class Library? If it is WPF Class Library, you can refer to the following code. If there is any problem, please let me know.
My Target Framework are both .NET 6.0.
project structure:
You could right-click Denpencies
under WPF Project (InvokeLibrary) and select Add Project References...
, then Check WPF Class Library (WpfLibrary1).
You can directly use the window in the class library in the wpf project.
MainWindow.xaml:
<Grid>
<Button x:Name="btn" Content="show window1" Height="50" Click="btn_Click" />
</Grid>
MainWindow.xaml.cs:
private void btn_Click(object sender, RoutedEventArgs e)
{
Window1 w = new Window1();
w.Show();
}
The result:
If the response is helpful, please click "Accept Answer" and upvote it. Note: Please follow the steps in our [documentation][5] to enable e-mail notifications if you want to receive the related email notification for this thread.