public void Detach(IServiceContainer container)
        {
            container.unregisterService(MainForm);

            MainForm.ServiceContainer = null;
            MainForm = null;
        }
        public void Attach(IServiceContainer container)
        {
            MainForm = new MainForm {
                ServiceContainer = container
            };

            container.registerService(MainForm);
        }