示例#1
0
        private async void MaterialGridView_ItemClick(object sender, ItemClickEventArgs e)
        {
            GoodMaterial gm = e.ClickedItem as GoodMaterial;

            var contentDialog = new ContentDialog()
            {
                Content           = new GoodMaterialDialog(gm),
                PrimaryButtonText = "确定",
                FullSizeDesired   = false
            };

            contentDialog.Style = transparent;

            contentDialog.Closed += async(_s, _e) =>
            {
                await GoodsGrid.Blur(value : 0, duration : 0, delay : 0).StartAsync();

                contentDialog.Hide();
            };

            contentDialog.PrimaryButtonClick += async(_s, _e) =>
            {
                await GoodsGrid.Blur(value : 0, duration : 0, delay : 0).StartAsync();

                contentDialog.Hide();
            };
            await GoodsGrid.Blur(value : 7, duration : 100, delay : 0).StartAsync();

            await contentDialog.ShowAsync();
        }
        private void LoadData(GoodMaterial c)
        {
            GoodImage.Source = new BitmapImage(new Uri(c.Picture));
            GoodName.Text    = c.Name;
            GoodEnName.Text  = c.EnName;
            // 可制作科技/来源于生物
            var thickness = new Thickness(5, 0, 0, 0);

            if (c.Science == null || c.Science.Count == 0)
            {
                GoodScienceTextBlock.Visibility = Visibility.Collapsed;
                GoodScienceWrapPanel.Visibility = Visibility.Collapsed;
            }
            else
            {
                foreach (var picPath in c.Science)
                {
                    var picButton = new PicButton
                    {
                        HorizontalAlignment = HorizontalAlignment.Left,
                        Margin = thickness,
                        Source = StringProcess.GetGameResourcePath(picPath)
                    };
                    picButton.Tapped += Good_Jump_Tapped;
                    GoodScienceWrapPanel.Children.Add(picButton);
                }
            }
            if (c.SourceCreature == null || c.SourceCreature.Count == 0)
            {
                GoodSourceCreatureTextBlock.Visibility = Visibility.Collapsed;
                GoodSourceCreatureWrapPanel.Visibility = Visibility.Collapsed;
            }
            else
            {
                foreach (var picPath in c.SourceCreature)
                {
                    var picButton = new PicButton
                    {
                        HorizontalAlignment = HorizontalAlignment.Left,
                        Margin = thickness,
                        Source = StringProcess.GetGameResourcePath(picPath)
                    };
                    picButton.Tapped += Good_Jump_Tapped;
                    GoodSourceCreatureWrapPanel.Children.Add(picButton);
                }
            }
            // 介绍
            GoodIntroduction.Text = c.Introduction;
            // 控制台
            ConsolePre.Text = $"c_give(\"{c.Console}\",";
        }
示例#3
0
        public GoodMaterialDialog(GoodMaterial gm)
        {
            this.InitializeComponent();

            GetImage(gm);
            MaterialImage.Source      = new BitmapImage(new Uri(gm.Picture));
            MaterialName.Text         = gm.Name;
            MaterialEnName.Text       = gm.EnName;
            ROG.IsChecked             = gm.IsROG;
            SW.IsChecked              = gm.IsSW;
            DST.IsChecked             = gm.IsDST;
            MaterialIntroduction.Text = gm.Introduction;
            Console.Text              = gm.Console;
        }
示例#4
0
        public void GetImage(GoodMaterial gm)
        {
            foreach (var item in gm.Science)
            {
                scienceData.Add(
                    new BindingImage
                {
                    ImagePath = $"ms-appx:///Assets/GameResources/{item}.png"
                });
            }

            foreach (var item in gm.Creature)
            {
                creatureData.Add(
                    new BindingImage
                {
                    ImagePath = $"ms-appx:///Assets/GameResources/{item}.png"
                });
            }
        }