我有Set Form,在这个表单中我注入了另一个set form
public partial class ServicePriceBlockSetForm : RibbonForm
{
[Inject]
private OtherServiceSetForm OtherServiceSetForm { get; set; }
public ServicePriceBlockSetForm()
{
InitializeComponent();
}
...
}
当我通过按钮点击调用此表单时,第一次打开表单,一切正常。当我关闭并再次尝试打开此表单时,我得到:
An unhandled exception of type 'System.ObjectDisposedException' occurred in
System.Windows.Forms.dll
Additional information: Cannot access a disposed object.
表格注册在Ninject容器中。
_kernel.Bind<ServicePriceBlockSetForm>().ToSelf();
_kernel.Bind<OtherServiceSetForm>().ToSelf();
我该怎么处理这个错误?