Ejemplo n.º 1
0
        /// <summary>
        /// Called when HW menu key button is pressed in World clock page.
        /// </summary>
        /// <param name="sender">IKeyEventSender</param>
        /// <param name="key">HW menu key("XF86Menu")</param>
        private void MenuKeyPressed(IKeyEventSender sender, string key)
        {
            // Ignore menu key handling when no data item is added to List
            // because there's no item to delete or reorder
            if (App.ClockInfo.CityRecordList.Count == 0)
            {
                return;
            }

            if (App.ClockInfo.CityRecordList.Count == 1)
            {
                // If one data item is added to a list, only "DELETE" more menu will be provided.
                dialog = new MoreMenuDialog(MORE_MENU_OPTION.MORE_MENU_DELETE, ShowDeletePage);
            }
            else
            {
                // If more than two data items are added, "DELETE" and "REORDER" more menu will be provided.
                dialog = new MoreMenuDialog(MORE_MENU_OPTION.MORE_MENU_DELETE_AND_REORDER, ShowDeletePage, ShowReorderPage);
            }

            dialog.BackButtonPressed += Dialog_Canceled;
            dialog.OutsideClicked    += Dialog_Canceled;
            dialog.Shown             += Dialog_Shown;
            // Make MoreMenuDialog visible
            dialog.Show();
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Called when HW menu key button is pressed in World clock page.
        /// </summary>
        /// <param name="sender">KeyEventSender</param>
        /// <param name="key">HW menu key("XF86Menu")</param>
        private void MenuKeyPressed(IKeyEventSender sender, string key)
        {
            // Ignore menu key handling when no data item is added to List
            // because there's no item to delete or reorder
            if (AlarmModel.ObservableAlarmList.Count == 0)
            {
                return;
            }
            // If one data item is added to a list, only "DELETE" more menu will be provided.
            dialog = new MoreMenuDialog(MORE_MENU_OPTION.MORE_MENU_DELETE, ShowDeletePage);

            dialog.BackButtonPressed += Dialog_Canceled;
            dialog.OutsideClicked    += Dialog_Canceled;
            dialog.Shown             += Dialog_Shown;
            // Make MoreMenuDialog visible
            dialog.Show();
        }