public MainWindow() { InitializeComponent(); var countCardAtPlayer = player1.CardList.Count; for (int i = 0; i < 10; i++) { if (countCardAtPlayer < 10) { var card = dec.Draw(); player1.CardList.Add(card); Image img = new Image(); var getImageOnCard = new GetImageOnCard(); var getCardImage = getImageOnCard.GetCard(card, null); img.Source = getCardImage; Button btn = new Button(); btn.Click += ClickOnCardsPlayer_Click; btn.Name = card.Active.ToString(); btn.Content = img; btn.RenderTransformOrigin = new Point(0.5, 0.5); Grid.SetColumn(btn, x); Player1.Children.Add(btn); x++; } } }
private void Heap_Initialized(object sender, EventArgs e) { var card = dec.Draw(); var img = new Image(); var getImageOnCard = new GetImageOnCard(); var getCardImage = getImageOnCard.GetCard(card, null); img.Source = getCardImage; heap.Name = card.Picture; heap.Children.Add(img); }
private void Button_Initialized(object sender, EventArgs e) { var card = dec.CardOnDesk(); dec.Draw(); var img = new Image(); var getImageOnCard = new GetImageOnCard(); var getCardImage = getImageOnCard.GetCard(card, null); img.Source = getCardImage; heap.Name = card.Picture; heap.Content = img; }
Button GetButton(Card card) { Image img = new Image(); var getImageOnCard = new GetImageOnCard(); var getCardImage = getImageOnCard.GetCard(card, null); img.Source = getCardImage; Button btn = new Button { Name = card.Picture, Content = img, RenderTransformOrigin = new Point(0.5, 0.5) }; return(btn); }
private void Button_Click_1(object sender, RoutedEventArgs e) { var card = dec.Draw(); Image img = new Image(); var getImageOnCard = new GetImageOnCard(); var getCardImage = getImageOnCard.GetCard(card, null); img.Source = getCardImage; Button btn = new Button(); btn.Name = card.Picture; btn.Content = img; btn.RenderTransformOrigin = new Point(0.5, 0.5); Grid.SetColumn(btn, x); Player1.Children.Add(btn); x++; }
private void Button_Click_1(object sender, RoutedEventArgs e) { var countCardAtPlayer = player1.CardList.Count; if (countCardAtPlayer < 10) { var card = dec.Draw(); player1.CardList.Add(card); Image img = new Image(); var getImageOnCard = new GetImageOnCard(); var getCardImage = getImageOnCard.GetCard(card, null); img.Source = getCardImage; Button btn = new Button(); btn.Click += ClickOnCardsPlayer_Click; btn.Name = card.Active.ToString(); btn.Content = img; btn.RenderTransformOrigin = new Point(0.5, 0.5); Grid.SetColumn(btn, x); Player1.Children.Add(btn); x++; } }