HiveBrain v1.2.0
Get Started
← Back to all entries
patterncsharpMinor

Simon Says: "Make me a circular window"

Submitted by: @import:stackexchange-codereview··
0
Viewed 0 times
makesimoncircularsayswindow

Problem

This is my first time messing with non-rectangular windows and animations in WPF, so while I'm working on all the bugs I'm having with the actual game code, I'm submitting the XAML for review - I don't like how redundant it is, but I'm sure there's a clever way to simplify it.

`









































































Solution


  • You use Border to create a button, instead of using an actual Button class with custom template. Because of this you'll have to manually manage all the interactions, which are already implemented in regular Button (Clicked, IsPressed, Command, their interaction with IsEnabled property and keyboard, etc.). So i suggest you use an actual button.



  • Well, your storyboards are clearly copy-pasted. :) Why don't you move them to resources?

Context

StackExchange Code Review Q#71904, answer score: 6

Revisions (0)

No revisions yet.