private void UpdateMenuButtons(ScreenMenuCategory category)
        {
            MenuItems = CreateMenuButtons(category, CurrentPageNo, CurrentTag ?? "");

            SubCategories.Clear();
            SubCategories.AddRange(
                category.GetScreenMenuCategories(CurrentTag)
                .Select(x => new ScreenSubCategoryButton(x, SubCategoryCommand, category.MainButtonColor, category.MainFontSize, category.SubButtonHeight)));

            if (!string.IsNullOrEmpty(CurrentTag))
            {
                var backButton = new ScreenSubCategoryButton(CurrentTag.Replace(CurrentTag.Split(',').Last(), "").Trim(new[] { ',', ' ' }), SubCategoryCommand, "Gainsboro", category.MainFontSize, category.SubButtonHeight, true);
                SubCategories.Add(backButton);
            }

            if (Categories != null && MenuItems.Count == 0)
            {
                if (category.NumeratorType == 2 && SubCategories.Count == 0)
                    InteractionService.ShowKeyboard();

                MenuItems.Clear();

                if (category.MaxItems > 0)
                {
                    IEnumerable<ScreenMenuItem> sitems = category.ScreenMenuItems.OrderBy(x => x.SortOrder);
                    if (SubCategories.Count == 0)
                    {
                        sitems = Categories.Select(x => x.Category).SelectMany(x => x.ScreenMenuItems);
                    }
                    var items = sitems.Select(x => new ScreenMenuItemButton(x, MenuItemCommand, SelectedCategory));
                    MenuItems.AddRange(items.Take(category.MaxItems));
                }
            }

            RaisePropertyChanged(() => MenuItems);
            RaisePropertyChanged(() => IsPageNumberNavigatorVisible);
            RaisePropertyChanged(() => MenuItemsVerticalAlignment);
        }
 private void OnSubCategoryCommand(ScreenSubCategoryButton obj)
 {
     CurrentTag = obj.Name.Trim();
     UpdateMenuButtons(SelectedCategory);
 }