December 2014
Intermediate to advanced
512 pages
17h 4m
English
As with NumericUpDown, the PlayingCard implementation from Listing 15.3 makes assumptions about its visuals. It doesn’t have to be this way. It would be nice to remove the code that retrieves the ControlTemplate resource and applies it to a ContentControl named contentControl, and somehow make this happen with the Style applied to PlayingCard. This would leave us with the following simple property:
public string Face{ get { return face; } set { face = value; }}
Even better, let’s go ahead and turn Face into a dependency property. Dependency properties are used throughout XAML-based UI frameworks to enable styling, automatic data binding, animation, and more. For the most part, you can do ...
Read now
Unlock full access