private void LoadData(GoodPet c) { GoodImage.Source = new BitmapImage(new Uri(c.Picture)); GoodName.Text = c.Name; GoodEnName.Text = c.EnName; // 宠物死亡 GoodDeadWrapPicButton.Source = StringProcess.GetGameResourcePath(c.Dead); // 跟随宠物 var thickness = new Thickness(5, 0, 0, 0); if (c.Follow == null || c.Follow.Count == 0) { GoodFollowTextBlock.Visibility = Visibility.Collapsed; GoodFollowWrapPanel.Visibility = Visibility.Collapsed; } else { foreach (var picPath in c.Follow) { var picButton = new PicButton { HorizontalAlignment = HorizontalAlignment.Left, Margin = thickness, Source = StringProcess.GetGameResourcePath(picPath), PictureSize = 90 }; picButton.Tapped += Good_Jump_Tapped; GoodFollowWrapPanel.Children.Add(picButton); } } GoodIntroduction.Text = c.Introduction; ConsolePre.Text = $"c_give(\"{c.Console}\","; }
private async void PetGridView_ItemClick(object sender, ItemClickEventArgs e) { GoodPet gp = e.ClickedItem as GoodPet; var contentDialog = new ContentDialog() { Content = new GoodPetDialog(gp), 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(); }
public GoodPetDialog(GoodPet gp) { this.InitializeComponent(); PetImage.Source = new BitmapImage(new Uri(gp.Picture)); PetName.Text = gp.Name; PetEnName.Text = gp.EnName; ROG.IsChecked = gp.IsROG; SW.IsChecked = gp.IsSW; DST.IsChecked = gp.IsDST; Dead.Source = new BitmapImage(new Uri(gp.Dead)); Follow.Source = new BitmapImage(new Uri(gp.Follow)); PetIntroduction.Text = gp.Introduction; Console.Text = gp.Console; }