public void CloseWebPart() { _webPartDefinition.CloseWebPart(); _webPartDefinition.SaveWebPartChanges(); _webPartDefinition.Context.ExecuteQuery(); }