窗口1:
public partial class LoginVindow : NSWindow
{
public LoginVindow (IntPtr handle) : base (handle)
{
}
}
窗口2:
public partial class OperationWindow : NSWindow
{
public OperationWindow (IntPtr handle) : base (handle)
{
}
}
现在,我想在点击按钮后关闭第一个窗口,然后打开第二个窗口。但是,此代码不能为我运行。
partial void LoginButton_Clicked(Foundation.NSObject sender)
{
Window.Close(); // Closes the first login window.
var operation_window = new OperationWindow(Handle); // Gets the second Window. IntPtr parameter is required unlike the internet codeblocks.
operation_window.ShowWindow(this); // No any method like this.
}
所有的代码块在互联网上似乎为非定制标准类窗口项目,但其中一个似乎是稳定的我。但是,它没有运行(在Xamarin论坛发布:
https://forums.xamarin.com/discussion/122359/open-and-close-window-programmatically-xamarin-mac
我怎么处理这个手术?请帮忙,谢谢。