2017-08-24 105 views
0

我正在使用uCommerce,我想删除现有选项卡上的添加按钮之一。如何删除uCommerce中选项卡上的现有按钮?

我跟着这个删除按钮部分上this文章

一切工作正常,但我不知道什么是RemoveMenuButtion()方法中imageButtom。

这里是我的代码 -

public PipelineExecutionResult Execute(SectionGroup subject) 
     { 
      if (subject.GetViewName() != Constants.UI.Pages.Orders.Order) 
       return PipelineExecutionResult.Success; 

      var section = subject.Sections.FirstOrDefault(s => s.OriginalName == Constants.UI.Sections.Orders.Order.Shipping); 

      if (section == null) return PipelineExecutionResult.Success; 

      var imageButton = new ImageButton { ImageUrl = $"{_pathService.GetPath()}/images/ui/add.png"};  

      section.Menu.RemoveMenuButtion(imageButton); 

      return PipelineExecutionResult.Success; 
     } 

我认为这个问题是这里 -

var imageButton = new ImageButton { ImageUrl = $"{_pathService.GetPath()}/images/ui/add.png"}; 

但不能肯定,因为没有什么具体的文档上虽然。

任何帮助,高度赞赏。

谢谢

回答

0

对于任何寻找答案的人。

您需要在该部分的菜单中找到该按钮,您需要在下面显示的集合中找到该按钮,然后删除该按钮,因为删除按对象引用工作。

section.Menu.ImageButtons 

感谢