Windows Presentation Foundation 4.5 Cookbook


Windows Presentation Foundation 4.5 Cookbook
eBook: $35.99
Formats: PDF, PacktLib, ePub and Mobi formats
$9.99
save 72%!
Print + free eBook + free PacktLib access to the book: $95.98    Print cover: $59.99
$59.99
save 37%!
Free Shipping!
UK, US, Europe and selected countries in Asia.
Also available on:
Overview
Table of Contents
Author
Support
Sample Chapters
  • Full of illustrations, diagrams, and tips with clear step-by-step instructions and real world examples
  • Gain a strong foundation of WPF features and patterns
  • Leverage the MVVM pattern to build decoupled, maintainable apps

Book Details

Language : English
Paperback : 464 pages [ 235mm x 191mm ]
Release Date : September 2012
ISBN : 184968622X
ISBN 13 : 9781849686228
Author(s) : Pavel Yosifovich
Topics and Technologies : All Books, Application Development, Cookbooks, Enterprise, Microsoft

Table of Contents

Preface
Chapter 1: Foundations
Chapter 2: Resources
Chapter 3: Layout and Panels
Chapter 4: Using Standard Controls
Chapter 5: Application and Windows
Chapter 6: Data Binding
Chapter 7: Commands and MVVM
Chapter 8: Styles, Triggers, and Control Templates
Chapter 9: Graphics and Animation
Chapter 10: Custom Elements
Chapter 11: Threading
Index
  • Chapter 1: Foundations
    • Introduction
    • Creating custom type instances in XAML
    • Creating a dependency property
    • Using an attached property
    • Creating an attached property
    • Accessing a static property from XAML
    • Creating a custom markup extension
    • Handling routed events
    • Chapter 2: Resources
      • Introduction
      • Using logical resources
      • Dynamically binding to a logical resource
      • Using user-selected colors and fonts
      • Using binary resources
      • Accessing binary resources in code
      • Accessing binary resources from another assembly
      • Managing logical resources
      • Chapter 3: Layout and Panels
        • Introduction
        • Creating a table-like user interface
        • Dynamically sizing grid rows/columns
        • Creating a scrollable user interface
        • Creating a border around panels and elements
        • Placing elements in exact positions
        • Adding/removing elements to a panel dynamically
        • Creating a tabbed user interface
        • Implementing drag-and-drop
        • Chapter 4: Using Standard Controls
          • Introduction
          • Working with text
          • Using content controls
          • Displaying images
          • Creating tooltips
          • Creating a list of items
          • Creating a standard menu
          • Creating a context menu
          • Selecting options with checkboxes and radio buttons
          • Manipulating tab order and focus
          • Chapter 5: Application and Windows
            • Introduction
            • Creating a window
            • Creating a dialog box
            • Using the common dialog boxes
            • Creating ownership between windows
            • Creating a custom shaped window
            • Creating a single instance application
            • Handling an unhandled exception
            • Chapter 6: Data Binding
              • Introduction
              • Element to element binding
              • Binding to a single object
              • Binding to a collection
              • Using data templates
              • Using value converters
              • Creating a master-detail view
              • Sorting and filtering bound collections
              • Grouping bound collections
              • Binding to multiple properties
              • Binding hierarchical data to a TreeView
              • Presenting data in a grid
              • Validating data
              • Chapter 7: Commands and MVVM
                • Introduction
                • Using routed commands
                • Implementing a basic MVVM application
                • Building a simple MVVM framework
                • Building a complete MVVM style application
                • Creating an undo/redo system
                • Chapter 8: Styles, Triggers, and Control Templates
                  • Introduction
                  • Creating and using styles
                  • Applying a style automatically
                  • Creating a property trigger
                  • Using data triggers
                  • Creating an event trigger
                  • Creating a multi trigger
                  • Using behaviors
                  • Replacing the control template of a progress bar
                  • Replacing the control template of a scroll bar
                  • Customizing selection in a Selector control
                  • Chapter 9: Graphics and Animation
                    • Introduction
                    • Creating a custom shape
                    • Applying transforms on elements
                    • Manipulating a bitmap programmatically
                    • Creating adorners
                    • Creating property-based animations
                    • Creating path-based animations
                    • Creating custom animations
                    • Adding animation easing to animations
                    • Using custom effects with pixel shaders
                    • Chapter 10: Custom Elements
                      • Introduction
                      • Creating a user control
                      • Handling standard commands in a user control
                      • Creating a custom (templated) control
                      • Customizing a default template of custom control
                      • Creating a custom panel
                      • Creating a lightweight custom element
                      • Chapter 11: Threading
                        • Introduction
                        • Updating the UI from a non-UI thread
                        • Adding cancelation support
                        • Using the BackgroundWorker component
                        • Adding cancelation and progress with BackgroundWorker
                        • Using a timer to do periodic updates
                        • Using C# 5.0 to perform asynchronous operations

                        Pavel Yosifovich

                        Pavel Yosifovich is the CTO of CodeValue (http://www.codevalue.net), a software development, consulting, and training company, based in Israel. He writes, develops, consults, and trains developers on various software development topics, from Windows internals to .NET enterprise systems, and almost everything in between. He's a Microsoft MVP and a frequent speaker at national events. In the past, he co-founded the startup company Quiksee that was acquired by Google in September 2010.
                        Sorry, we don't have any reviews for this title yet.

                        Code Downloads

                        Download the code and support files for this book.


                        Submit Errata

                        Please let us know if you have found any errors not listed on this list by completing our errata submission form. Our editors will check them and add them to this list. Thank you.


                        Errata

                        - 4 submitted: last submission 10 Jun 2014

                        Errata type: Technical    Page No: 8

                        The definition of the abbreviation XAML should be:
                        eXtensible Application Markup Language

                        Errata Type: Graphics | Page No. 26


                        Errata type: Technical   Page No: 28

                        If the button is disabled (IsEnabled set to true), the tool tip does not appear at runtime.

                        should be:

                        If the button is disabled (IsEnabled set to false), the tool tip does not appear at runtime.

                        Errata type: Typo   Page No: 177

                        Source expects some object, but as bindings are mostly expressed in XAML,  Source must be something that
                        the XAML parses can see at XAML parsing time.


                        Should be


                        Source expects some object, but as bindings are mostly expressed in XAML,  Source must be something that
                        the XAML parser can see at XAML parsing time.

                        Errata type: Technical   Page No: 87

                        Note the attached property Grid.IsSharedSizeScope is set to  true on a common
                        parent of all involved Grid instances (the  ListBox is an obvious choice) and the
                        SharedSizeGroup property of RowDefinition is set to some string ("abc").

                        Should be:

                        Note the attached property Grid.IsSharedSizeScope is set to  true on a common
                        parent of all involved Grid instances (the ListBox is an obvious choice) and the
                        SharedSizeGroup property of ColumnDefinition is set to some string ("abc").

                        Sample chapters

                        You can view our sample chapters and prefaces of this title on PacktLib or download sample chapters in PDF format.

                        Frequently bought together

                        Windows Presentation Foundation 4.5 Cookbook +    SQL Server Analysis Services 2012 Cube Development Cookbook =
                        50% Off
                        the second eBook
                        Price for both: £31.05

                        Buy both these recommended eBooks together and get 50% off the cheapest eBook.

                        What you will learn from this book

                        • Get tips and insights to maximize your productivity
                        • Learn to build complex and flexible user interfaces using XAML
                        • Perform lengthy operations asynchronously while keeping the UI responsive
                        • Get well-versed with WPF features such as data binding, layout, resources, templates, and styles
                        • Customize a control’s template to alter appearance but preserve behaviour

                        In Detail

                        Windows Presentation Foundation (WPF) provides developers with a unified programming model for building rich Windows smart client user experiences that incorporate UI, media, and documents.

                        WPF has become the leading technology for developing rich client applications on the Windows platform, packed with features and capabilities. However, WPF is big; in fact, it’s huge, causing a steep learning curve for the beginner and even for those already using some WPF features.

                        Windows Presentation Foundation 4.5 Cookbook provides clear recipes for common WPF tasks. It includes detailed explanations and code examples for customizing and enhancing the basic scenarios, while gaining a deep understanding of WPF mechanics and capabilities.

                        WPF is different and requires a different mind-set and approach. This book provides recipes and insights not only in its design but also its practical implementation details.

                        Starting from the foundations of WPF, such as dependency properties and XAML, the book touches on all major WPF aspects, such as controls and layout, resources, and digs deep into its unprecedented data binding capabilities.

                        The book shows data and control templates in action, which allow full customizations of displayed data and controls in a declarative way. Supported by styles and resources makes data binding all the more powerful. The Model View View-Model pattern is presented as an effective way of maximizing decoupling of components, while providing an elegant way of expanding applications while maintaining a tight grip on complexity.

                        The later parts discuss custom elements and controls – the ultimate customization mechanism, and looks at multithreading issues, and how .NET 4.5 task parallelism features can enhance application performance.

                        Approach

                        This book is written in an easy-to-read style, with a strong emphasis on real-world, practical examples. Step-by-step explanations are provided for performing important tasks.

                        Who this book is for

                        If you are C# developer looking forward to increasing your understanding and knowledge of WPF, then this is the best guide for you. Basic experience with Visual Studio 2010 is mandatory, as well as good C# skills. Previous experience with Windows Forms is not required.

                        Code Download and Errata
                        Packt Anytime, Anywhere
                        Register Books
                        Print Upgrades
                        eBook Downloads
                        Video Support
                        Contact Us
                        Awards Voting Nominations Previous Winners
                        Judges Open Source CMS Hall Of Fame CMS Most Promising Open Source Project Open Source E-Commerce Applications Open Source JavaScript Library Open Source Graphics Software
                        Resources
                        Open Source CMS Hall Of Fame CMS Most Promising Open Source Project Open Source E-Commerce Applications Open Source JavaScript Library Open Source Graphics Software