Pro Xaml with C#: From Design to Deployment on Wpf, Winrt and Windows Phone

This document was uploaded by one of our users. The uploader already confirmed that they had the permission to publish it. If you are author/publisher or own the copyright of this documents, please report to us by using this DMCA report form.

Simply click on the Download Book button.

Yes, Book downloads on Ebookily are 100% Free.

Sometimes the book is free on Amazon As well, so go ahead and hit "Search on Amazon"

XAML is Microsoft s presentation layer markup language. When first introduced as part of .NET 3.0, XAML allowed developers unprecedented control over the look and feel of their applications. But XAML today is much more than just a presentation language. Its powerful data binding functionality allows complete separation of concerns, so you can build multilayered applications with reusable components, bridging the worlds of .NET and WinRT and even Windows Phone while sharing and reusing the majority of your code. Pro XAML with C# shows you how. In Part I, Buddy James shows you how to approach and break down a business problem by systematically gathering requirements and user stories. You ll also be introduced to some of the conflicting needs and interests that you might encounter as an enterprise XAML developer working as part of a team. Part II then dives into code as you develop the shared core of a XAML-based application. You ll see how to take advantage of XAML s powerful dependency injection to design a single business logic layer that answers the requirements of your business problem. The author then demonstrates how to use test driven development (TDD) to build your data access layer and make it fully database-agnostic, with implementations shown in both SQL and RavenDB. Once your business and data layers are in place, you re ready to build the user interfaces. You ll see how to build a shared XAML UI core first, before Part III explores implementation details for each of Microsoft s XAML UIs in turn: desktop (WPF), Windows 8 (WinRT) and Windows Phone. The final chapter is devoted to deploying and maintaining your application. Packed with real, useable code and expert insights, Pro XAML with C# is the ideal book for professional developers working on the .NET platform and needing to deploy applications on WPF, WinRT, Windows Phone, or any combination of the three. What you'll learn Analyze a business problem and develop a solution within the sometimes conflicting interests of a real business team Use domain driven design to get maximum business value from your development efforts Develop applications in Visual Studio making best use of its integrated design and development views Use dependency injection to create loosely coupled components that can be reused easily Learn how to design and build one application with three front ends, on WPF, Windows and Windows Phone, with high code reuse and a shared business and data access layersImplement the popular MVVM design pattern using the Microsoft Prism library to decouple your user interface from your core domain logic Cover your code with unit tests to reduce bugs and validate your design Deploy and maintain your application across different devices Who this book is for Pro XAML with C# is for intermediate to experienced .NET developers. Readers should have experience working with C# and at least one XAML-based technology (WPF, Silverlight, WinRT or Windows Phone). "

Author(s): Buddy James
Publisher: Apress
Year: 2015

Language: English
Pages: 500

Contents at a Glance
Contents
About the Authors
About the Technical Reviewer
Acknowledgments
Introduction
Part I: Getting Started
Chapter 1: What Is XAML?
A Brief History of Windows User Interface Design
Extensible Application Markup Language
Separation of User Interface Concerns
Declarative vs. Imperative Programming
To Code-Behind or Not to Code-Behind?
The MVVM Design Pattern
Basic MVVM Implementation in WPF
Summary
Chapter 2: Software Craftsmanship
Software as an Art and a Science
SOLID Object-Oriented Design
To Unit Test or Not to Unit Test?
Test-Driven Development
Meet the Team
The Development Manager
The Business Analyst
The Junior Developer
The Guru
The DBA
The First Team Design Meeting
Scrum Agile Methodologies
How to “Talk the Talk” When It Comes to Gathering Requirements
User Stories and How to Create Them
The Anatomy of a Good User Story
Summary
Part II: Laying the Groundwork
Chapter 3: Domain-Driven Design
Introducing Domain-Driven Design
What Is Domain-Driven Design?
Before Domain-Driven Design
UML Hell and Stale “Requirements Documents”
Business User? Who’s That?
Ubiquitous Language
The Domain Model in Domain-Driven Design
The Source Code Is the Design Documentation
Domain Entities
Domain Aggregate Roots
Domain Value Objects
Domain Services
Domain Events
CQRS: Command Query Responsibility Segregation
Summary
Chapter 4: Design Patterns
Architecture Types
Layered Architecture
User Interface Layer
Presentation Layer
Service Layer
Domain Layer
Infrastructure Layer
Design Patterns Used Throughout the Book
The Repository Pattern
The Adapter Pattern
The MVVM Design Pattern
Basic MVVM Implementation in WPF
ICommand: The Cure for the Common Event Handler
Summary
Chapter 5: Unit Testing
Debugging Strategies
Defensive Programming
System Testing
Regression Testing
User Acceptance Testing
Unit Tests to the Rescue
Unit Testing Basics
Characteristics of a Great Unit Test
Automated Unit Test Execution
Unit Test Execution Speed
K.I.S.S. Your Unit Tests
All Team Members Should Be Able to Execute Unit Tests
Great Unit Tests Survive the Test of Time
Unit Test Fixtures
Unit Testing Frameworks
NUnit
Microsoft Unit Testing Project Template
Summary
Chapter 6: Advanced Unit Testing and Test-Driven Development
Test Fixtures Are Classes Too
Use Inheritance to Avoid Duplicate Code
Unit Testing Classes That Have Dependencies
Dealing with Dependencies
Repository Pattern
Stubs
Mock Objects
Using the Moq Framework
Using the Mock Class to Set Up Your Dependencies
Create an Instance of the Mock Class
Set Up the Behavior of the Mock Dependency Object
A Complete Example
Design by Testing: Test-Driven Development
Step 1: All Unit Tests Should Fail on the First Test Run
Step 2: Add Only Enough Code to Pass the Test and No More
Step 3: Tighten Up Your Code by Refactoring
Summary
Chapter 7: Exception Handling and Logging
Enterprise Library Exception Handling Application Block
Installing the Exception Handling Application Block
Installing the Enterprise Configuration Console
Configuring Policies, Exception Types, and Handlers
Policy
Exception Type
Handler
Wrap Handler
Replace Handler
Custom Exception Handler
Modifying the Code
Configuring the Logging Exception Handler
Categories
Special Categories
Logging Filters
Logging Target Listeners
Logging Message Formatters
Logging Options for Windows Device Apps
Visual Studio Application Insights
Summary
Part III: Completing the User Interface Layer
Chapter 8: The WPF User Interface
The Basics
Application Class
Windows, Pages, and User Controls
The Code-Behind File
First Look
XAML Designer
Container Controls
Content Property
Attached Properties
Layouts
Fixed vs. Dynamic Layouts
Managing Layouts with Container Controls
Canvas
DockPanel
Grid
StackPanel
TabControl
UniformGrid
WrapPanel
Margins and Padding
Resources and Styles
Resources
Static
Dynamic
Styles
Application-Level Styles
View-Level Styles
Container-Level Styles
Control-Level Styles
Data Binding
XAML Markup
ViewModel and INotifyPropertyChanged
DataContext
Dependency Properties
Summary
Chapter 9: The Windows Phone User Interface
The Basics
Windows Phone 8.1 SDK
Multiresolution Support
Scaling
Themes, Resources, and Styles
Background and Accent Colors
Theme Resources
Predefined Styles
Application Architecture
Page Orientation
Navigation
Navigation Helper
Page Navigation
Backward Navigation
Caching Pages
Templates
DataTemplate
ItemTemplate
Displaying Collections
ListView
GridView
Presentation Controls
Hub
Pivot
Application Bar
Summary
Chapter 10: The Windows User Interface
The Basics
Windows Software Development Kit
Developer License
Basic Design Principles
Gestures
Managing Layouts
Visual States
Storyboards and Animations
OnSizeChanged
Searching Data
Flyouts
The Basics
Usage and Syntax
Programmatic Display
Flyout Styles
FlyoutPresenter
MenuFlyoutPresenter
Contracts
Share Contract
Settings Contract
Summary
Chapter 11: Deploying and Maintaining Your Application
Version Control
The Basics
Choosing a Version Control System
Team Foundation Version Control
Git
Visual Studio 2013 Integration
Team Foundation Version Control
Continuous Integration
“ Johnny Broke the Build!”
Configure a CI Build
Queue a Build
Deploying WPF Applications Using ClickOnce
Publishing Apps to the Windows Store
Windows Dev Center
Registration
Application Submission
Windows Store
Packaging Your Windows Store App
Initiating App Submission
App Name
Selling Details
Services
Age Rating and Rating Certificates
Cryptography
Packages
Description
Notes to Testers
Submit App
Windows Phone
Summary
Index