2017-08-24 100 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 

感謝