Errata

Programming WPF

Errata for Programming WPF

Submit your own errata for this product.

The errata list is a list of errors and their corrections that were found after the product was released.

The following errata were submitted by our customers and have not yet been approved or disproved by the author or editor. They solely represent the opinion of the customer.

Color Key: Serious technical mistake Minor technical mistake Language or formatting error Typo Question Note Update

Version Location Description Submitted by Date submitted
1
Example1-3. A minimal msbuild project file

the 1st.csproj is not valid and doen't open in visual studio becuase the Compile element has no end tag:

Example1-3. A minimal msbuild project file
<Compile Include="MyApp.cs" >

should be
<Compile Include="MyApp.cs" />

mike anderson  Jun 22, 2009 
PDF Page 1
All

The "WPF from Scratch" section add no value whatsoever to the task at hand of learning WPF. I do not see any point in creating a WPF application with a COM-based MessageBox() call, using command line compilation no less. In fact, this section does harm by confusing the reader.

Also, there is no confirmed errata for this book. Even if the authors have abandoned the book, O'Reilly should attend to it and try to resolve some of the errors.

Anonymous  Mar 28, 2012 
Printed Page 1
Example 1-1

Example 1-1 line 3 "using System.Windows; // the root WPF name space" should read
"using System.Windows.Forms"

Without this correction get message "The name 'MessageBox' does not exist in the current context"

Problem also exists in code samples

John D Bauer  Dec 07, 2014 
1.1.3
Code for Example 1-13

(Sorry, I don't have a page number -- I'm reading in Safari.)

Line 13 of example 1-13 is this:

<Compile Include="MyApp.xaml.cs" />

In order to get it to compile, I had to remove the slash:

<Compile Include="MyApp.xaml.cs" >

Anonymous  Jul 22, 2008 
Printed Page 5
Example 1-5 code

void AppStartup(object sender, StartupEventArgs e)
should be read
static void AppStartup(object sender, StartEventArgs e)

Anonymous   
6.2.11
http://proquestcombo.safaribooksonline.com/9780596510374/data_binding-id1

"desfault" should be spelled as "default".

Nitin Rathee  Aug 11, 2009 
Printed Page 11
Code for Example 1-13

Line 13 of example 1-13 is this:

<Compile Include="MyApp.xaml.cs" />

In order to get it to compile, I had to remove the slash:

<Compile Include="MyApp.xaml.cs" >

Anonymous   
Printed Page 26
Data Templates

I suppose that the XAML in Example 1-29 put into an XAML editor will produce Figure 1-16

landon kelsey  May 25, 2009 
Printed Page 38
2nd edition

problem page 38 example 2-3

the XAML is supposed to define the application but doesn't and is incomplete.

The C# code supposed to be produced is under the incomplete XAML.

landon kelsey  May 25, 2009 
PDF Page 59
Example 2-8

Hi,

I'm reading the book "O'Reilly, Programming WPF, 2nd Edition" and there is an example Ch02/AppDeployment where databinding of Properties.Settings.Default is done this way:

<TextBlock Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" Text="{Binding Source={x:Static local:Properties.Settings.Default}, Path=LastExcuse}" />

I can compile the code and it works but Designer in Visual Studio 2008 returns error:

Error 1 Could not create an instance of type 'StaticExtension'. ...\ch02\AppDeployment\excusegen\Window1.xaml 33

Solution that worked for me was:
1) add the line:
<Window
x:Class="excusegen.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:excusegen"
xmlns:properties="clr-namespace:excusegen.Properties" // ADDED LINE
Width="550"
Height="175"
Title="Excuse Generator">

2) And bind Settings this way:

<TextBlock Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" Text="{Binding Source={x:Static properties:Settings.Default}, Path=LastExcuse}" />

MartyIX  Mar 28, 2010 
Printed Page 72
Figure 3-10

The Figure 3-10 is supposed to show "the Grid has made all the columns the same width" but it is
not. (Left column is shorter than right column).

Anonymous   
Printed Page 179
1st paragraph

"... Example 6-8 is creating a binding between the Text property of the TextBox and the Name
property..."

should be:

"... Example 6-8 is creating a binding between the Text property of the TextBox and the Age
property..."

because Example 6-8 is:

<TextBox Text="{Binding Path=Age}" />

Anonymous   
179
Figure 6-8

(this error is also in the printed version of the book)
Under BindingSource:
"<unknown>.Name" should read:
"<unknown>.Age"

Anonymous  Aug 02, 2008 
Printed Page 208
first line

"The SelectedValue is exposed from the ItemsControl..." should be "The SelectedValue is exposed
from the Selector..."

Anonymous   
Printed Page 208
Example 7-7

The second line in the code:

// INotifyPropertyChangeIdINotifyPropertyChanged Members

should be

// INotifyPropertyChange Members

Anonymous   
Printed Page 267
Example 8-12, lines 4-11 on page

In the if(CurrentPlayer) block in the TicTacToe game, when the intention is to switch the player (from X to O and vice versa), instead of the assignment operator =, the comparison operator == is used instead.

Example 8-2 on page 259 includes a longer snippet which does not appear to have this error.

Michael Kj?rling  Jan 15, 2009 
Printed Page 282
Code Example

Missing <EventTrigger.Actions> property element in the XAML markup.

Should be as follows:
<EventTrigger RoutedEvent="Click">
<EventTrigger.Actions>
<BeginStoryboard>
<Storyboard>
<DoubleAnimation Storyboard.TargetProperty="Opacity"
From="0" To="1" Duration="0:0:2" />
</Storyboard>
</BeginStoryboard>
</EventTrigger.Actions>
</EventTrigger>

Anonymous   
Printed Page 539
Code examples 15-17 thru 15-21

Sequence of code examples for printing a flowdocument seems to have errors around size and positioning.
1. The documentpaginator width is set to the printable area width, taking no account of the margin. This means that with the margin applied, the text is pushed over to the right-hand side of the page, and off the edge. Ditto height, pushing text off the bottom of the page.
2. The header and footer should be within the top and bottom margin, not in addition to it.
That said, the examples do provide a good starting point, but they require a bit of work to make them usable.

Peter Goodwin  Dec 08, 2016