hardcore wpf windows presentation foundation l.
Download
Skip this Video
Loading SlideShow in 5 Seconds..
Hardcore WPF (Windows Presentation Foundation) PowerPoint Presentation
Download Presentation
Hardcore WPF (Windows Presentation Foundation)

Loading in 2 Seconds...

play fullscreen
1 / 49

Hardcore WPF (Windows Presentation Foundation) - PowerPoint PPT Presentation


  • 614 Views
  • Uploaded on

Hardcore WPF (Windows Presentation Foundation) casey chesnut brains-N-brawn.com Madison .NET 11/06 Source Fundamental demos http://www.brains-n-brawn.com/artifacts/HardcoreWPF.zip /backRow demo http://www.brains-N-brawn.com/backRow/ Which of these would you like to see?

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'Hardcore WPF (Windows Presentation Foundation)' - issac


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
hardcore wpf windows presentation foundation

Hardcore WPF (Windows Presentation Foundation)

casey chesnut

brains-N-brawn.com

Madison .NET 11/06

source
Source
  • Fundamental demos
    • http://www.brains-n-brawn.com/artifacts/HardcoreWPF.zip
  • /backRow demo
    • http://www.brains-N-brawn.com/backRow/
brains n brawn com

Which of these would you like to see?

brains-N-brawn.com
  • Pervasive Computing
    • Tablet PC (MVP 03)
    • Compact Framework (MVP 04)
    • Advanced Web Services (MVP 05)
    • Media Center (MVP 06)
    • Speech
    • Location Based Services
    • Artificial Intelligence
    • 3D
outline
OUTLINE
  • Overview
  • Fundamentals – demos!
  • Application Models
  • /backRow demo!
slide6

Which of these have you worked with?

Now
  • GDI (20 years), GDI+, WinForms
  • DirectX (11 years), Direct3D
  • Quartz, DirectShow (8 years)
  • Problems
    • Showing their age
    • Each API is different
    • Mixing APIs is challenging
next gen
Next Gen
  • WPF – replaces GDI
  • Direct3D – large games, used by WPF
  • Media Foundation – ultimately will replace DirectShow
  • MCML –markup language for Media Center Edition applications
  • XNA – small games
slide8
WPF
  • Compositing
    • UI, Documents, Media, 3D, Browser, …
  • Declarative programming with XAML markup
  • For Designers and Developers
  • Rewritten from scratch
    • Built on top of Direct3D
    • Hardware accelerated
    • Vector based
    • Resolution independent (1/96 inch)
    • Retained graphics
platforms
Platforms
  • Vista
  • XP SP2
  • Server 2003 SP1
  • Renders the same on each
  • Remote Desktop transport
  • Subsets of WPF (XPS, WPF/E) will make it to other platforms
tiers
Tiers
  • Tier 2 – DirectX 9, Shader 2.0, 128 megs video ram (hardware rendering)
  • Tier 1 – DirectX 7, 32 megs video ram (mixed hw/sw rendering)
  • Tier 0 – below (software rendering)
  • Defaults to 60 fps
  • Anti-aliasing
timeline
Timeline
  • Pillar of .NET 3.0
    • Class libraries built on .NET 2.0
    • WPF, WCF, WF, InfoCard
    • Past Release Candidate
    • Go-live licenses available
  • Released with Vista
  • “Orcas”, .NET 3.X coming after that
installation
Installation
  • Visual Studio 2005
  • .NET 3.0 (pre-installed with Vista)
    • Runtime
  • Windows SDK
    • MSBuild, XAMLPad, samples
  • Orcas extension for VS 2005
    • Visual designer, schemas, project templates
tools

XAMLPad

Microsoft Expression Interactive Designer

Tools
  • Windows SDK
    • XAMLPad, Perforator, UISpy, XPS Conformance, WICExplorer
  • VS 2005
    • Orcas Extensions (beta)
  • Electric Rain Zam 3D
  • Mobiform Aurora
  • Microsoft Expression
    • Graphics Designer
    • Interactive Designer
  • “Orcas”, Cider
outline fundamentals
OUTLINE : Fundamentals
  • XAML, Application, Navigation, Layout, Content, Data Binding, Dependency Property, Styles, Templates, Controls, Events, Shapes, Documents, Imaging, BitmapEffects, Animation, Media, Brushes, 3D
slide16

HelloWorldXamlPage

HelloWorldCodePage

XAML
  • Declarative object instantiation
  • Not exclusive to WPF
  • Separates UI and logic
    • Common language for Designers and Developers
    • Parallel development
    • Localization, Branding
    • Targeted UI (devices, users, …)
  • Tool support
  • Supports C# and VB.NET
application

VS.NET WPF app from scratch

DragDrop Cider controls from Toolbox

Application
  • Global
  • Message handling
  • App events (e.g. startup, shutdown)
  • NavigationService
  • Properties collection
  • StartupUri
slide18

XamlSyntax

XAML
  • Object elements, Attribute syntax
  • Property elements, Abbreviated syntax
  • Content syntax
  • Attached properties, Attached events
  • Markup extensions
    • Binding syntax, Resource syntax
  • Xml Namespaces
  • Code-behind vs Inline vs Code-only
window

MainWindowTransparency

Window
  • Window
  • NavigationWindow
  • Page
navigation

http://localhost/PageNavigation/PageNavigation.xbap

Navigation
  • NavigationWindow and Frame
  • Hyperlink
  • NavigationService
  • URI, fragment support
  • Events
  • Journal
  • PageFunctions
events
Events
  • RoutedEvents
    • Tunneling (Preview*) and Bubbling
  • ElementTree
  • Stylus support for Tablet PCs
  • Attach handler in XAML or Code
  • Styles/Templates can handle events
  • Bind to element with Name or x:Name
layout

PanelLayout

Layout
  • Dynamic sizing and positioning
  • Panels are key
    • Grid, StackPanel, DockPanel, WrapPanel, Canvas, …
  • Alignment
    • Stretch (Size to container)
    • Left, Right, Center (Size to content)
  • Margin (parent) and Padding (content)
  • Overflow
    • Clip, Wrap, Scroll, Scale
content

ToolTip

Content
  • Rich Content
    • ContentControl
    • HeaderedContentControl
    • ItemsControl
    • HeaderedItemsControl
interop

InteropWinForm

Interop
  • HwndSource, HwndHost
  • Interops with WinForms, Win32, DirectX, …
  • ActiveX interop is through WinForms interop
  • Cannot share airspace, so compositing will not work
data binding

TwoWayBinding

Data Binding
  • Data models : XML, Objects, DataSets, WCF, LINQ, …
  • Binding syntax
  • DependencyProperty
  • DataContext, DataTemplate
  • INotifyPropertyChanged, INotifyCollectionChanged
  • Modes : OneTime, OneWay, TwoWay, OneWayToSource
dependencyproperty
DependencyProperty
  • Value depends on some other property
    • User for DataBinding, Styles, Animation, …
  • Validation
  • Inheritance
  • AttachedProperties
  • Default values
styles

StyledButton

Styles
  • Similar to CSS
  • Resources
  • Setters
  • Triggers
  • Inheritance
  • … Templates
  • … Animation
templates

TemplateButton

Templates
  • Controls are built based on their functionality
  • The default template can be changed to radically change how the control renders
  • The goal is to avoid having to create user drawn controls
controls

VS.NET Toolbox

Controls
  • Comes with a set of standard set of common controls for UI
  • UserControl
    • Simple reusable control
    • Similar to application development
  • Control
    • Provides templating
    • For reuse between many applications
shapes

Shapes

Shapes
  • 2D Geometric Shapes
    • Ellipse
    • Line
    • Path
    • Polygon
    • Polyline
    • Rectangle
documents

FlowDocument

File – Print - XPS

Documents
  • Flow vs Fixed (XPS)
  • Packaging
  • Document viewing
  • Typography
    • ClearType
    • OpenFont
    • Font can be deployed with an Application
  • Printing
  • Annotating
imaging

Imaging

Imaging
  • BMP, JPEG, PNG, TIFF, WDP, GIF, ICON
  • BitmapFrame
  • Rotation
  • Image, BitmapImage for XAML
  • CroppedBitamp, FormatConvertedBitmap
  • Clipping
  • Stretching
  • Metadata
bitmapeffect

BitmapEffect

BitmapEffect
  • Applied to Visuals
  • Can be chained
  • Blur
  • OuterGlow
  • DropShadow
  • Bevel
  • Emboss
animation

AnimatedButton

Animation
  • Dependency Properties
  • Animation Types : Double, Color, String, Point, Int32, Path, …
  • Targets : From, To, By
  • Time based : duration, repetition, start times, …
  • Storyboards : pausing, stopping, resume
  • Key-Frame support
media

MediaInk

Media
  • Audio
  • Video
brushes

Brushes

Brushes
  • SolidColorBrush
  • Gradients
    • LinearGradientBrush
    • RadialGradientBrush
  • ImageBrush
  • DrawingBrush – vector and bitmap
  • VisualBrush – any Visual!
slide37

ThreeD

3D
  • Basic 3D Support
  • Viewport3D
  • Cameras
  • Models
  • Materials
  • Lights
  • Transforms
  • Hit Testing
  • Animations
outline app models
OUTLINE : App Models
  • Loose XAML
  • Windows Application
  • XBAP / WBA
  • WPF/E
  • XPS
loose xaml
Loose XAML
  • XAML without any code
  • Opens in IE
  • Can be dynamically generated
applications
Applications
  • Windows application
  • EXE with a Window or NavigationWindow
  • Installed
  • Offline and Online
  • Full access
xbap wba
XBAP / WBA
  • Hosted in a browser, IE6 and above
    • Other browsers, FireFox with a plugin
  • Online only
  • Internet zone permissions
  • Embed in webpage using IFrame
    • Cannot interact with hosting page
  • Media Center, Sidebar Gadgets
wpf e
WPF/E
  • Multiple browsers
    • Browsers IE5.5+, Mozilla, Firefox, Opera, Safari
  • Multiple platforms
    • MS : Win2K+, MAC OS X 10
    • 3rd party : Linux, Solaris
  • Multiple devices
    • Desktop, PPC, SP
wpf e43
WPF/E
  • Subset of WPF e.g. no 3D
  • Shooting for 2 meg runtime install
  • Object tag for embedding in HTML
  • WPF + JScript, IL
  • Public beta bits are late (Q3 06), browser release (1st half 07), device support (2nd half 07)
slide44
XPS
  • XML Paper Specification
  • Subset of WPF
  • Fixed immutable layout
  • Zip format with resources
  • Viewers can be ported to other platforms
    • Open package specification
    • XPS
  • Vista printer spool format
outline backrow demo
OUTLINE : /backRow Demo
  • brains-N-brawn.com/backRow/
resources
Resources
  • Books
    • Applications = Code + Markup
    • Programming Windows Presentation Foundation
    • XAML in a Nutshell
  • Forum

Windows Presentation Foundation ("Avalon“)

  • Newsgroup

microsoft.public.windows.developer.winfx.avalon

resources47
Resources
  • Webcasts

http://sessions.mix06.com

  • eLearning

Developing Rich Experiences with Microsoft® .NET Framework 3.0 and Visual Studio® 2005

  • Samples

C:\Program Files\Microsoft\SDKs\Windows\v6.0\Samples\WPFSamples.zip

resources48
Resources
  • Sites
    • http://wpf.netfx3.com/
    • WPF Windows SDK Documentation
    • My Five Day Course For Hitting the WPF Curve/Cliff
    • www.brains-N-brawn.com/backRow/