Windows Presentation Foundation
Fabio Santini
[email protected]
http://blogs.msdn.com/fabiosantini
Agenda
Per iniziare
Introduzione a Windows Presentation
Foundation
Come funziona ?
Cos’è XAML ?
Interactive Designer (Sparkle)
Come migrare ?
Esempi
Per iniziare …
http://msdn.microsoft.com/windowsvista/gett
hebeta/default.aspx
Microsoft Pre-Release Software WinFX Runtime
Components - January Community Technology Preview
(CTP) (2.4 Mb)
Visual Studio 2005  (anche se si può fare tutto a
manina)
Microsoft® Windows® Software Development Kit (SDK)
for the January 2006 WinFX® Runtime Components
Community Technology Preview (CTP) (1081.8 MB)
Microsoft Visual Studio Code Name “Orcas” Community
Technology Preview - Development Tools for WinFX®
(3.6 Mb)
Per iniziare …
Se non funziona il setup
Provate a disinstallare Microsoft Command
Shell (Monad) e il Compact Framework 2.0
Eseguire il setup chiedendo un log più completo
Setup.exe -l*v
Se non funziona l’elemento MediaElement
E’ probabile che il setup non sia riuscito a
sostiture due dll dxva2.dll (DirectX Video
Acceleration 2.0) e evr.dll (Enhanced Video
Renderer)
http://www.fsantini.net/default.aspx
La nostra prima applicazione
• Mouse, Keyboard, Pen
• Commands
• Styles, bindings, controls
• Layout
• Text layout (PTS)
Element System
Input System
• Routing
• Class handlers
• Glyphs
• Metrics
• Cache
Font System
• Video, Audio
• 2D, 3D, Animation
• Text layout (line)
Event System
• Change notification
• Storage
• Expressions
Visual System
• Remoting
• Message based
• 2D, 3D
• Hardware, Software
Transport
Property System
Composition System
Step 1:
Scriviamo il programma
<ListBox>
<Button />
<Button />
</ListBox>
Step 2: Compiliamo
011101001011101001011101001011101001
011101001011101001011101001011101001
011101001011101001011101001011101001
011101001011101001011101001011101001
011101001011101001011101001011101001
011101001011101001011101001011101001
011101001011101001011101001011101001
011101001011101001011101001011101001
011101001011101001011101001011101001
011101001011101001011101001011101001
011101001011101001011101001011101001
011101001011101001011101001011101001
011101001011101001011101001011101001
011101001011101001011101001011101001
011101001011101001011101001011101001
011101001011101001011101001011101001
011101001011101001011101001011101001
BAML
EXE
C#/VB/etc
Images, etc
Step 3:
Eseguiamo il programma
Step 4:
Mostriamo i pixel
ListBox
Measure & Arrange
Render
ScrollViewer
StackPanel
Button
Button
CompNode
CompNode
CompNode
CompNode
UI Thread
Render Thread
ListBox
CompNode
ScrollViewer
StackPanel
Button
CompNode CompNode CompNode
Button
Transport
CompNode
DX Surfaces
CompNode CompNode CompNode
Bitmaps
Step 5:
Comunichiamo con l’utente
ListBox
CompNode
ScrollViewer
StackPanel
Button
CompNode CompNode CompNode
Button
1.
User32 gets the message
2.
WPF converts message to an input report
3.
If input report is a mouse move…
•
Structural hit testing on visuals
•
Geometry hit testing through geometry data
4.
Convert reports into one or more events
5.
For each event…
•
Build event route
•
Raise events
Mouse Click!
Step 6:
Utilizziamo gli elementi
Step 7:
Ritorniamo al punto 4
(ricordate: Mostriamo i pixel)
Usiamo XAML
Come migrare ?
Integrazione tra i due mondi
Un nuovo modo di pensare alle interfacce
© 2004 Microsoft Corporation. All rights reserved.
This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.
Scarica

Build event route Raise events