Beginning WPF 4.5 by Full Example (EPUB)

Your Price $14.99



Educating Professional Developers

This Book will be E-Delivered

Book Description

This book will quickly show you (by full example) how to create fully functional WPF applications using C#, XAML, and Visual Studio 2010 or 2012, SQL Server 2012, LINQ, Entity Framework, and the DataGrid. The examples in this book will include every single line of code that is required to execute. No assumptions will be made. The decision to write this book came from the need and frustration with finding real usable solutions. The purpose of this book is to “Learn by Full Example”. This is accomplished by eliminating lengthy useless explanations. Most developers prefer to learn by coding and not by reading boring long and drawn out text. If you need more details at any point, then refer to Microsoft's MSDN website. There you will find all the Microsoft detailed references. The goal is to save the next person from this same frustration. Most real world .NET development projects do not allow a developer to click wizards and create an application, based on requirements, by the private or government sector. In order to be a professional .NET developer in these situations one must be an expert with all aspects of code in WPF. That is with the language you are programming, the declarative markup code, and the SQL language for the database. One must also understand the definition of each of the property settings used for each user control. In additional to the classes that defines each user control. These are the prerequisites for becoming a successful professional .NET developer.

Look Inside Book

Beginning WPF 4.5 by Full Example

By Stephen P. Thomas


 

Table of Contents

Beginning WPF 4.5 by Full Example. 1

Introduction. 7

WPF Basics. 8

Let's Get Started. 8

Let’s Learn By Example 1. 9

Steps to create Example 1. 9

Explanation of the code design. 10

String.Format. 11

Here is the full code listing of Example 1: 11

Let’s Learn by Example 2: Layout. 14

Grid Panel 14

Stack Panel 15

Uniform Grid. 15

Wrap Panel 15

Dock Panel 15

Canvas. 15

Steps to create Example 2 Layout. 15

Full XAML listing with explanation: 22

Let’s Learn by Example 3: TimeZone - Dependency Property. 29

Steps to create Example 3 Timezone. 29

Here is the full code listing for Example 3 Timezone – Dependency Property. 30

XAML Listing: 32

Let’s Learn by Example 4:  Attached Properties. 35

Steps to create Example 4 Attached Properties. 35

Explanation of the code design. 38

Here is the full code listing of Example 4: 39

XAML: 39

Code Behind: 40

Let’s Learn by Example 5: Resource Dictionary. 42

Steps to create Example 5. 42

Explanation of the code design. 47

Here is the full code listing of Example 5 Resource Dictionary : 48

XAML MainWindow.xaml: 48

Resource Dictionaries Dictionary1.xaml: 48

Resource Dictionaries Dictionary2.xaml: 49

Code Behind  MainWindow.xaml.cs: 49

Data Binding. 51

Let’s Learn by Example 6: Bind Using Attribute Syntax. 51

Steps to create Example 6. 51

Explanation of the code design. 53

Here is the full code listing of Example 6 Binding using attribute syntax : 54

XAML MainWindow.xaml : 54

Code Behind MainWindow.xaml.cs: 54

Summary. 55

ContentControl 56

Let’s Learn By Example 7: ControlTemplate. 57

Steps to create Example 7. 57

Explanation of the code design. 57

Here is the full code listing of Example 7 ControlTemplate : 65

XAML MainWindow.xaml : 65

Code Behind MainWindow.xaml.cs: 68

Summary. 69

Events. 69

Let’s Learn by Example 8: Events. 70

Steps to create Example 8. 70

Explanation of the code design. 70

Here is the full code listing of Example 8 Events : 73

XAML MainWindow.xaml : 73

Code Behind MainWindow.xaml.cs: 74

Pack URI 75

Let’s Learn by Example 9: Pack URI 76

Steps to create Example 9. 76

Explanation of the code design. 79

Here is the full code listing of Example 9 PackURI project : 80

XAML MainWindow.xaml : 80

Code Behind MainWindow.xaml.cs: 81

Let’s Learn by Example 10: Create Custom Commands. 82

Steps to create Example 10. 82

Explanation of the code design. 83

Here is the full code listing of Example 10 Create Custom Command project : 86

XAML MainWindow.xaml : 86

Code Behind MainWindow.xaml.cs: 87

Code Class WebBrowser.cs: 88

Let’s Learn By Example 11: MasterDetail l-LINQ-EF. 90

What is LINQ?. 90

What is Entity Framework?. 90

Steps to create Example 11. 90

Add the Northwind Database. 91

Add Entity Framework. 99

Full code listing with Explanation of the code design. 107

Code Behind MainWindow.xaml.cs: 107

XAML MainWindow.xaml : 109

App.Config. 114

Entity Framework Connection Strings. 114

Metadata. 115

Run the Application. 115

Let’s Learn by Example12-Drag and Drop DataGrid –EF. 118

Steps to create Example 12. 118

Add The Entity Data Model 118

Add New Data Source. 125

Use LINQ to Query Database. 128

Run the Application. 129

Full code listing in the WPFExample12-DragAndDropDataGridEF Project. 131

Code Behind MainWindow.xaml.cs: 131

MainWindow.xaml 132

App.Config. 134

App.xaml 134

Full Code Listings in the EFClassLibrary Project. 134

Class1.cs. 134

App.Config. 135

Summary. 137

About the Author. 138

Other Books by Author Stephen Thomas. 139

Telerik Rad Grid Control for ASP.NET AJAX by Full Example. 139

Installing Visual Studio 2012 on Windows 8 Step By Step. 139

How to Setup Your Verizon FIOS Static IP with Windows Server 2008 Step by Step. 139

Installing SQL Server 2012 Step By Step. 139

 


Introduction

This book will quickly show you (by full example) how to create fully functional WPF applications using C#, XML, Microsoft SQL Server 2008/2012, XAML, Visual Studio 2010 or 2012, LINQ, Entity Framework, and the DataGrid.  The examples in this book will include every single line of code that is required to execute.  No assumptions will be made.  The decision to write this book came from the need and frustration with finding real usable solutions.  The purpose of this book is to “Learn By Full Example”.  This is accomplished by eliminating lengthy useless explanations.  Most developers prefer to learn by coding and not by reading boring long and drawn out text.  If you need more details at any point, then refer to Microsoft's MSDN website.  There you will find all the Microsoft detailed references.   The goal is to save the next person from this same frustration.

Most real world .NET development projects do not allow a developer to click wizards and create an application, based on requirements, by the private or government sector.  In order to be a professional .NET developer in these situations one must be an expert with all aspects of code in WPF.  That is with the language you are programming, the declarative markup code, and the SQL language for the database.  One must also understand the definition of each of the property settings used for each user control.  In additional to the classes that defines each user control.  These are the prerequisites for becoming a successful professional .NET developer
WPF Basics

Windows Presentation Foundation is the newer .NET framework platform that in my opinion replaces Windows forms and the old Win32 API's with a visually rich and intuitive user and developer experience. 

Let's Get Started

By Identifying and briefly discussing the minimum assemblies required to create a Windows Presentation Foundation application.  The Managed WPF layer is a set of classes and types built using the .NET Framework that is managed by the CLR (Common Language Runtime). This Managed WPF Layer comprise of three assemblies.

Customer Reviews

Worth the money

"The title of the book says it all, "by Full Example." If you are looking for a very good introduction to WPF and want to walk away with great knowledge, this book is recommended. I almost did not buy because of one negative review, but I read more about it so I took the chance. Worth the money, enough said."

Constantin S., Elance Programmer