[wpf] winforms -> wpf

So in winforms, you draw the shapes in the _Paint eventhandler.

In wpf, how do you set it up? Say i want my Card class with properties for color and value to be represented as a rectangle of its color and value (as a text inside the rectangle). How do you do that in wpf? If i have a list of cards to show on the canvas and i remove one in that list, do i have to use events for that as opposed to winforms where you redraw everything when something needs repainting.

by silentcon via /r/csharp

Need some help finishing this war game

I am creating the card game war. I have been struggling with little simple things, as i am new to all this.

As of right now I have been able to properly model my deck, create all the necessary classes and display every thing.

whats been giving me a hard time, is that I have been having trouble figuring out how to draw the card from the decks, compare them than return all cards to the winner.

Here is what I have ho far: http://ift.tt/1YYabUf

Its a web forms app it has 3 small classes, and the default.aspx.cs

so i figured i need something like this:

playerCard = drawCardFromPlayerDeck(playerDeck)

computerCard = drawCardFromPlayerDeck(playerDeck)

comparePlayerCards(playerCard, computerCard)

but I have no idea where to put these methods and how to create the code in them.

by Suruat via /r/csharp