I have a problem here. In project A I have a wpf, I referred the project B, and in this wpf , I create a winform b which defined in Project B.
When I closing the form b, I want to also close the wpf.
Since I already referred project B in project A. How can I close the wpf?
The code is like this:
using projectB;
namespace projectA
{
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
function();
}
public void function()
{
form = new formb();
form.Show();
}
}
}
.
namespace projectB
{
public partial class formb : WinFormBase
{
private void btnClose_Click(object sender, EventArgs e)
{
this.Dispose();
// how to also close the wpf(MainWindow) here?
}
}
}