SlideShare a Scribd company logo
1 of 51
Josh Jacobson         Eric Burke
Sr. Product Manager   Sr. Technical Yahoo!
Yahoo!                Yahoo!
Today                 Wednesday 10 am

 Why is Yahoo! Here?        Frog Design + Yahoo!
        Demo
WPF Secrets REVEALED!   Designer / Developer Workflow
         Q&A               Sketches & Prototypes
Windows Vista
Windows XP




                 Mac OS X




                                                Others…
             Messenger Client Platform



              Yahoo! Client Platform
Pre-release
Eric Burke
Sr. Technical Yahoo!
In the trenches with WPF every day.
Getting started with WPF
Application Model
Developer-Designer workflow
Window.AllowsTransparency: friend or foe?
UserControls are (usually) good!
What’s wrong with my ListBox?
But i have all this existing C++ code…
Data Binding
Other tidbits
Make heavy use of forums, blogs, etc. Provide small
repro code if possible!
Expect to do heavy refactoring of your work for a good 3-
6 months or more
Write a photo viewer, RSS reader, and/or a sidebar with
widgets
Use everything in the SDK at least once
Remember: this is 1.0 software!
Code first, XAML later
 Understand what’s going on under the hood
 Look in obj/ for files with the “.g.cs” extension
 Petzold’s book (Applications = Code + Markup) teaches code
 first – excellent read
 Rob Relyea (MSFT, http://rrelyea.spaces.live.com/) is writing
 a XAML-to-Code converter
Model
owned by developer
app logic
                   ViewModel
raw data sources
                   owned by developer
unmanaged code
                   heavy input from designer
C#, C++, etc.
                   transform/augment data
                   used mainly to support
                   bindings in UI
                                               View
                                               owned by designer
                    mostly in C#
                                               contains the UI
                                               mostly in XAML
Dev: build first cut of app



Design: apply styling using tools and
                                               Design: build prototypes
   request ViewModel changes



                      Dev: implement ViewModel changes
                            and integrate prototypes
Get designers using Blend
 Designers (generally) don’t want to write XAML by hand – too
 slow
 For optimal workflow, make sure your project always loads in
 Blend
 Factor if necessary using UserControls and helper projects
Windows XP:
                                    draw directly
                                     to screen
WPF Rendering:
                     Render using
AllowsTransparency
                       DirectX
      =“False”
                       Pipeline
                                    Windows Vista:
                                    draw to a shared
                                        surface
                                    managed by the
                                         DWM
Call
  WPF Rendering:
                      UpdateLayered
AllowsTransparency
                      Window() with a
=“True” on Windows
                           DC
         XP




       Oh, no!        Fall back to
 IDirect3DSurface::
                        software
   GetDC() fails if
                       rendering
   alpha channel!
Hooray!
  WPF Rendering:
                     IDirect3DSurface::
AllowsTransparency
                     GetDC() works with
=“True” on Windows
                      alpha channels;
       Vista
                       render with h/w




  Oh, no! GDI is     Must move bits from
    software          video memory to
                     main memory (can
   emulated on
                       be sloooooow)
      Vista!
Conclusions
 on XP, complex scenes hurt performance
 on Vista, slower system bus and large windows hurt
 performance (“large” may not be as big as you think!)
Workarounds
 Opaque window with custom HRGN
 Overlapped “owned” windows to create illusion of a
 nonrectangular window
 [added advantage: better Maximize behavior]
 Use Popup class
  Caveat: always on top
  Caveat: forces itself to stay onscreen
Problem: XAML file size gets unwieldy FAST
 Hard to maintain the code
 Hard to find what you need
 Tools can’t handle crazy file sizes

UserControl is a custom “black box”
 Different than a custom Control
 Used for specific purpose in the given project
Faster time-to-build
 Componentization means UI can be laid out top-down with
 placeholders
 Can live in a separate project
 Smaller, so tools can handle them more easily
 Makes iterating and testing far easier
 Makes life easier on designers!
Often ItemsControls (e.g., ListBox) will have many more
items than can be displayed
Virtualization: creating physical representation for only
the visible items
Default behavior of ItemsControl uses
VirtualizingStackPanel
As list is scrolled, items coming into view get created;
items which are no longer in view get destroyed and
collected
Problem #1: using a non-virtualized ItemsPanel
 e.g., WrapPanel, Grid, etc.
 Currently, .NET framework includes only
 VirtualizingStackPanel

Solution: write a custom VirtualizingPanel as the
ItemsPanel
 Dan Crevier (MSFT, http://blogs.msdn.com/dancre/) has a
 great example of a VirtualizingTilePanel
Problem #2: grouping data using CollectionViewSource
 View treats each Group as one item
 ItemsControl has no knowledge of Group’s contents


Solution: custom CollectionView subclass
 Replace default ListCollectionView
 Custom View plays nice with virtualization
 Not a trivial exercise, but gives you better control
Legacy C++ code

Cross-platform C++ code

Functionality not in WPF (e.g., GetCursorPos)

Want to leverage WPF in your WinForms app, or vice-
versa

Use existing non-WPF third-party controls
AKA “Managed C++” – .NET and C++ in same DLL

Exposes .NET classes to the app

App can subclass or bind directly to these classes

Communicates with underlying unmanaged code

Example: Yahoo! Messenger core components
Call C++ library functions from .NET
  DIBs, window
  regions, DWM, ShellExecute, Set/GetWindowLong

Legacy C++ libs

Make use of http://www.pinvoke.net/ (Adam
Nathan, MSFT, http://blogs.msdn.com/adam_nathan/)
[DllImport(quot;dwmapi.dllquot;, PreserveSig = false)]
public static extern void DwmExtendFrameIntoClientArea(
  IntPtr hwnd, ref MARGINS margins);
Host Windows Forms controls in WPF
 use WindowsFormsHost to host the control
 use PropertyMap to translate property values between WF
 and WPF
 common usage: WebBrowser control

Host WPF content in WF
 use ElementHost to host a WPF UIElement
 use PropertyMap to translate property values between WPF
 and WF
uses AxHost (Windows Forms control)

Build managed wrapper using AxHost subclass
 option 1: reference ActiveX control in VS
 option 2: run AxImp.exe manually

Windowed controls are a “black box” – no opacity

Windowless controls work well
Think data, not code
 Structure your data to facilitate binding
 Add transforms or helper properties/methods to the
 ViewModel layer
   Example: Buddy.DisplayText logic

 Subclass standard collections to add helper
 properties/methods
   Example: BuddyCollection.this[string]
INotifyPropertyChanged
 use this for most binding sources

DependencyProperty
 use when the property is a binding *target* or is animated
 e.g., MyProperty=“{Binding Path=Foo}”

INotifyCollectionChanged
 use to bind to a list of data items
 e.g., ObservableCollection<T>
XmlSerializer is (often) your friend
 Deserialize an XML stream into objects
 Avoids using XPath over and over
 Use xsd.exe (SDK tool) to generate classes for you from XML
 schema or raw data
 Example: Yahoo! search APIs
CollectionViewSource / CollectionView
 Provides data navigation (“CurrentItem”)
 Supports sorting and grouping
 Bind multiple controls to one navigator
Use when you want to set properties on items of a type
other than the type that defines the property
Common usage: layout
 (e.g., DockPanel.Dock, Grid.Row, Grid.Column)

Extend functionality without subclassing
Technically you don’t need attached properties, but it
allows you to use XAML
Use merged ResourceDictionaries
 Equivalent to “#include” for ResourceDictionary
 Allows use of multiple ResourceDictionary XAML files for
 maintainability
 Share styles and resources across projects
 Example: Yahoo! Messenger and Frog Design
Leverage WPF’s command framework
 Encapsulates functionality
 Supports keyboard accessibility (InputBindings)
 Allows developer or designer to add more entrypoints easily
 Works across classes and assemblies
 Does not burden designers with specific function names, etc.
Light WSIWYG XAML editors
 XamlPad, XamlPadX, KaXaml, XamlCruncher
 No code, just XAML
 Quick UI testing/building
 Helps you learn how to do tricks in XAML
 Good for sending repro to others
Expression quot;Blendquot; (MSFT)
 Designer: build the UI, animations, prototypes, styles; work with
 full apps
 Developer: use for quick styles, templates, animations; test
 UserControls
 Multiple source files, complex projects
 Available in Expression Studio box received at MIX
Snoop (Peter Blois, MSFT)
 Basically Spy++ for WPF
 Allows you to examine the visual tree
 Make some property changes live if you need to tweak
 Magnify the UI
 Inspect events and binding errors
 Download from http://www.blois.us/Snoop/
Reflector (Lutz Roeder, MSFT)
 Dig into the disassembly for .NET classes
 Many cool add-ins (incluing a XAML resource viewer)
 Download application and add-ins from http://www.aisto.com/roeder/
Q&A Now with Josh & Eric
Other members of the team here
Get notified http://messenger.yahoo.com/vista
Wednesday session with Frog Design 10am Palazzo M
Messenger blog: http://blog.messenger.yahoo.com
Eric’s blog: http://eric.burke.name/dotnetmania
Eric’s email burke@yahoo-inc.com
Eric Burke
Josh Jacobson
                      Sr. Technical Yahoo!
Sr. Product Manager
                      Yahoo!
Yahoo!
Thanks!
© 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.
The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions,
                it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation.
                                       MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

More Related Content

What's hot

Improve Your IBM Domino Designer Experience
Improve Your IBM Domino Designer ExperienceImprove Your IBM Domino Designer Experience
Improve Your IBM Domino Designer Experiencepanagenda
 
AD106 - IBM Lotus Domino XPages anywhere - Write them once, See them Everywhere
AD106 - IBM Lotus Domino XPages anywhere - Write them once, See them EverywhereAD106 - IBM Lotus Domino XPages anywhere - Write them once, See them Everywhere
AD106 - IBM Lotus Domino XPages anywhere - Write them once, See them EverywhereStephan H. Wissel
 
Cordova: APIs and instruments
Cordova: APIs and instrumentsCordova: APIs and instruments
Cordova: APIs and instrumentsIvano Malavolta
 
Cross-Platform Mobile Development in Visual Studio
Cross-Platform Mobile Development in Visual StudioCross-Platform Mobile Development in Visual Studio
Cross-Platform Mobile Development in Visual Studiobryan costanich
 
Mike Taulty Wpf Dev Days
Mike Taulty Wpf Dev DaysMike Taulty Wpf Dev Days
Mike Taulty Wpf Dev Daysukdpe
 
Plug-in Architectures
Plug-in ArchitecturesPlug-in Architectures
Plug-in Architectureselliando dias
 
IBM Connect 2014 BP204: It's Not Infernal: Dante's Nine Circles of XPages Heaven
IBM Connect 2014 BP204: It's Not Infernal: Dante's Nine Circles of XPages HeavenIBM Connect 2014 BP204: It's Not Infernal: Dante's Nine Circles of XPages Heaven
IBM Connect 2014 BP204: It's Not Infernal: Dante's Nine Circles of XPages HeavenPaul Withers
 

What's hot (7)

Improve Your IBM Domino Designer Experience
Improve Your IBM Domino Designer ExperienceImprove Your IBM Domino Designer Experience
Improve Your IBM Domino Designer Experience
 
AD106 - IBM Lotus Domino XPages anywhere - Write them once, See them Everywhere
AD106 - IBM Lotus Domino XPages anywhere - Write them once, See them EverywhereAD106 - IBM Lotus Domino XPages anywhere - Write them once, See them Everywhere
AD106 - IBM Lotus Domino XPages anywhere - Write them once, See them Everywhere
 
Cordova: APIs and instruments
Cordova: APIs and instrumentsCordova: APIs and instruments
Cordova: APIs and instruments
 
Cross-Platform Mobile Development in Visual Studio
Cross-Platform Mobile Development in Visual StudioCross-Platform Mobile Development in Visual Studio
Cross-Platform Mobile Development in Visual Studio
 
Mike Taulty Wpf Dev Days
Mike Taulty Wpf Dev DaysMike Taulty Wpf Dev Days
Mike Taulty Wpf Dev Days
 
Plug-in Architectures
Plug-in ArchitecturesPlug-in Architectures
Plug-in Architectures
 
IBM Connect 2014 BP204: It's Not Infernal: Dante's Nine Circles of XPages Heaven
IBM Connect 2014 BP204: It's Not Infernal: Dante's Nine Circles of XPages HeavenIBM Connect 2014 BP204: It's Not Infernal: Dante's Nine Circles of XPages Heaven
IBM Connect 2014 BP204: It's Not Infernal: Dante's Nine Circles of XPages Heaven
 

Viewers also liked

Easter Sunday :: op-stjoseph.org
Easter Sunday :: op-stjoseph.orgEaster Sunday :: op-stjoseph.org
Easter Sunday :: op-stjoseph.orggoodfriday
 
Developing Interactive Applications Using Windows Live Robots, Activities, an...
Developing Interactive Applications Using Windows Live Robots, Activities, an...Developing Interactive Applications Using Windows Live Robots, Activities, an...
Developing Interactive Applications Using Windows Live Robots, Activities, an...goodfriday
 
Front-Ending the Web with Microsoft Office
Front-Ending the Web with Microsoft OfficeFront-Ending the Web with Microsoft Office
Front-Ending the Web with Microsoft Officegoodfriday
 
How Razorfish Lights Up Brand with Microsoft SharePoint
How Razorfish Lights Up Brand with Microsoft SharePointHow Razorfish Lights Up Brand with Microsoft SharePoint
How Razorfish Lights Up Brand with Microsoft SharePointgoodfriday
 
Extending Your Experience to Mobile Devices
Extending Your Experience to Mobile DevicesExtending Your Experience to Mobile Devices
Extending Your Experience to Mobile Devicesgoodfriday
 
Opening up Windows Live Data
Opening up Windows Live DataOpening up Windows Live Data
Opening up Windows Live Datagoodfriday
 
The Holy Season of Lent
The Holy Season of LentThe Holy Season of Lent
The Holy Season of Lentgoodfriday
 
Sketch Flow: From Concept to Production
Sketch Flow: From Concept to ProductionSketch Flow: From Concept to Production
Sketch Flow: From Concept to Productiongoodfriday
 
Lessons Learned: Designer/Developer Productivity in Windows Presentation Foun...
Lessons Learned: Designer/Developer Productivity in Windows Presentation Foun...Lessons Learned: Designer/Developer Productivity in Windows Presentation Foun...
Lessons Learned: Designer/Developer Productivity in Windows Presentation Foun...goodfriday
 
Windows Presentation Foundation: The Opportunity for WPF Applications in the …
Windows Presentation Foundation: The Opportunity for WPF Applications in the …Windows Presentation Foundation: The Opportunity for WPF Applications in the …
Windows Presentation Foundation: The Opportunity for WPF Applications in the …goodfriday
 
History of Good Friday
History of Good FridayHistory of Good Friday
History of Good Fridaygoodfriday
 
Diploma prosjektledelse
Diploma prosjektledelse Diploma prosjektledelse
Diploma prosjektledelse Tanya Mie
 
Astronomia ii
Astronomia iiAstronomia ii
Astronomia iivamvictor
 
2. kko pengetahuan
2. kko pengetahuan2. kko pengetahuan
2. kko pengetahuanSugan Wae
 
Ativ 4cassiomacielalmeida
Ativ 4cassiomacielalmeidaAtiv 4cassiomacielalmeida
Ativ 4cassiomacielalmeidaK'cio Almeida
 

Viewers also liked (20)

Keynote I
Keynote IKeynote I
Keynote I
 
Easter Sunday :: op-stjoseph.org
Easter Sunday :: op-stjoseph.orgEaster Sunday :: op-stjoseph.org
Easter Sunday :: op-stjoseph.org
 
Developing Interactive Applications Using Windows Live Robots, Activities, an...
Developing Interactive Applications Using Windows Live Robots, Activities, an...Developing Interactive Applications Using Windows Live Robots, Activities, an...
Developing Interactive Applications Using Windows Live Robots, Activities, an...
 
Front-Ending the Web with Microsoft Office
Front-Ending the Web with Microsoft OfficeFront-Ending the Web with Microsoft Office
Front-Ending the Web with Microsoft Office
 
How Razorfish Lights Up Brand with Microsoft SharePoint
How Razorfish Lights Up Brand with Microsoft SharePointHow Razorfish Lights Up Brand with Microsoft SharePoint
How Razorfish Lights Up Brand with Microsoft SharePoint
 
Extending Your Experience to Mobile Devices
Extending Your Experience to Mobile DevicesExtending Your Experience to Mobile Devices
Extending Your Experience to Mobile Devices
 
Opening up Windows Live Data
Opening up Windows Live DataOpening up Windows Live Data
Opening up Windows Live Data
 
The Holy Season of Lent
The Holy Season of LentThe Holy Season of Lent
The Holy Season of Lent
 
Sketch Flow: From Concept to Production
Sketch Flow: From Concept to ProductionSketch Flow: From Concept to Production
Sketch Flow: From Concept to Production
 
Lessons Learned: Designer/Developer Productivity in Windows Presentation Foun...
Lessons Learned: Designer/Developer Productivity in Windows Presentation Foun...Lessons Learned: Designer/Developer Productivity in Windows Presentation Foun...
Lessons Learned: Designer/Developer Productivity in Windows Presentation Foun...
 
Windows Presentation Foundation: The Opportunity for WPF Applications in the …
Windows Presentation Foundation: The Opportunity for WPF Applications in the …Windows Presentation Foundation: The Opportunity for WPF Applications in the …
Windows Presentation Foundation: The Opportunity for WPF Applications in the …
 
Argumento
ArgumentoArgumento
Argumento
 
Nutricia quality 1
Nutricia quality 1Nutricia quality 1
Nutricia quality 1
 
History of Good Friday
History of Good FridayHistory of Good Friday
History of Good Friday
 
Diploma prosjektledelse
Diploma prosjektledelse Diploma prosjektledelse
Diploma prosjektledelse
 
Astronomia ii
Astronomia iiAstronomia ii
Astronomia ii
 
Don't Worry...
Don't Worry...Don't Worry...
Don't Worry...
 
2. kko pengetahuan
2. kko pengetahuan2. kko pengetahuan
2. kko pengetahuan
 
Ativ 4cassiomacielalmeida
Ativ 4cassiomacielalmeidaAtiv 4cassiomacielalmeida
Ativ 4cassiomacielalmeida
 
Scene one
Scene oneScene one
Scene one
 

Similar to Yahoo! On Microsoft .NET 3.0 and Microsoft Expression

XAML: One Language to Rule Them All
XAML: One Language to Rule Them AllXAML: One Language to Rule Them All
XAML: One Language to Rule Them AllFrank La Vigne
 
WPF - the future of GUI is near
WPF - the future of GUI is nearWPF - the future of GUI is near
WPF - the future of GUI is nearBartlomiej Filipek
 
Re-use Your Skills and Code to Expand the Reach of Your Apps with Silverlight
Re-use Your Skills and Code to Expand the Reach of Your Apps with SilverlightRe-use Your Skills and Code to Expand the Reach of Your Apps with Silverlight
Re-use Your Skills and Code to Expand the Reach of Your Apps with SilverlightFrank La Vigne
 
The Business of Microsoft Silverlight
The Business of Microsoft SilverlightThe Business of Microsoft Silverlight
The Business of Microsoft Silverlightgoodfriday
 
Complete WPF Overview Tutorial with Example - iFour Technolab
Complete WPF Overview Tutorial with Example - iFour TechnolabComplete WPF Overview Tutorial with Example - iFour Technolab
Complete WPF Overview Tutorial with Example - iFour TechnolabiFour Technolab Pvt. Ltd.
 
Firefox extension Development
Firefox extension DevelopmentFirefox extension Development
Firefox extension DevelopmentAbhinav Chittora
 
Btb017 David
Btb017 DavidBtb017 David
Btb017 DavidRohit Ray
 
Buzzword, How'd They Build That?
Buzzword, How'd They Build That?Buzzword, How'd They Build That?
Buzzword, How'd They Build That?dcoletta
 
Experiences using CouchDB inside Microsoft's Azure team
Experiences using CouchDB inside Microsoft's Azure teamExperiences using CouchDB inside Microsoft's Azure team
Experiences using CouchDB inside Microsoft's Azure teamBrian Benz
 
Building cross platform web apps
Building cross platform web appsBuilding cross platform web apps
Building cross platform web appsITEM
 
RIA Development via Adobe Flex + JRuby on Rails
RIA Development via Adobe Flex + JRuby on RailsRIA Development via Adobe Flex + JRuby on Rails
RIA Development via Adobe Flex + JRuby on Railskamal.fariz
 
Deeper into Windows 10 Development
Deeper into Windows 10 DevelopmentDeeper into Windows 10 Development
Deeper into Windows 10 DevelopmentShahed Chowdhuri
 
Маргарита Остапчук "Що нового в Windows 10 для розробників"
Маргарита Остапчук "Що нового в Windows 10 для розробників"Маргарита Остапчук "Що нового в Windows 10 для розробників"
Маргарита Остапчук "Що нового в Windows 10 для розробників"Fwdays
 
Google Dev Day2007
Google Dev Day2007Google Dev Day2007
Google Dev Day2007lucclaes
 
Building Buzzword (Flex Camp Boston 2007)
Building Buzzword (Flex Camp Boston 2007)Building Buzzword (Flex Camp Boston 2007)
Building Buzzword (Flex Camp Boston 2007)dcoletta
 

Similar to Yahoo! On Microsoft .NET 3.0 and Microsoft Expression (20)

XAML: One Language to Rule Them All
XAML: One Language to Rule Them AllXAML: One Language to Rule Them All
XAML: One Language to Rule Them All
 
WPF - the future of GUI is near
WPF - the future of GUI is nearWPF - the future of GUI is near
WPF - the future of GUI is near
 
Re-use Your Skills and Code to Expand the Reach of Your Apps with Silverlight
Re-use Your Skills and Code to Expand the Reach of Your Apps with SilverlightRe-use Your Skills and Code to Expand the Reach of Your Apps with Silverlight
Re-use Your Skills and Code to Expand the Reach of Your Apps with Silverlight
 
The Business of Microsoft Silverlight
The Business of Microsoft SilverlightThe Business of Microsoft Silverlight
The Business of Microsoft Silverlight
 
Complete WPF Overview Tutorial with Example - iFour Technolab
Complete WPF Overview Tutorial with Example - iFour TechnolabComplete WPF Overview Tutorial with Example - iFour Technolab
Complete WPF Overview Tutorial with Example - iFour Technolab
 
Firefox extension Development
Firefox extension DevelopmentFirefox extension Development
Firefox extension Development
 
Btb017 David
Btb017 DavidBtb017 David
Btb017 David
 
Silverlight Training
Silverlight TrainingSilverlight Training
Silverlight Training
 
Telerik
TelerikTelerik
Telerik
 
What is Adobe Flex ?
What is Adobe Flex  ?What is Adobe Flex  ?
What is Adobe Flex ?
 
Adobe® Flex™
Adobe® Flex™Adobe® Flex™
Adobe® Flex™
 
Buzzword, How'd They Build That?
Buzzword, How'd They Build That?Buzzword, How'd They Build That?
Buzzword, How'd They Build That?
 
Experiences using CouchDB inside Microsoft's Azure team
Experiences using CouchDB inside Microsoft's Azure teamExperiences using CouchDB inside Microsoft's Azure team
Experiences using CouchDB inside Microsoft's Azure team
 
Building cross platform web apps
Building cross platform web appsBuilding cross platform web apps
Building cross platform web apps
 
RIA Development via Adobe Flex + JRuby on Rails
RIA Development via Adobe Flex + JRuby on RailsRIA Development via Adobe Flex + JRuby on Rails
RIA Development via Adobe Flex + JRuby on Rails
 
Deeper into Windows 10 Development
Deeper into Windows 10 DevelopmentDeeper into Windows 10 Development
Deeper into Windows 10 Development
 
Embarcadero RAD Studio XE3 presentation
Embarcadero RAD Studio XE3 presentationEmbarcadero RAD Studio XE3 presentation
Embarcadero RAD Studio XE3 presentation
 
Маргарита Остапчук "Що нового в Windows 10 для розробників"
Маргарита Остапчук "Що нового в Windows 10 для розробників"Маргарита Остапчук "Що нового в Windows 10 для розробників"
Маргарита Остапчук "Що нового в Windows 10 для розробників"
 
Google Dev Day2007
Google Dev Day2007Google Dev Day2007
Google Dev Day2007
 
Building Buzzword (Flex Camp Boston 2007)
Building Buzzword (Flex Camp Boston 2007)Building Buzzword (Flex Camp Boston 2007)
Building Buzzword (Flex Camp Boston 2007)
 

More from goodfriday

Narine Presentations 20051021 134052
Narine Presentations 20051021 134052Narine Presentations 20051021 134052
Narine Presentations 20051021 134052goodfriday
 
09 03 22 easter
09 03 22 easter09 03 22 easter
09 03 22 eastergoodfriday
 
Holy Week Easter 2009
Holy Week Easter 2009Holy Week Easter 2009
Holy Week Easter 2009goodfriday
 
Holt Park Easter 09 Swim
Holt Park Easter 09 SwimHolt Park Easter 09 Swim
Holt Park Easter 09 Swimgoodfriday
 
Swarthmore Lentbrochure20092
Swarthmore Lentbrochure20092Swarthmore Lentbrochure20092
Swarthmore Lentbrochure20092goodfriday
 
Eastercard2009
Eastercard2009Eastercard2009
Eastercard2009goodfriday
 
Easterservices2009
Easterservices2009Easterservices2009
Easterservices2009goodfriday
 
Bulletin Current
Bulletin CurrentBulletin Current
Bulletin Currentgoodfriday
 
March 2009 Newsletter
March 2009 NewsletterMarch 2009 Newsletter
March 2009 Newslettergoodfriday
 
Lent Easter 2009
Lent Easter 2009Lent Easter 2009
Lent Easter 2009goodfriday
 
Easterpowersports09
Easterpowersports09Easterpowersports09
Easterpowersports09goodfriday
 
Easter Trading 09
Easter Trading 09Easter Trading 09
Easter Trading 09goodfriday
 
Easter Brochure 2009
Easter Brochure 2009Easter Brochure 2009
Easter Brochure 2009goodfriday
 
March April 2009 Calendar
March April 2009 CalendarMarch April 2009 Calendar
March April 2009 Calendargoodfriday
 

More from goodfriday (20)

Narine Presentations 20051021 134052
Narine Presentations 20051021 134052Narine Presentations 20051021 134052
Narine Presentations 20051021 134052
 
Triunemar05
Triunemar05Triunemar05
Triunemar05
 
09 03 22 easter
09 03 22 easter09 03 22 easter
09 03 22 easter
 
Holy Week Easter 2009
Holy Week Easter 2009Holy Week Easter 2009
Holy Week Easter 2009
 
Holt Park Easter 09 Swim
Holt Park Easter 09 SwimHolt Park Easter 09 Swim
Holt Park Easter 09 Swim
 
Easter Letter
Easter LetterEaster Letter
Easter Letter
 
April2009
April2009April2009
April2009
 
Swarthmore Lentbrochure20092
Swarthmore Lentbrochure20092Swarthmore Lentbrochure20092
Swarthmore Lentbrochure20092
 
Eastercard2009
Eastercard2009Eastercard2009
Eastercard2009
 
Easterservices2009
Easterservices2009Easterservices2009
Easterservices2009
 
Bulletin Current
Bulletin CurrentBulletin Current
Bulletin Current
 
Easter2009
Easter2009Easter2009
Easter2009
 
Bulletin
BulletinBulletin
Bulletin
 
March 2009 Newsletter
March 2009 NewsletterMarch 2009 Newsletter
March 2009 Newsletter
 
Mar 29 2009
Mar 29 2009Mar 29 2009
Mar 29 2009
 
Lent Easter 2009
Lent Easter 2009Lent Easter 2009
Lent Easter 2009
 
Easterpowersports09
Easterpowersports09Easterpowersports09
Easterpowersports09
 
Easter Trading 09
Easter Trading 09Easter Trading 09
Easter Trading 09
 
Easter Brochure 2009
Easter Brochure 2009Easter Brochure 2009
Easter Brochure 2009
 
March April 2009 Calendar
March April 2009 CalendarMarch April 2009 Calendar
March April 2009 Calendar
 

Recently uploaded

How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsRavi Sanghani
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityIES VE
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS:  6 Ways to Automate Your Data IntegrationBridging Between CAD & GIS:  6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integrationmarketing932765
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesThousandEyes
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxGenerative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxfnnc6jmgwh
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentPim van der Noll
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationKnoldus Inc.
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Hiroshi SHIBATA
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Strongerpanagenda
 
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesMuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesManik S Magar
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Alkin Tezuysal
 

Recently uploaded (20)

How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and Insights
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a reality
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS:  6 Ways to Automate Your Data IntegrationBridging Between CAD & GIS:  6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integration
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxGenerative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog Presentation
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
 
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesMuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
 

Yahoo! On Microsoft .NET 3.0 and Microsoft Expression

  • 1.
  • 2. Josh Jacobson Eric Burke Sr. Product Manager Sr. Technical Yahoo! Yahoo! Yahoo!
  • 3. Today Wednesday 10 am Why is Yahoo! Here? Frog Design + Yahoo! Demo WPF Secrets REVEALED! Designer / Developer Workflow Q&A Sketches & Prototypes
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10. Windows Vista Windows XP Mac OS X Others… Messenger Client Platform Yahoo! Client Platform
  • 12. Eric Burke Sr. Technical Yahoo! In the trenches with WPF every day.
  • 13. Getting started with WPF Application Model Developer-Designer workflow Window.AllowsTransparency: friend or foe? UserControls are (usually) good! What’s wrong with my ListBox? But i have all this existing C++ code… Data Binding Other tidbits
  • 14. Make heavy use of forums, blogs, etc. Provide small repro code if possible! Expect to do heavy refactoring of your work for a good 3- 6 months or more Write a photo viewer, RSS reader, and/or a sidebar with widgets Use everything in the SDK at least once Remember: this is 1.0 software!
  • 15. Code first, XAML later Understand what’s going on under the hood Look in obj/ for files with the “.g.cs” extension Petzold’s book (Applications = Code + Markup) teaches code first – excellent read Rob Relyea (MSFT, http://rrelyea.spaces.live.com/) is writing a XAML-to-Code converter
  • 16. Model owned by developer app logic ViewModel raw data sources owned by developer unmanaged code heavy input from designer C#, C++, etc. transform/augment data used mainly to support bindings in UI View owned by designer mostly in C# contains the UI mostly in XAML
  • 17. Dev: build first cut of app Design: apply styling using tools and Design: build prototypes request ViewModel changes Dev: implement ViewModel changes and integrate prototypes
  • 18. Get designers using Blend Designers (generally) don’t want to write XAML by hand – too slow For optimal workflow, make sure your project always loads in Blend Factor if necessary using UserControls and helper projects
  • 19. Windows XP: draw directly to screen WPF Rendering: Render using AllowsTransparency DirectX =“False” Pipeline Windows Vista: draw to a shared surface managed by the DWM
  • 20. Call WPF Rendering: UpdateLayered AllowsTransparency Window() with a =“True” on Windows DC XP Oh, no! Fall back to IDirect3DSurface:: software GetDC() fails if rendering alpha channel!
  • 21. Hooray! WPF Rendering: IDirect3DSurface:: AllowsTransparency GetDC() works with =“True” on Windows alpha channels; Vista render with h/w Oh, no! GDI is Must move bits from software video memory to main memory (can emulated on be sloooooow) Vista!
  • 22.
  • 23. Conclusions on XP, complex scenes hurt performance on Vista, slower system bus and large windows hurt performance (“large” may not be as big as you think!)
  • 24. Workarounds Opaque window with custom HRGN Overlapped “owned” windows to create illusion of a nonrectangular window [added advantage: better Maximize behavior] Use Popup class Caveat: always on top Caveat: forces itself to stay onscreen
  • 25.
  • 26. Problem: XAML file size gets unwieldy FAST Hard to maintain the code Hard to find what you need Tools can’t handle crazy file sizes UserControl is a custom “black box” Different than a custom Control Used for specific purpose in the given project
  • 27. Faster time-to-build Componentization means UI can be laid out top-down with placeholders Can live in a separate project Smaller, so tools can handle them more easily Makes iterating and testing far easier Makes life easier on designers!
  • 28.
  • 29. Often ItemsControls (e.g., ListBox) will have many more items than can be displayed Virtualization: creating physical representation for only the visible items Default behavior of ItemsControl uses VirtualizingStackPanel As list is scrolled, items coming into view get created; items which are no longer in view get destroyed and collected
  • 30. Problem #1: using a non-virtualized ItemsPanel e.g., WrapPanel, Grid, etc. Currently, .NET framework includes only VirtualizingStackPanel Solution: write a custom VirtualizingPanel as the ItemsPanel Dan Crevier (MSFT, http://blogs.msdn.com/dancre/) has a great example of a VirtualizingTilePanel
  • 31. Problem #2: grouping data using CollectionViewSource View treats each Group as one item ItemsControl has no knowledge of Group’s contents Solution: custom CollectionView subclass Replace default ListCollectionView Custom View plays nice with virtualization Not a trivial exercise, but gives you better control
  • 32. Legacy C++ code Cross-platform C++ code Functionality not in WPF (e.g., GetCursorPos) Want to leverage WPF in your WinForms app, or vice- versa Use existing non-WPF third-party controls
  • 33. AKA “Managed C++” – .NET and C++ in same DLL Exposes .NET classes to the app App can subclass or bind directly to these classes Communicates with underlying unmanaged code Example: Yahoo! Messenger core components
  • 34. Call C++ library functions from .NET DIBs, window regions, DWM, ShellExecute, Set/GetWindowLong Legacy C++ libs Make use of http://www.pinvoke.net/ (Adam Nathan, MSFT, http://blogs.msdn.com/adam_nathan/) [DllImport(quot;dwmapi.dllquot;, PreserveSig = false)] public static extern void DwmExtendFrameIntoClientArea( IntPtr hwnd, ref MARGINS margins);
  • 35. Host Windows Forms controls in WPF use WindowsFormsHost to host the control use PropertyMap to translate property values between WF and WPF common usage: WebBrowser control Host WPF content in WF use ElementHost to host a WPF UIElement use PropertyMap to translate property values between WPF and WF
  • 36. uses AxHost (Windows Forms control) Build managed wrapper using AxHost subclass option 1: reference ActiveX control in VS option 2: run AxImp.exe manually Windowed controls are a “black box” – no opacity Windowless controls work well
  • 37. Think data, not code Structure your data to facilitate binding Add transforms or helper properties/methods to the ViewModel layer Example: Buddy.DisplayText logic Subclass standard collections to add helper properties/methods Example: BuddyCollection.this[string]
  • 38. INotifyPropertyChanged use this for most binding sources DependencyProperty use when the property is a binding *target* or is animated e.g., MyProperty=“{Binding Path=Foo}” INotifyCollectionChanged use to bind to a list of data items e.g., ObservableCollection<T>
  • 39. XmlSerializer is (often) your friend Deserialize an XML stream into objects Avoids using XPath over and over Use xsd.exe (SDK tool) to generate classes for you from XML schema or raw data Example: Yahoo! search APIs
  • 40. CollectionViewSource / CollectionView Provides data navigation (“CurrentItem”) Supports sorting and grouping Bind multiple controls to one navigator
  • 41. Use when you want to set properties on items of a type other than the type that defines the property Common usage: layout (e.g., DockPanel.Dock, Grid.Row, Grid.Column) Extend functionality without subclassing Technically you don’t need attached properties, but it allows you to use XAML
  • 42. Use merged ResourceDictionaries Equivalent to “#include” for ResourceDictionary Allows use of multiple ResourceDictionary XAML files for maintainability Share styles and resources across projects Example: Yahoo! Messenger and Frog Design
  • 43. Leverage WPF’s command framework Encapsulates functionality Supports keyboard accessibility (InputBindings) Allows developer or designer to add more entrypoints easily Works across classes and assemblies Does not burden designers with specific function names, etc.
  • 44. Light WSIWYG XAML editors XamlPad, XamlPadX, KaXaml, XamlCruncher No code, just XAML Quick UI testing/building Helps you learn how to do tricks in XAML Good for sending repro to others
  • 45. Expression quot;Blendquot; (MSFT) Designer: build the UI, animations, prototypes, styles; work with full apps Developer: use for quick styles, templates, animations; test UserControls Multiple source files, complex projects Available in Expression Studio box received at MIX
  • 46. Snoop (Peter Blois, MSFT) Basically Spy++ for WPF Allows you to examine the visual tree Make some property changes live if you need to tweak Magnify the UI Inspect events and binding errors Download from http://www.blois.us/Snoop/
  • 47. Reflector (Lutz Roeder, MSFT) Dig into the disassembly for .NET classes Many cool add-ins (incluing a XAML resource viewer) Download application and add-ins from http://www.aisto.com/roeder/
  • 48. Q&A Now with Josh & Eric Other members of the team here Get notified http://messenger.yahoo.com/vista Wednesday session with Frog Design 10am Palazzo M Messenger blog: http://blog.messenger.yahoo.com Eric’s blog: http://eric.burke.name/dotnetmania Eric’s email burke@yahoo-inc.com
  • 49. Eric Burke Josh Jacobson Sr. Technical Yahoo! Sr. Product Manager Yahoo! Yahoo!
  • 51. © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.