Welcome to WindowsClient.net | My Blog | Sign in | Join

Faisal's Blog

Sponsors





  • advertise here

Articles

Blogroll

May 2009 - Posts

Book Review: WPF In Action with Visual Studio 2008

Written By : Arlen Feldman and Maxx Daymon

Pages : 520

ISBN : 1933988223

Publisher : Manning Publications Co.

Introduction

If you’re already a .Net developer and want to know about next generation smart client application development in Windows Presentation Foundation (WPF) then you must checkout this book to get an in-depth knowledge of WPF. The book is nicely designed to give you a great start by providing the concepts required to get started with Windows Presentation Foundation (WPF) and process to build on that foundation.

Part 1 – Past, present and future

This chapter is mostly about the history of WPF. The chapter starts with discussing the Avalon days of WPF to give you a better understanding on the purpose of this technology. Here the authors of this book represented the importance of presentation layer. You’ll know why there’s demand among users for Windows like tools for the web and web like tools for the desktop. In the process of learning WPF, you’ll be able to know how Windows and Web development came into being and how they exist today. Section 1.1.1 of this chapter will take you back to the 1990 when Windows 3.0 came out. In section 1.1.2 of this part of the book, you’ll know how we’re currently creating UI. Section 1.1.3 discusses the traditional look of the Web. In section 1.1.4 you’ll become familiar with the web UI. Section 1.2 focuses on Microsoft’s decision on completely recreate the way in which UI is built. At 1.2.1 you’ll learn how WPF takes advantage of modern Hardware. At 1.2.2 you’ll know all about modern software design. You’ll also know that WPF API is completely managed and code operates extremely smoothly with applications that are also managed. Section 1.2.3 discusses the crucial issue of separating presentation logic from presentation. You’ll know the main advantage of separating the look and feel from the behavior by prototyping UI’s, how designer’s can use XAML to create Mock up that create WPF UI’s. Section 1.2.4 discusses the broader target of WPF application. Section 1.3 presents the to ways of creating WPF UI. Section 1.3.1 will give you the ample knowledge of defining WPF UI with XAML. Here Author’s showed how UI’s look and feel can be changed with declarative programming with some good examples. 1.3.2 will show you the procedural way of doing WPF programming. Much like what you did in Windows Forms. At 1.3.3 you’ll know how to define UI with Microsoft Expression Blend and Visual Studio. Section 1.3.4 explains how drawing is done in WPF. You’ll also know how WPF works with your graphics card under the hood, offloading the heavy lifting of drawing. At section 1.3.5 you’ll know about the Pixel’s and Vectors. You’ll be able to know the difference between immediate drawing and retained-mode drawing.

Part 2 – The Basics (Chapter 4 - 8)

At this part of the book, you’ll delve into the basics of WPF. In this part you’ll find an example of a calculator which demonstrates a lot of WPF concepts. One of the vital concepts in WPF is laying out the Panel’s or container of controls. You’ll learn inner workings of the different Panels in this part. The authors of this book have given a smooth explanation about the idea behind layout usage. You’ll also become aware of some controls which are not technically layout but have a lot to do with laying out content. Layout controls’s like Canvas, StackPanel, DockPanel, WrapPanel, Grid are all discussed in this section of the book. Next you’ll learn the fun part of styling and templating controls by creating resources to change the look and feel of the controls. You’ll know all about based Styles based on other styles and how they work. How EventSetters in derive styles work has also been defined here. You will learn various techniques of creating XAML assets. Brief explanation of Resources has been given here to make you understand what a WPF resource really is and how you can make them work for you. For example, how resources can be associated with any framework element or framework content element has been described here. How resources can be created globally and locally, how to define themes in ResourceDictionary, when to use different themes, how to change themes from code behind, difference between static and dynamic resource has been discussed in an excellent way here by the authors. One of the main elements of WPF is DependencyProperty. How Dependency property is different from regular property and what advantage it can provide has been discussed here. You’ll get a deeper knowledge of WPF property system. Also you’ll learn how to reference non-resources in XAML in this chapter of the book. In the Next chapter of part to you’ll become familiar with event mechanism of WPF. Powerful concept of RoutedEvent’s has been explained in this chapter. The next chapter is discussed the layered effect, animation, transforms and poor attempt on counting the dimensions of page. After reading these chapters you’ll be adding some glitter to your application by creating a templated button with some interactive functionality.

Part 3 – Application Development(Chatpter 9 - 15)

In this part of the book you’ll learn everything about WPF application development. You’ll learn about planning an application, how to laying out more complex design by layering multiple layouts, setting up Toolbar’s Menu’s etc. At chapter 9.1 you’ll create a Desktop Wiki Project. Commands has been discussed at chapter10. This chapter focuses on WPF’s approach on interaction between the presentation and business logic. You'll know the idea behind the Command pattern to encapsulate a method call and its parameters so that you can treat the method call itself as an object in the system and how multiple different classes can have command bindings to the same command. You dive deep into the routing model and custom commands in this part of the book. Chapter 10.3 discusses the uses of built-in system commands like ApplicationCommands, NavigationCommands, EditingCommands, ComponentCommands and MediaCommands. Chapter 11 discusses on the most important part of WPF data binding. You’ll become familiar binding with Objects, XML, ADO.NET, LINQ. You’ll know about the three important elements of binding and binding modes available in WPF in this section of the book. By reading this chapter you’ll get a strong concept on binding in WPF. Chapter 12 will show you how to create advanced DataTemplates. At 12.1 you’ll know about DataConverter that converts one value into another. Chapter 12.2 will show you the uses of DataTrigger. Chapter 12.3 discusses the CollectionViewSource and their uses. You’ll learn how to sort and filter with CollectionViewSource programmatically. At 12.5 you’ll learn the WPF’s concept of built-in validation. Chapter 12.6 will show you WPF’s design pattern Model-View-ViewModel . You get the knowledge why The MVVM pattern is only workable in a fairly robust binding like scenario. At chapter 13.1 you’ll learn how to compose new UserControls. You’ll go through an example of creating a LinkLabel control here. At 13.2 to you’ll learn how to create a CustomControl . Chapter 14 is all about drawing in WPF. You’ll know about six shape class and how to draw with them in this chapter. At 14.4 you’ll see how to drawing with Visuals. You’ll become aware of the fact that the Visual class is the lowest-level class for putting things on the screen. In some respects, it’s the WPF equivalent of a Windows handle without all the overhead. UIElements, Controls, 3D stuff—these are all derived from the Visual class. You’ll see an example of a class to render Visuals. You’ll also know how to hit-test with Visuals at 14.4.2. In the next chapter you’ll see examples of drawing with Geometry and definition of those. Chapter 15 is a fun and interesting part of the book. It discusses uses of 3D in WPF. You’ll create a simulated world of three-dimensional models that represent the things that you want to show up. You’ll learn how to position a camera and point it in an appropriate direction to control what you see, and how to put in lights. You’ll learn how viewfinder is represented with the use of a class called Viewport3D which is another FrameworkElement that can be positioned in your layout like any control. Inside the Viewport3D is where all your 3D elements reside. At 15.1.1 you’ll know all about 3D Models. This section describes about little triangle with which WPF models are made. Once you define the triangle how can you cover it with some materials and how it should look on a 2D screen are all described here nicely. At 15.1.2 describes inner workings of lights in 3D. You’ll learn about different types of lights available in WPF. In section 15.1.3 the book discusses about the camera in regard to 3D and you’ll learn how to define a camera and specify which way it’ll be looking to see anything in the 3D environment. You’ll gain the knowledge of WPF of camera which WPF has and how both of them show representation of a scene from a particular place. 15.2 will show you the graphing in 3D. In this section you’ll see an example of creating 3D models to represent each column in a chart. 15.3 is about 3D Transformations.

Part 4 – The last miles(chapter 16 - 21)

In chapter 16 you’ll create a navigation application with back and forward navigation. At 16.1 you’ll learn where and when to use navigation application. At 16.2 you’ll create a basic navigation application. Chapter 17 covers XBAP, ClickOnce and Silverlight. You learn how XBAP(XAML Browser Application), allows WPF applications to be run directly from within your browser. This is sort of like using ActiveX controls. You can have arbitrary code downloaded and executed on the client machine inside the browser. At 17.1 you’ll create an XBAP application to get the deeper knowledge of browser application is WPF. At 17.1.1 you’ll know all about XBAP security. At 17.1.2 you’ll learn how to deploy XBAP. 17.2.2 will show you when to use ClickOnce. At 17.3 describes one of the recent hot topics Silverlight which is a technology built for creating Rich Internet Application. Chapter 18 covers FlowDocuments, synchronous and asynchronous printing, printing fixed document. At chapter 19 is one of fun part of this book. In this part of the book you’ll create a WorldBrowser application and add some transitional effects like fades and wipe. You’ll also learn how to balance your xaml and code. Chapter 20 is about interoperability in WPF. You’ll learn here how to use WindowsForms controls inside WPF, Using other stuff like ActiveX,C++,MFC inside WPF, and using WPF in WindowsForms. At 20.1.1 you’ll get an example of using the WindowsForms DateTimePicker in WPF. At 20.1.2 to you’ll learn how to enable WindowsThemes for WindowsForms control. 20.1.3 cover what you can’t do with embedded windows forms controls. 20.1.4 has an example of using you own or third party windows forms controls. At 20.1.5 you’ll create a windows forms form to display results when the user hits the accept button. To bring this up as a modal dialog you’ll do exactly what you would have done in windows forms application. 20.2.1 covers embedding ActiveX controls in WPF. 20.2.2 covers embedding C++ in WPF. At 20.3.1 you’ll see an example of using a WPF control inside of windows forms. 20.3.2 is about popping up WPF dialogs. Chapter 21 covers Threading in WPF. You’ll learn all about the Dispatcher, Asynchronous calls, Timer in this chapter. You’ll become aware of the fact that WPF has two UI threads. The main UI thread and rendering thread. You’ll learn the reasons behind using threads in WPF application such as responsiveness, handling slow operations etc. 21.1 covers the moving slow work into a background thread with example. 21.2 covers asynchronous calls. You’ll learn about Dispatcher operation status here. 21.3 is about Timers. You’ll learn here that WPF has it’s very own clean timer model which uses threads but takes advantage of the DispatcherFramework.

Summary

Author Arlen Feldman and Maxx Daymon have done an excellent job to make this book easy to cope for all levels of developers. The book has been structured in a manner that anyone can read this book and use as their learning resource of WPF. To me this book is one of the best possible way to learn WPF for anyone.

Shout it
Posted: May 05 2009, 11:03 PM by ilves | with 2 comment(s)
Filed under: