private void UpdateWindow() { ZhName.IsEnabled = false; EnName.IsEnabled = false; ZhName.Text = AccessHelper.GetGameZhName(gameIndex); EnName.Text = AccessHelper.GetGameEnName(gameIndex); gameID = AccessHelper.GetGameID(gameIndex); Pic.Source = AccessHelper.GetGameImage(gameID); gameCount = AccessHelper.GetGameCount(); }
public static void CreateGameInfo(Grid grid, int row) { Canvas canvas = new Canvas(); Canvas.SetTop(canvas, row * 200); Image img = new Image(); Canvas.SetTop(img, row * 200); string gameID = AccessHelper.GetGameID(row); canvas.Name = "canvas" + gameID; img.Width = 186; img.Height = 186; img.Source = AccessHelper.GetGameImage(gameID); canvas.Children.Add(img); Label zh = new Label(); Canvas.SetTop(zh, row * 200); Canvas.SetLeft(zh, 200); zh.Width = 600; zh.Height = 50; zh.FontSize = 20; zh.Content = AccessHelper.GetGameZhName(row); canvas.Children.Add(zh); Label en = new Label(); Canvas.SetTop(en, row * 200 + 50); Canvas.SetLeft(en, 200); en.Width = 600; en.Height = 50; en.FontSize = 16; en.Content = AccessHelper.GetGameEnName(row); canvas.Children.Add(en); Label storage = new Label(); Canvas.SetTop(storage, row * 200 + 100); Canvas.SetLeft(storage, 200); storage.Width = 600; storage.Height = 50; storage.FontSize = 16; storage.Content = AccessHelper.GetGameStorage(gameID) + "条交易信息"; storage.Name = "storage" + gameID; canvas.Children.Add(storage); Button detail = new Button(); Canvas.SetTop(detail, row * 200 + 150); Canvas.SetLeft(detail, 200); detail.Width = 100; detail.Height = 30; detail.Content = "查看详情"; detail.Click += DetailBtn_Click; detail.Name = "detail" + gameID; detail.Background = Brushes.White; canvas.Children.Add(detail); Button create = new Button(); Canvas.SetTop(create, row * 200 + 150); Canvas.SetLeft(create, 350); create.Width = 100; create.Height = 30; create.Content = "发布二手"; create.Name = "create" + gameID; create.Click += CreateBtn_Click; create.Background = Brushes.White; canvas.Children.Add(create); grid.Children.Add(canvas); grid.Height += 200; }