вам нужно добавить свойство IsEnable в MenuPageMenuItem
модель
public class MenuPageMenuItem
{
public int Id { get; set; }
public string Icon { get; set; }
public string Title { get; set; }
public bool IsEnable { get; set; }
//your properites
}
public class ClassName
{
public List<MenuPageMenuItem> MenuItems;
public ObservableCollection<MenuPageMenuItem> MenuItemsObs { get; set; }
public ClassName()
{
MenuItemsObs = new ObservableCollection<MenuPageMenuItem>();
MenuItems = new List<MenuPageMenuItem>(new[]
{
new MenuPageMenuItem { Id = 0,IsEnable =true , Icon="ticket.png", Title = TranExtension.lang("MyTickets"), TargetType = typeof(TicketsPage)},
new MenuPageMenuItem { Id = 1,IsEnable =true ,Icon="todayticket.png", Title = TranExtension.lang("TodayTickets"), TargetType = typeof(TodayTicketsPage) },
new MenuPageMenuItem { Id = 2,IsEnable =true , Icon="notsync.png", Title = TranExtension.lang("NotSyncronized"), TargetType = typeof(NotSyncronizedpage)},
new MenuPageMenuItem { Id = 3,IsEnable =true , Icon="location.png", Title = "Gps Tracking", TargetType = typeof(GpsTracking)},
new MenuPageMenuItem { Id = 4,IsEnable =true , Icon="settings.png", Title = TranExtension.lang("Configuration"), TargetType = typeof(ConfigurationPage)},
new MenuPageMenuItem { Id = 5,IsEnable =true , Icon="error.png", Title = TranExtension.lang("Close"), TargetType=typeof(ExitPage) },
});
SetMenuItems(MenuItems);
}
private void SetMenuItems(List<MenuPageMenuItem> menuItems)
{
foreach (var item in menuItems)
{
if (item.IsEnable)
MenuItemsObs.Add(item);
}
}
}