'PDFtron Xamarin Forrm Customize QuickMenu

Am trying to customize the quickmenu to remove some menu items in PDFtron 9.0.2, following the guide here.

enter image description here

Tried first to add pan.xml under resources folder and it is not working.

enter image description here

Tried subscribing to ShowQuickMenu event and remove some unwanted menu and it is also not working.

mDocumentView.MPdfViewCtrlTabHostFragment.CurrentPdfViewCtrlFragment.ShowQuickMenu += CurrentPdfViewCtrlFragment_ShowQuickMenu;

Event handler

var menu = e.Quickmenu.Menu as QuickMenuBuilder;
var item = menu.FindItem(Resource.Id.qm_redaction);
item.SetVisible(false);

What am doing wrong?



Solution 1:[1]

Following code works.

var redactionMenuItem = e.Quickmenu.FindMenuItem(Resource.Id.qm_redaction);

e.Quickmenu.RemoveMenuEntries(new List<QuickMenuItem> { redactionMenuItem });

Dont know why customizing pan.xml is not working though.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Balaji Gunasekaran