/// <summary>
        /// 烹饪结果跳转
        /// </summary>
        private async void ResultButton_Tapped(object sender, TappedRoutedEventArgs e)
        {
            if (FoodResultImage.Source == null)
            {
                return;
            }
            var picturePath = CrockPotList[FoodIndex];
            var rootFrame   = Global.RootFrame;
            var frameTitle  = Global.FrameTitle;
            await Global.SetAutoSuggestBoxItem();

            foreach (var suggestBoxItem in Global.AutoSuggestBoxItemSource)
            {
                if (picturePath != StringProcess.GetFileName(suggestBoxItem.Picture))
                {
                    continue;
                }
                frameTitle.Text = "食物";
                Global.PageJump(1);
                var viewViewExtraData = new ViewExtraData {
                    Classify = suggestBoxItem.SourcePath, Picture = suggestBoxItem.Picture
                };
                rootFrame.Navigate(typeof(FoodPage), viewViewExtraData);
                Global.PageStack.Push(new PageStackItem {
                    SourcePageType = typeof(FoodPage), Parameter = viewViewExtraData
                });
                break;
            }
        }
Пример #2
0
        private async void Food_Jump_Tapped(object sender, TappedRoutedEventArgs e)
        {
            var picturePath = ((PicButton)sender).Source;
            var rootFrame   = Global.RootFrame;
            var shortName   = StringProcess.GetFileName(picturePath);
            await Global.SetAutoSuggestBoxItem();

            foreach (var suggestBoxItem in Global.AutoSuggestBoxItemSource)
            {
                if (picturePath != suggestBoxItem.Picture)
                {
                    continue;
                }
                var picHead       = shortName.Substring(0, 2);
                var viewExtraData = new ViewExtraData {
                    Classify = suggestBoxItem.SourcePath, Picture = suggestBoxItem.Picture
                };
                switch (picHead)
                {
                case "F_":
                    rootFrame.Navigate(typeof(FoodPage), viewExtraData);
                    Global.PageStack.Push(new PageStackItem {
                        SourcePageType = typeof(FoodPage), Parameter = viewExtraData
                    });
                    break;

                case "FC":
                    // ignore
                    break;
                }
            }
        }
        private static async void Good_Jump_Tapped(object sender, TappedRoutedEventArgs e)
        {
            var picturePath = ((PicButton)sender).Source;
            var rootFrame   = Global.RootFrame;
            var shortName   = StringProcess.GetFileName(picturePath);
            var frameTitle  = Global.FrameTitle;
            await Global.SetAutoSuggestBoxItem();

            foreach (var suggestBoxItem in Global.AutoSuggestBoxItemSource)
            {
                if (picturePath != suggestBoxItem.Picture)
                {
                    continue;
                }
                var picHead       = shortName.Substring(0, 1);
                var viewExtraData = new ViewExtraData {
                    Classify = suggestBoxItem.SourcePath, Picture = suggestBoxItem.Picture
                };
                switch (picHead)
                {
                case "S":
                    frameTitle.Text = "科技";
                    Global.PageJump(3);
                    rootFrame.Navigate(typeof(SciencePage), viewExtraData);
                    Global.PageStack.Push(new PageStackItem {
                        SourcePageType = typeof(SciencePage), Parameter = viewExtraData
                    });
                    break;

                case "A":
                    frameTitle.Text = "生物";
                    Global.PageJump(4);
                    rootFrame.Navigate(typeof(CreaturePage), viewExtraData);
                    Global.PageStack.Push(new PageStackItem {
                        SourcePageType = typeof(CreaturePage), Parameter = viewExtraData
                    });
                    break;
                }
            }
        }
        private async void DropBy_Jump_Tapped(object sender, TappedRoutedEventArgs e)
        {
            var picturePath = ((PicButton)sender).Source;
            var rootFrame   = Global.RootFrame;
            var frameTitle  = Global.FrameTitle;
            await Global.SetAutoSuggestBoxItem();

            foreach (var suggestBoxItem in Global.AutoSuggestBoxItemSource)
            {
                if (picturePath != suggestBoxItem.Picture)
                {
                    continue;
                }
                var viewExtraData = new ViewExtraData {
                    Classify = suggestBoxItem.SourcePath, Picture = suggestBoxItem.Picture
                };
                frameTitle.Text = "生物";
                Global.PageJump(4);
                rootFrame.Navigate(typeof(CreaturePage), viewExtraData);
                Global.PageStack.Push(new PageStackItem {
                    SourcePageType = typeof(CreaturePage), Parameter = viewExtraData
                });
            }
        }
Пример #5
0
        /// <summary>
        /// 自动搜索框导航
        /// </summary>
        /// <param name="extraData">额外数据</param>
        private void AutoSuggestNavigate(SearchExtraData extraData)
        {
            var viewExtraData = new ViewExtraData {
                Classify = extraData.SourcePath, Picture = extraData.Picture
            };

            switch (extraData.Category)
            {
            case "人物":
                Global.FrameTitle.Text = "人物";
                HamburgerMenu_ItemSelect(_gameDataHamburgerMenuItem[0]);
                RootFrame.Navigate(typeof(CharacterPage), viewExtraData);
                Global.PageStack.Push(new PageStackItem {
                    SourcePageType = typeof(CharacterPage), Parameter = viewExtraData
                });
                break;

            case "食物":
                Global.FrameTitle.Text = "食物";
                HamburgerMenu_ItemSelect(_gameDataHamburgerMenuItem[1]);
                RootFrame.Navigate(typeof(FoodPage), viewExtraData);
                Global.PageStack.Push(new PageStackItem {
                    SourcePageType = typeof(FoodPage), Parameter = viewExtraData
                });
                break;

            case "科技":
                Global.FrameTitle.Text = "科技";
                HamburgerMenu_ItemSelect(_gameDataHamburgerMenuItem[3]);
                RootFrame.Navigate(typeof(SciencePage), viewExtraData);
                Global.PageStack.Push(new PageStackItem {
                    SourcePageType = typeof(SciencePage), Parameter = viewExtraData
                });
                break;

            case "生物":
                Global.FrameTitle.Text = "生物";
                HamburgerMenu_ItemSelect(_gameDataHamburgerMenuItem[4]);
                RootFrame.Navigate(typeof(CreaturePage), viewExtraData);
                Global.PageStack.Push(new PageStackItem {
                    SourcePageType = typeof(CreaturePage), Parameter = viewExtraData
                });
                break;

            case "自然":
                Global.FrameTitle.Text = "自然";
                HamburgerMenu_ItemSelect(_gameDataHamburgerMenuItem[5]);
                RootFrame.Navigate(typeof(NaturalPage), viewExtraData);
                Global.PageStack.Push(new PageStackItem {
                    SourcePageType = typeof(NaturalPage), Parameter = viewExtraData
                });
                break;

            case "物品":
                Global.FrameTitle.Text = "物品";
                HamburgerMenu_ItemSelect(_gameDataHamburgerMenuItem[6]);
                RootFrame.Navigate(typeof(GoodPage), viewExtraData);
                Global.PageStack.Push(new PageStackItem {
                    SourcePageType = typeof(GoodPage), Parameter = viewExtraData
                });
                break;

            case "皮肤":
                Global.FrameTitle.Text = "皮肤";
                HamburgerMenu_ItemSelect(_gameDataHamburgerMenuItem[7]);
                RootFrame.Navigate(typeof(SkinsPage), viewExtraData);
                Global.PageStack.Push(new PageStackItem {
                    SourcePageType = typeof(SkinsPage), Parameter = viewExtraData
                });
                break;
            }
        }