예제 #1
0
        /// <summary>
        /// Event called on menu item update due to listview.
        /// </summary>
        private void OnUpdateMenuItem(IListItem item)
        {
            DropdownMenuItem menuItem = item as DropdownMenuItem;
            var itemData = context.Datas[item.ItemIndex];

            menuItem.Setup(itemData, context.Selection == itemData);
        }
예제 #2
0
        /// <summary>
        /// Event called from menu item when triggered.
        /// </summary>
        private void OnSelectedItem(DropdownMenuItem item)
        {
            if (item == null || item.Data == null || IsAnimating)
            {
                return;
            }

            // Make this item's data selected on the dropdown context.
            if (context != null)
            {
                context.SelectData(item.Data);
            }

            // Hide menu.
            CloseMenu();
        }