Presented by Radu Poenaru at „Windows Phone 7“ Workshop
® Windows Phone®
Silverlight programming on Microsoft Phone
Radu P...
Presented by Radu Poenaru at „Windows Phone 7“ Workshop
® Windows Phone®
What we are trying to achieve
• How to create a s...
Presented by Radu Poenaru at „Windows Phone 7“ Workshop
® Windows Phone®
What is Silverlight?
“Silverlight is a powerful d...
Presented by Radu Poenaru at „Windows Phone 7“ Workshop
® Windows Phone®
Silverlight
• Very powerful framework
• Same know...
Presented by Radu Poenaru at „Windows Phone 7“ Workshop
® Windows Phone®
Silverlight capacities
Inputs
• Keyboard
• Mouse
...
Presented by Radu Poenaru at „Windows Phone 7“ Workshop
® Windows Phone®
What about Silverlight for Phone
It is a superset...
Presented by Radu Poenaru at „Windows Phone 7“ Workshop
® Windows Phone®
application structure
first, a little history…
Presented by Radu Poenaru at „Windows Phone 7“ Workshop
® Windows Phone®
Application
default silverlight application
UserC...
Presented by Radu Poenaru at „Windows Phone 7“ Workshop
® Windows Phone®
silverlight 3 navigation application
UserControl
...
Presented by Radu Poenaru at „Windows Phone 7“ Workshop
® Windows Phone®
Windows Phone application
UserControl
Frame
Page ...
Presented by Radu Poenaru at „Windows Phone 7“ Workshop
® Windows Phone®
back key details
• Lets the user to return to pre...
Presented by Radu Poenaru at „Windows Phone 7“ Workshop
® Windows Phone®
a world of constant interruptions
lock
screen
Presented by Radu Poenaru at „Windows Phone 7“ Workshop
® Windows Phone®
basic application lifetime
Not
running
Start
Runn...
Presented by Radu Poenaru at „Windows Phone 7“ Workshop
® Windows Phone®
obscured: popup ui from shell
Running
Obscured
Ru...
Presented by Radu Poenaru at „Windows Phone 7“ Workshop
® Windows Phone®
paused: jump to another app
Running
Pause
Suspend...
Presented by Radu Poenaru at „Windows Phone 7“ Workshop
® Windows Phone®
Evaluating app performance
•Render Thread FPS: Th...
Presented by Radu Poenaru at „Windows Phone 7“ Workshop
® Windows Phone®
Basics
• XAML – eXtensible Application Markup Lan...
Presented by Radu Poenaru at „Windows Phone 7“ Workshop
® Windows Phone®
Shapes
• Vector- based
• Easy to scale, keeping t...
Presented by Radu Poenaru at „Windows Phone 7“ Workshop
® Windows Phone®
Brushes
• Determines how objects are painted and ...
Presented by Radu Poenaru at „Windows Phone 7“ Workshop
® Windows Phone®
Controls
• Encapsulate functionality
• Requires a...
Presented by Radu Poenaru at „Windows Phone 7“ Workshop
® Windows Phone®
Events
• Can be created in XAML and Code
• XAML e...
Presented by Radu Poenaru at „Windows Phone 7“ Workshop
® Windows Phone®
Layout containers
• Flexible Layout system
• Canv...
Presented by Radu Poenaru at „Windows Phone 7“ Workshop
® Windows Phone®
Demo
• Layout demo
• Attached properties
Presented by Radu Poenaru at „Windows Phone 7“ Workshop
® Windows Phone®
Transforms
• Alters any element
• Controls
• Text...
Presented by Radu Poenaru at „Windows Phone 7“ Workshop
® Windows Phone®
Animations
• Animates a property value over the t...
Presented by Radu Poenaru at „Windows Phone 7“ Workshop
® Windows Phone®
Styling
• Applies a set of values to a specific t...
Presented by Radu Poenaru at „Windows Phone 7“ Workshop
® Windows Phone®
Binding
• Connects data to UI
• Two types
• Prope...
Presented by Radu Poenaru at „Windows Phone 7“ Workshop
® Windows Phone®
Code reuse
• Reuse UI
• User controls
• Custom co...
Presented by Radu Poenaru at „Windows Phone 7“ Workshop
® Windows Phone®
References
• Search for Silverlight 3 source:
• F...
Presented by Radu Poenaru at „Windows Phone 7“ Workshop
® Windows Phone®
Comments and sugestions are welcome!
radu.poenaru...
Upcoming SlideShare
Loading in...5
×

Windows Phone 7 apps development with Silverlight

1,563

Published on

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
1,563
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
27
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide
  • My presentation – universitate, msp, interests in MS products,
    Questions to know each other
    - Programming level, Silverlight, Design
  • 0 Examples for SL 3 apply to the Phone
    1
    2 the text box has a associated sw keyboard, list have implemented phisyx
    3 same video experience, sensors : vibr, location services
    4 app is part from experience – same look as Phone
    5 security concerns – relax cross-domain policy check
  • Render Thread FPS: The number of frames per second that the independent simple animations and rendering thread is using. Keeping around 60 will provide a great experience, while a number of 30 fps will begin to show a poor experience to the end user.
    Under 30 fps this counter will turn red in post-beta builds.
    User Interface Thread FPS: The number of fps that the primary user interface thread is experiencing. Property change notifications, data binding, primary managed code execution, and animations not handled on the render thread use this threads’ resources.
    Turns red when the count is at or below 15 fps.
    Texture Memory Usage: A specialized memory counter indicating the video memory used for storing application textures.
    Surface Counter: A count of the number of surfaces that are passed to the graphics chip.
    Intermediate Texture Count: The number of intermediate textures created for compositing.
    Screen Fill Rate: A metric representing the number of complete phone screens being painted each and every frame.
  • Start the dev of sample application – text block in XAML and code
  • Importable from designers‘ Photoshop

    No demo yet
  • Demo with Ellipse
  • VS can create the events for you
    Or you can create them by hand

    Default event handler for Button – Click event

    Or by double clicking
  • Grid – layout system, not semantic informational display
  • Attached properties
    A ball doesn‘t now its position, but the parent can provide it.
    Canvas – not so flexible, phone can be rotated
    Stack panel
    Grid – rows : auto or * or pixels
  • Ball pulsing demo app
    - animation in Blend
    - call it from code
  • Windows Phone 7 apps development with Silverlight

    1. 1. Presented by Radu Poenaru at „Windows Phone 7“ Workshop ® Windows Phone® Silverlight programming on Microsoft Phone Radu Poenaru Microsoft Student Partner
    2. 2. Presented by Radu Poenaru at „Windows Phone 7“ Workshop ® Windows Phone® What we are trying to achieve • How to create a simple Silverlight app • Use Blend 4 for Phone for design http://70gigapixel.cloudapp.net/
    3. 3. Presented by Radu Poenaru at „Windows Phone 7“ Workshop ® Windows Phone® What is Silverlight? “Silverlight is a powerful development platform for creating engaging, interactive user experiences for Web, desktop, and mobile applications when online or offline.” Microsoft Official Silverlight website http://www.silverlight.net/
    4. 4. Presented by Radu Poenaru at „Windows Phone 7“ Workshop ® Windows Phone® Silverlight • Very powerful framework • Same known XAML and C# • Windows, Mac, Linux and now Phone • Learning curve is smooth
    5. 5. Presented by Radu Poenaru at „Windows Phone 7“ Workshop ® Windows Phone® Silverlight capacities Inputs • Keyboard • Mouse • Touch • Ink Media • Digital media capture & playback • VC1, WMA, MP3 Data • Language Integrated Query (LINQ) • LINQ to XML • XML • IsolatedStorage Base Class Library (BCL) • Generics • Collections • Cryptography • Threading Windows Communication Foundation • REST • RSS/ATOM • SOAP XAML UI Core • Vector • Animation • Text • Images
    6. 6. Presented by Radu Poenaru at „Windows Phone 7“ Workshop ® Windows Phone® What about Silverlight for Phone It is a superset of Silverlight 3 having several elements from Silverlight 4 and many extras: • Performance tuning • Input integration • Hardware media and sensor integration • OS application model integration • Relaxed sandbox constraints
    7. 7. Presented by Radu Poenaru at „Windows Phone 7“ Workshop ® Windows Phone® application structure first, a little history…
    8. 8. Presented by Radu Poenaru at „Windows Phone 7“ Workshop ® Windows Phone® Application default silverlight application UserControl ContentContent Content
    9. 9. Presented by Radu Poenaru at „Windows Phone 7“ Workshop ® Windows Phone® silverlight 3 navigation application UserControl Frame Page 3Page 1 Page 2 ApplicationApplication UserControl ContentContent Content
    10. 10. Presented by Radu Poenaru at „Windows Phone 7“ Workshop ® Windows Phone® Windows Phone application UserControl Frame Page 3Page 1 Page 2 ApplicationApplication Frame Page 3Page 1 Page 2
    11. 11. Presented by Radu Poenaru at „Windows Phone 7“ Workshop ® Windows Phone® back key details • Lets the user to return to previously-viewed screens • Can go back across applications • Not used for application-specific behaviour
    12. 12. Presented by Radu Poenaru at „Windows Phone 7“ Workshop ® Windows Phone® a world of constant interruptions lock screen
    13. 13. Presented by Radu Poenaru at „Windows Phone 7“ Workshop ® Windows Phone® basic application lifetime Not running Start Running Exit • Obscured • Paused
    14. 14. Presented by Radu Poenaru at „Windows Phone 7“ Workshop ® Windows Phone® obscured: popup ui from shell Running Obscured Running Unobscured Games could auto-pause Game could auto-resume • Phone call • Reminder • Battery low Not in the Mix build
    15. 15. Presented by Radu Poenaru at „Windows Phone 7“ Workshop ® Windows Phone® paused: jump to another app Running Pause Suspended Resume Assume your process is killed Save state for later use Load state to continue where you left off Not in the Mix build User never knows what happened :-) • Start Button • Accept call • Open toast
    16. 16. Presented by Radu Poenaru at „Windows Phone 7“ Workshop ® Windows Phone® Evaluating app performance •Render Thread FPS: The number of frames per second that the independent simple animations and rendering thread is using. •User Interface Thread FPS: The number of fps that the primary user interface thread is experiencing •Texture Memory Usage: A specialized memory counter indicating the video memory used for storing application textures. •Surface Counter: A count of the number of surfaces that are passed to the graphics chip. •Intermediate Texture Count: The number of intermediate textures created for compositing. •Screen Fill Rate: A metric representing the number of complete phone screens being painted each and every frame.
    17. 17. Presented by Radu Poenaru at „Windows Phone 7“ Workshop ® Windows Phone® Basics • XAML – eXtensible Application Markup Language • XML with custom tags • Maps to code • Can contain as children • resources • styles • controls • supports binding • Anything that is done in XAML can be done in code
    18. 18. Presented by Radu Poenaru at „Windows Phone 7“ Workshop ® Windows Phone® Shapes • Vector- based • Easy to scale, keeping the smoothness • Can be easily imported from Photoshop or Illustrator • Example(ellipse code):
    19. 19. Presented by Radu Poenaru at „Windows Phone 7“ Workshop ® Windows Phone® Brushes • Determines how objects are painted and outlined • Solid – filled with just one color • Gradient – linear or radial with multiple stop points • Image – shows an image in the brush • Media – paints with a playing movie Let‘s see a Demo!
    20. 20. Presented by Radu Poenaru at „Windows Phone 7“ Workshop ® Windows Phone® Controls • Encapsulate functionality • Requires a x:Name if you plan to call it from the code • Same properties in XAML as in Code
    21. 21. Presented by Radu Poenaru at „Windows Phone 7“ Workshop ® Windows Phone® Events • Can be created in XAML and Code • XAML editor helps you create a handler
    22. 22. Presented by Radu Poenaru at „Windows Phone 7“ Workshop ® Windows Phone® Layout containers • Flexible Layout system • Canvas – fixed position • StackPanel – „Stacks“ dynamically • Grid – rows and columns, very flexible • Can be nested – but beware of performance issues
    23. 23. Presented by Radu Poenaru at „Windows Phone 7“ Workshop ® Windows Phone® Demo • Layout demo • Attached properties
    24. 24. Presented by Radu Poenaru at „Windows Phone 7“ Workshop ® Windows Phone® Transforms • Alters any element • Controls • Text • Media • Transforms • Rotate, Scale, Skew ,Translate, Matrix • Projections • Plane, Matrix, • Apply 3D to a 2D element
    25. 25. Presented by Radu Poenaru at „Windows Phone 7“ Workshop ® Windows Phone® Animations • Animates a property value over the time • Basic elements in a page • Contains one or more Storiboards • Contains one or more Animations • Contains one or more Keyframes • Expression Blend is the best tool to do this Let‘s see some demo!
    26. 26. Presented by Radu Poenaru at „Windows Phone 7“ Workshop ® Windows Phone® Styling • Applies a set of values to a specific target type • Created in page Resources, application Resources or a ResourceDictionary • Requires • x:Key • TargetType • On the element – StaticResource pointing to the x:Key
    27. 27. Presented by Radu Poenaru at „Windows Phone 7“ Workshop ® Windows Phone® Binding • Connects data to UI • Two types • Property binding • List binding • Value converters – ex take color Red and convert it to hex representation • Based on change notification • Cascades through the hierarchy of controls
    28. 28. Presented by Radu Poenaru at „Windows Phone 7“ Workshop ® Windows Phone® Code reuse • Reuse UI • User controls • Custom controls • Reuse code • Across projects • Across platforms – Web, Desktop through OOB, Phone
    29. 29. Presented by Radu Poenaru at „Windows Phone 7“ Workshop ® Windows Phone® References • Search for Silverlight 3 source: • Forums, books, podcasts • http://silverlight.net • http://www.stackoverflow.com • Get Started with Silverlight for Windows Phone http://www.silverlight.net/getstarted/devices/windows-phone/ • Silverlight for Windows Phone forum http://forums.silverlight.net/forums/63.aspx • Mix 2010 event http://live.visitmix.com/Sessions
    30. 30. Presented by Radu Poenaru at „Windows Phone 7“ Workshop ® Windows Phone® Comments and sugestions are welcome! radu.poenaru@studentpartners.de www.radupoenaru.com Thank you!
    1. A particular slide catching your eye?

      Clipping is a handy way to collect important slides you want to go back to later.

    ×