Creating the User Interface
The auto-generated PlayingCard.xaml
file must now change to use the ToggleButton
base class, contain the appropriate resources, and have an inner ContentControl
named contentControl
. Listing 15.4 shows what this looks like.
<ToggleButton x:Class="Chapter15.PlayingCard" xmlns:local="using:Chapter15" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> <ToggleButton.Resources> <ControlTemplate x:Key="HA" > <Grid> <Path Fill="White" Stroke="Black" Data="..."/> <Path Fill="Red" Data="..."/> ... </Grid> </ControlTemplate ...
Get XAML Unleashed now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.