WPF in 60 Seconds So Much WPF - So Little Time Acing the WPF Interview ;)

Slides:



Advertisements
Similar presentations
Module 1: Creating an Application by Using Windows Presentation Foundation Overview of WPF Creating a Simple WPF Application Handling Events and Commands.
Advertisements

Expression Blend 4 – deep dive
Introduction to Windows Presentation Foundation (WPF) Dr. Frank McCown COMP 445 – GUI Programming.
Data Binding in GUI Application Development Patrick O’Brien.
Dinko Jakovljević Microsoft Student Partner | BambooLab
An Introduction To Silverlight Gergely Orosz
So Much WPF - So Little Time Acing the WPF Interview ;)
WPF MVVM Training Michael Sync (Silverlight MVP).
Real world Windows Phone development Igor
Building Silverlight Applications Using the MVVM pattern An Introduction by Peter Messenger Senior Developer – Qmastor
Aptech Borivali(West) Hefin Dsouza. Agenda  What is.NET and What is Visual Studio? .NET Framework 3.5 Overview.  Visual Studio 2008 Enhancements. 
WPF For PowerBuilder Developers
Robert Vitolo CS430.  CSS (Cascading Style Sheets)  Purpose: To provide a consistent look and feel for a set of web pages To make it easy to update.
READING, WRITING, BINDING, VALIDATING AND VISUALISING YOUR DATA Business value with Silverlight.
.NET Database Technologies: Introduction to WPF and Entity Framework DataBinding.
Introduction to Silverlight By Alan Cobb 2008-Jan-10 Sacramento, CA
NOTE: To change the image on this slide, select the picture and delete it. Then click the Pictures icon in the placeholder to insert your own image. WEB.
Overview of Previous Lesson(s) Over View  ASP.NET Pages  Modular in nature and divided into the core sections  Page directives  Code Section  Page.
Rujchai Ung-arunyawee Department of Computer Engineering Khon Kaen University.
Lesley Bross, August 29, 2010 ArcGIS 10 add-in glossary.
A Jumpstart to WPF by Kevin Grossnicklaus ArchitectNow.
1 Intro XAML Attribute syntax & property syntax Panels Reusable resources Controls Data binding Steen Jensen, spring 2014.
V 1.1 Programming III. GUI APIs WPF Hello World Important UI elements UI elements / content models UI elements / inheritance.
Windows Presentation Foundation. Agenda Introduction Developing Applications WPF and WF interoperability Custom Controls Styles and Templates Data Binding.
Windows Presentation Foundation Adam Calderon Principal Engineer Interknowlogy LLC
Silverlight Technology. Table of Contents 1.What is Silverlight Technology? 2.Silverlight Overview. 2.1 How it works 2.2 Silverlight development tools.
Understand what kind of applications Windows Presentation Foundation can deliver See how Visual Studio 2008 & Microsoft Expression Blend work together.
V 1.0 Programming III. Automatic notifications (…Changed, INofityPropertyChanged, ObservableCollection ) Data formatters Data conversions Resources.
LAYOUT CONTROLS. XAML Overview XAML : eXtensible Application Markup Language pronounced (ZAMEL) is a markup language used to design user interfaces XML-based.
Object Oriented Software Development 9. Creating Graphical User Interfaces.
Windows Presentation Foundation Maximilian Knor Developer Evangelist Developer and Plattform Group Microsoft Österreich
New Features Overview. Agenda Silverlight - Intro Silverlight 3 New Features Overview with Demos, Demos and Demos… RIA Services Overview Demos, Demos,
Adam Calderon – C# MVP Application Development Practice Lead Interknowlogy.
Windows Presentation Foundation (WPF). Introduction Separates appearance of user interface from behavior Appearance usually specified by XAML Behavior.
Last Lecture objective C memory management rules Wrote our first iPhone app a quiz app xib and nib files and interface editor MVC pattern IBOutlet IBAction.
Rujchai Ung-arunyawee Department of Computer Engineering Khon Kaen University.
Module 3 Designing and Developing a User Interface.
Windows 10 UWP MVVM In Depth
1 Catching up on Rich Clients (round 1) Mike Ormond, Mike Taulty Developer & Platform Group Microsoft Ltd
Module 4 Taking Control of the User Interface. Module Overview Sharing Logical Resources in an Application Creating Consistent User Interfaces by Using.
04 |Sharing Code Between Windows 8 and Windows Phone 8 in Visual Studio Ben Riga
V 1.0 Programming III. XAML Data Binding I.. V 1.0ÓE-NIK, 2014 XAML namespaces Namespaces define the allowed tags and attributes The one without the prefix.
Model View ViewModel Architecture. MVVM Architecture components.
Design To Blend Dale G. Jones Director of Creative Design IdentityMine, Inc.
Windows 8 apps and the MVVM pattern SILVERLIGHTSHOW.NET WEBINARS SERIES GILL CLEEREN, October 16 th
Programming with MVVM Miguel A. Castro Architect -
Part of the Microsoft.NET Framework 3.0 Tomer Shamam.NET Technologies Expert Sela Group
Adam Schultz MVVM and WPF. MVVM Model, View, ViewModel A software architecture designed to separate out User Interface design, Business Logic, and Data.
Introduction to Silverlight Development Pavel Yosifovich CTO, Matrix Global; Senior Instructor, Hi-Tech College
In Windows 8 Store Applications
Real world Windows Phone development
Windows Presentation Foundation
DotNetSpider Editor Hefin Dsouza
9/4/2018 5:28 PM © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
Build Windows 10 UWP MVVM Apps with Prism
Jim Fawcett CSE775 – Distributed Objects Spring 2011
XAML User Interface Creation in C#
03 | Building Windows Store Apps with XAML Part 3
WPF AKEEL AHMED.
.NET and .NET Core 7. XAML Pan Wuming 2017.
Windows Presentation Foundation
Silverlight Technology
An introduction to MVVM using WPF NISCHAL S
MIX 09 12/8/2018 4:33 PM © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
04 | UI Presentation & XAML
Web Development Using ASP .NET
Tech Ed North America /6/2019 2:07 PM Required Slide
An Introduction to the Model-View-ViewModel Pattern
Brown Bag Seminar Summer 2007
Presentation transcript:

WPF in 60 Seconds So Much WPF - So Little Time Acing the WPF Interview ;)

Overview Windows Presentation Foundation

Purpose Cover all the topics Give an idea of what you can do “oh yea, I’ve seen that” Don’t stress on learning any of it Hopefully create a useful resource

What is WPF MS latest greatest Desktop UI Framework GUIs in.Net Best of Web, Patterns, and Previous UI Frameworks UI Framework Released in.Net 3.0 (Nov 2006)

Helpful Background.Net Used a control based UI Framework o VB6 o Windows Forms o ASP.Net o etc. Familiar with HTML or XML

Why is WPF Great Visual Flexibility, Quick Results, Great Features Auto Sizing, Auto Positioning Layout Templating Styles: similar in concept to CSS: allow skinning Convenient (once you get the hang of it) Feature Rich Binding Triggers, Animation Property Inheritance Attached Properties Bubbling & Tunneling Events XAML is like HTML: its easy to create UIs visually and in markup Rich UI Control: positioning, gradients, layering/opacity, etc. Compositional Controls: (pictures in buttons, buttons in lists, no problem, lists in buttons, with pictures, etc.)

WPF Vs. Silverlight More features Fewer restrictions No band-aids or black holes Desktop Only Devblog.Ailon.Org

Tools Visual Studio (2008, 2010) Expression Blend (3/4) ReSharper (auto adds references +++) Snoop (WPF/free) Silverlight Spy (paid)

Core WPF

Structure of a WPF App Create with VS New WPF Application App.XAML o StartupUri="Window1.xaml" o Resources o Subclass of Windows.Application Window1.xaml o ctor: InitializeComponent(); o Subclass of Windows.Window

XAML All roads in WPF lead to XAML Specialized XML Creates Visuals like HTML Controls Control Templates Extensions for binding Resource Dictionaries Bindings normally defined here Compiles to BAML

Controls Panels - Multiple Children Canvas Grid StackPanel DockPanel Wrap Panel UniformGrid VirtualizingPanel VirtualizingStackPanel Controls ItemsControl "Single" Child Control Button CheckBox Radio Button ToggleButton WPF Toolkit - CodePlex out of band releases

Grid Common lightweight layout container Column Width –Auto: fit to contents –*: take up the rest of the space –#*: proportional spacing

Dependency Object / Property DO's have DP's Dependency Objects / Controls For Binding Target in Controls INotifyPropertyChanged is code lighter for source binding in VMs For Event Routing and Property Inheritance

UI Features Gradients Geometries Lines CornerRadius Transparency Overlap (xaml order, z-order) Rotation Resize Alignment: Left, Right, Top, Bottom, Stretch Vector Graphics – resize looks great

MVVM (P) Preferred Pattern for XAML apps (builds on MVP, MVC, XYZ) Enhances testability, separation of concerns Controls are generally not named to favor binding MVP style is often used when needing to reference controls in code -- either publish a method on an interface of the view or make a control visible to code via a property. Prime example XamDataGrid that has specific loading API that can't be bound

MVVM Details Presenter ViewModel View –DataContext –Dispatcher

Binding Cheat Sheet DataContext ItemsSource Scenarios Direct Element Ancestor Multi-Level (target.element.element) Requriements For Handling Updates INotify (ObservableCollection) DependencyObject Binding Failure "Helpfully" doesn't crash your app or throw exception See Results in the Output Window Or it can truly fail silently: ex: mismatched IList type will set null FallbackValue -- rarely used

Resource Dictionary x:Name x:Key StaticResource DynamicResource ResourceDictionary.MergedDictionaries Control.Resources Scoping, Cascade Effect

Advanced Binding Fallback Value PriorityBinding Design Time ViewModel

Styles (are not Templates) Though they can be skins.

Templates DataTemplate ItemTemplate ControlTemplate Template Selectors vs. DataTemplates

Context UserControl – set datacontext of sub-element to UserControl (essentially code behind) Template – uses instance binding View – uses ViewModel because UserControl DataContext will be set to VM

Triggers DataTriggers Property Triggers Event Triggers Multi-Triggers

Converters Change VM data into UI friendly ex: rename row 0 to row 1 casing Can work as Template Selectors Color Coders etc. CodePlex IValueConverter IMultiValueConverter Need to put in Resource Dictionary Ex:

Commanding - Making it Go

More Topics

Data Validation IDataErrorInfo Requires annoyingly verbose binding syntax, but otherwise quite serviceable

Logical and Visual Trees Snoop

Threading Important, but rarely an issue Dispatcher Task RX

Animations DoubleAnimation: change a double value –Duration –RepeatBehavior

Prism & Unity

PrismPrism / Unity: Composite Apps Composite Application Guidance for WPF and Silverlight Regions Event Aggregator Catalog (IoC): Unity Also: logging interfacelogging Microsoft.Practices.ServiceLocation.dll. This assembly contains the Common Service Locator interface used by the Composite Application Guidance to provide an abstraction over Inversion of Control containers and service locators; therefore, you can change the container implementation with ease.

Composite Bootstrapper WPF Hands-On Lab: Getting Started with the Composite Application Library Shell.XAML Regions: o ContentControl or ItemsControl o Selector/TabControl Bootstrapper o CreateShell o GetModuleCatalog App.OnStartup

Prism Module Module: C# Class Library Module: IModule o Initialize Views o each application UI piece is usually a UserControl Populate Catalog with Modules o o From code  most straightforward  possibly most common o o From a XAML file o From a Configuration file o From a Directory

Regions Specified in XAML and IModules RegionManager Injected in Module Ctor o DemoModule(IRegionManager regionManager) Initialize sets regions o _regionManager.RegisterViewWithRegion("MainRegion ", typeof(Views.HelloWorldView));

Presenters, VMs, Base Classes, etc. IModule.Initialize –Register type mappings – supports mocking view, vm –Create Presenter and register view into region: _regionManager.Regions[Regions.MainRegion].Add( _container.Resolve ().View ); Base interfaces and classes in WPF60.Infrastructure.CabSupport