O'Reilly logo

XAML Unleashed by Adam Nathan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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.

LISTING 15.4 PlayingCard.xaml: The User Interface for PlayingCard

<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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required