I am working on a windows forms application, in which I use ninject, the problem is that in the constructor of my userControl I implement to use my CRUD operations.
public partial class ucProveedor : UserControl, ICommandAction
{
private ISaProveedor _repositoryProveedor;
public ucProveedor(ISaProveedor repositoryProveedor)
{
InitializeComponent();
_repositoryProveedor = repositoryProveedor;
}
}
Then when I call the userControl he asks me for a parameter.
private void btnMenuProveedor_Click(object sender, EventArgs e)
{
ucProveedor _proveedor = new ucProveedor();
pnlPiso.Controls.Add(_proveedor);
}
What can I do?