SlideShare a Scribd company logo
WINDOWS PHONE 8
Designing Windows Phone Applications
FOLLOW US
Twitter

: @chothanihitesh

Slideshare

: http://www.slideshare.net/Chothani-Hitesh

Email

: chothani.hitesh@gmail.com

Support

: windows.chothani@live.com

LinkedIn

: in.linkedin.com/pub/hiteshchothani/6b/311/2b8

W8 Publisher

: AppStudios

WP Publisher : AppStudios
Website

: www.appmobinfotech.com
•DESIGNING AN APP

•INTRODUCTION TO XAML LAYOUT
•STYLES AND THEMES

•DESIGN TIME DATA
•DATA BINDING

•LISTS AND THE LONGLISTSELECTOR
THEME
DESIGNING AN APP
DESIGN ON PAPER BEFORE YOU TOUCH
THE TOOLS!
DESIGN APP NAVIGATION EARLY!
TOOLS FOR THE JOB: GRAPHICAL DESIGN



A UX designer can use Blend
to specify the appearance of

the user interface


A version of Blend for the phone
is supplied as part of the phone
SDK
TOOLS FOR THE JOB: CODE CREATION



A Developer can take the user
interface design and use

Visual Studio build the
program to make it work


Visual Studio provides a design
environment but it is not as
advanced as Blend
DESIGN STYLE AND PROGRAMMING


As programmers we probably start of just worrying about making the
program work




This is a very good place to start

But in modern systems the “look and feel” of the user interface is very
important




No matter how good the code is, if the program is hard to use it will not be popular

You should pay careful attention to the user interface when making
phone programs



If you know any Graphic Designers it is worth getting them on your
development team
PROJECT TEMPLATES AND COMPONENTS



Windows Phone SDK
provides a set of project

templates


Each of them maps onto a
particular style of application
APPLICATION TEMPLATES


Windows Phone App




Basic single page app

Windows Phone Databound App


Project for creating a Windows Phone application using List and navigation
controls with a basic Model-View-ViewModel architecture



Windows Phone Pivot App




User can “pivot” between different screens by flicking left and right

Windows Phone Panorama application


A single panoramic background with pages of controls that the user can pan
between
APPLICATION TYPES


Three application types provide quite different user experiences



Select the one that you feel is the most appropriate
INTRODUCTION TO XAML
LAYOUT
THE CONTOSO COOKBOOK RECIPE
DETAILS PAGE



This is a Pivot page that displays details
of a recipe


Picture and directions on one pane



Ingredients list on another pane
PIVOT PAGES
XAML AND OBJECTS



Every XAML element is a declaration of an object



XAML is a way of describing a UI using XML





XAML stands for XML Application Markup Language

This is a declarative way of expressing your UI

XAML elements == objects in the
System.Windows.Controls namespace



Each of the items on the screen of the application
shown is a graphical rendering of an object
XAML DISPLAY ELEMENTS
DISPLAY ELEMENT PROPERTIES


Each of the elements contains properties that define how it appears on
the screen


Position on the screen



Height and width



Font colour and size etc..



These values are used by XAML when the display is drawn



If these value are changed by the program the appearance of the
element will change
XAML ELEMENT CLASS HIERARCHY



The XAML class hierarchy is quite complex



Everything is based on the
FrameworkElement class which contains the
fundamental properties of all elements



You can derive your own components if you
wish
ELEMENTS AND XAML
GRID CONTAINER ELEMENT
STYLES AND THEMES
APPLYING STYLES TO ELEMENTS


You can set colors and font sizes for elements directly in XAML:



This is generally a BAD IDEA!


Difficult to match builtin styles



Difficult to work with Windows Phone Themes
FOREGROUND COLORS AND THEMES
USE BUILT-IN STYLES
NEW IN VS2012 – APPLY STYLES IN
VISUAL STUDIO
ALIGNMENT OF ELEMENTS


Alignment of UI elements is important!



The magic number in Windows Phone UI is 12px, or multiples of 12


Your page should have a nice, visually crisp line that is 24 pixels from the left of the
device’s screen



Gap between controls should be at least 12px



Align on 12px increments… though 6px or 18px may also be appropriate
FIXING THE ALIGNMENT OF THE RECIPE
PAGE
VISUAL STUDIO AND BLEND ALIGNMENT
GRID



Button at bottom of Designer window can
be used to show a 12px alignment Grid



Useful for setting alignment of elements



Available in Blend



Now also available in Visual Studio
ALIGNMENT GRID OVERLAY


All new projects include AlignmentGrid.png in the Assets folder



You can overlay the grid at design and runtime by uncommenting the
XAML that shows it


Included near the foot of MainPage.xaml



Copy to other pages to show on those
USING THE ALIGNMENT GRID
USE MARGIN PROPERTY TO INSERT
SPACING
DESIGN-TIME DATA
GENERATING DESIGN-TIME DATA
CREATING SAMPLE DATA FROM CLASS
EDIT DESIGN-TIME DATA FORMAT AND
VALUES
EDIT DESIGN-TIME DATA FORMAT AND
VALUES
DATA BINDING
DATA BINDING


Simplest way to program UI controls is to write your own “glue” to get and

set properties of controls




e.g. , textBox1.Text = "Hello, world";

In complex applications, such code quickly becomes unwieldy and error
prone.



Use XAML data binding to link your UI to a class in your application that
contains your application data




A data class that is a source for data binding is called a ViewModel

UI controls can get their display values automatically from properties of

viewmodel class


Changing the property, updates the display



User input can automatically update the bound property of the viewmodel class
DATA BINDING IN XAML



Properties of controls can be bound to a public property of a data object


In the example above, the Text property of the TextBlock is bound to the Directions
property of some data source



Define the data source by setting


The DataContext property of any containing FrameworkElement-derived class (a
containing control, the page, or the frame),



The ItemsSource property of a List control

or
INOTIFYPROPERTYCHANGED


Data objects that take part in One Way or TwoWay binding must
implement the INotifyPropertyChanged interface




This interface requires only that the object publishes the PropertyChanged event

Object must fire the PropertyChanged event whenever the value of one of its public
properties changes



The XAML runtime subscribes to this event and uses it to update databound UI
elements
VIEWMODEL IMPLEMENTATION IN
WINDOWS PHONE 8.0
OBSERVABLE COLLECTIONS
DESIGNING LISTS
LIST ITEM RENDERING


All Lists – ListBox, LongListSelector –
have no default rendering for data
items



If you simply bind the ItemsSource
property to a collection of objects, all

you get displayed in the list for each
item is the name of the data object type
GENERATING LISTS FROM DESIGN-TIME
DATA


In Blend, if you drag a
collection from the Data
window onto the design
surface while in List mode,
it generates a ListBox and

attempts a default
rendering for list items


Manually change to a
phone:LongListSelector in
the XAML
LISTS AND TEMPLATES


All the different elements that affect how a list displays content can be
customised



Each aspect is controlled by a template. For the LongListSelector, there are
many:


GroupFooterTemplate – area that shows at end of each group if LLS used to show
grouped items



GroupHeaderTemplate – area that shows at top of each group if LLS used to show
grouped items




JumpListStyle – layout of items in the Jump List, if enabled



ListFooterTemplate – area that shows at the foot of the whole list





ItemTemplate – layout for each data item

ListHeaderTemplate – area that shows at the top of the whole list

To change the layout of how each data item displays, we need to modify the
ItemTemplate
MODIFYING THE ITEMTEMPLATE IN
BLEND


Right-click on the list control, then access the Edit Additional Templates
menu


Design the controls in the template
DATATEMPLATE IN XAML
Thank You

More Related Content

PDF
Introduction to figma
PDF
Introduction to Figma
PDF
Prototyping in Figma
PPTX
Wireframe and Mockup Templates by Creately
PPT
Wireframes and Interaction Design Documents
PDF
Wireframing Basics - UX and the Design Process by Amber Vasquez
PDF
Introduction to wireframes
PDF
Visual Experience 360 Flex
Introduction to figma
Introduction to Figma
Prototyping in Figma
Wireframe and Mockup Templates by Creately
Wireframes and Interaction Design Documents
Wireframing Basics - UX and the Design Process by Amber Vasquez
Introduction to wireframes
Visual Experience 360 Flex

What's hot (18)

PDF
Wireframing /Prototyping with HTML
PPT
Storyboarding and Wireframe Tools Review
PDF
Save time with indesign
PPTX
Branding office 365 with front end tooling
PPTX
Things you can do to brand Office 365 now
PDF
Graphic design brochure
PPTX
What is power point
PPTX
Customizing WordPress Themes
PPTX
Adobe illustrator CC 2017 introduction _ SEOSKILLS Hyderabad
PPT
Building Blocks For Your Modules Ui
PDF
Wireframes for the Wicked
PPT
Illustrator 2018 Regatta Artwork
PDF
Mockup, wireframe e visual: una breve introduzione
PPT
Illustrator 2018 Identity Package
PDF
Workshop Mock-Ups
PPT
Unify Design & Deliverables
PDF
CorelDraw Training Institute, Ghaziabad
PPT
Illustrator 2018 Campground Icons
Wireframing /Prototyping with HTML
Storyboarding and Wireframe Tools Review
Save time with indesign
Branding office 365 with front end tooling
Things you can do to brand Office 365 now
Graphic design brochure
What is power point
Customizing WordPress Themes
Adobe illustrator CC 2017 introduction _ SEOSKILLS Hyderabad
Building Blocks For Your Modules Ui
Wireframes for the Wicked
Illustrator 2018 Regatta Artwork
Mockup, wireframe e visual: una breve introduzione
Illustrator 2018 Identity Package
Workshop Mock-Ups
Unify Design & Deliverables
CorelDraw Training Institute, Ghaziabad
Illustrator 2018 Campground Icons
Ad

Viewers also liked (10)

PDF
Windows phone 8 session 10
PDF
Windows phone 8 session 13
PDF
Windows phone 8 session 5
PDF
Windows phone 8 session 7
PDF
Windows phone 8 session 1
PDF
Windows phone 8 session 6
PDF
Windows phone 8 session 4
PDF
Windows phone 8 session 9
PDF
Windows phone 8 session 11
PDF
Windows phone 8 session 8
Windows phone 8 session 10
Windows phone 8 session 13
Windows phone 8 session 5
Windows phone 8 session 7
Windows phone 8 session 1
Windows phone 8 session 6
Windows phone 8 session 4
Windows phone 8 session 9
Windows phone 8 session 11
Windows phone 8 session 8
Ad

Similar to Windows phone 8 session 3 (20)

PPTX
02 wp7 building silverlight applications
PPTX
Windows 8 app bar and live tiles
PDF
Xamarin.Forms Hands On Lab (Begineer)
PPTX
WP7 HUB_Introducción a Silverlight
PPTX
Xamarin Development
PDF
Building Accessible Apps using NET MAUI.pdf
PPTX
Silverlight Developer Introduction
PPTX
mobile application development -unit-3-
PPTX
Android ui with xml
PPT
Introduction to silver light
PPTX
XAML and WPF - Dinko Jakovljević
PPTX
New Introductionfor Flash Designers
PDF
Ap quiz app
PPT
Android Bootcamp Tanzania:understanding ui in_android
PPTX
Exploring Adobe Flex
PPT
Btb017 David
PDF
Introductontoxaml
PDF
01 08 - graphical user interface - layouts
PDF
Develop an app for Windows 8 using HTML5
PPTX
Windows phone and azure
02 wp7 building silverlight applications
Windows 8 app bar and live tiles
Xamarin.Forms Hands On Lab (Begineer)
WP7 HUB_Introducción a Silverlight
Xamarin Development
Building Accessible Apps using NET MAUI.pdf
Silverlight Developer Introduction
mobile application development -unit-3-
Android ui with xml
Introduction to silver light
XAML and WPF - Dinko Jakovljević
New Introductionfor Flash Designers
Ap quiz app
Android Bootcamp Tanzania:understanding ui in_android
Exploring Adobe Flex
Btb017 David
Introductontoxaml
01 08 - graphical user interface - layouts
Develop an app for Windows 8 using HTML5
Windows phone and azure

Recently uploaded (20)

PDF
David L Page_DCI Research Study Journey_how Methodology can inform one's prac...
PDF
advance database management system book.pdf
PPTX
Computer Architecture Input Output Memory.pptx
PDF
FORM 1 BIOLOGY MIND MAPS and their schemes
PDF
IGGE1 Understanding the Self1234567891011
PPTX
Introduction to pro and eukaryotes and differences.pptx
PPTX
B.Sc. DS Unit 2 Software Engineering.pptx
PDF
AI-driven educational solutions for real-life interventions in the Philippine...
PDF
Trump Administration's workforce development strategy
PDF
CISA (Certified Information Systems Auditor) Domain-Wise Summary.pdf
PPTX
20th Century Theater, Methods, History.pptx
PPTX
ELIAS-SEZIURE AND EPilepsy semmioan session.pptx
PDF
Chinmaya Tiranga quiz Grand Finale.pdf
DOC
Soft-furnishing-By-Architect-A.F.M.Mohiuddin-Akhand.doc
PDF
RTP_AR_KS1_Tutor's Guide_English [FOR REPRODUCTION].pdf
PDF
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
PDF
Computing-Curriculum for Schools in Ghana
PDF
FOISHS ANNUAL IMPLEMENTATION PLAN 2025.pdf
PDF
احياء السادس العلمي - الفصل الثالث (التكاثر) منهج متميزين/كلية بغداد/موهوبين
PDF
What if we spent less time fighting change, and more time building what’s rig...
David L Page_DCI Research Study Journey_how Methodology can inform one's prac...
advance database management system book.pdf
Computer Architecture Input Output Memory.pptx
FORM 1 BIOLOGY MIND MAPS and their schemes
IGGE1 Understanding the Self1234567891011
Introduction to pro and eukaryotes and differences.pptx
B.Sc. DS Unit 2 Software Engineering.pptx
AI-driven educational solutions for real-life interventions in the Philippine...
Trump Administration's workforce development strategy
CISA (Certified Information Systems Auditor) Domain-Wise Summary.pdf
20th Century Theater, Methods, History.pptx
ELIAS-SEZIURE AND EPilepsy semmioan session.pptx
Chinmaya Tiranga quiz Grand Finale.pdf
Soft-furnishing-By-Architect-A.F.M.Mohiuddin-Akhand.doc
RTP_AR_KS1_Tutor's Guide_English [FOR REPRODUCTION].pdf
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
Computing-Curriculum for Schools in Ghana
FOISHS ANNUAL IMPLEMENTATION PLAN 2025.pdf
احياء السادس العلمي - الفصل الثالث (التكاثر) منهج متميزين/كلية بغداد/موهوبين
What if we spent less time fighting change, and more time building what’s rig...

Windows phone 8 session 3

  • 1. WINDOWS PHONE 8 Designing Windows Phone Applications
  • 2. FOLLOW US Twitter : @chothanihitesh Slideshare : http://www.slideshare.net/Chothani-Hitesh Email : chothani.hitesh@gmail.com Support : windows.chothani@live.com LinkedIn : in.linkedin.com/pub/hiteshchothani/6b/311/2b8 W8 Publisher : AppStudios WP Publisher : AppStudios Website : www.appmobinfotech.com
  • 3. •DESIGNING AN APP •INTRODUCTION TO XAML LAYOUT •STYLES AND THEMES •DESIGN TIME DATA •DATA BINDING •LISTS AND THE LONGLISTSELECTOR
  • 6. DESIGN ON PAPER BEFORE YOU TOUCH THE TOOLS!
  • 8. TOOLS FOR THE JOB: GRAPHICAL DESIGN  A UX designer can use Blend to specify the appearance of the user interface  A version of Blend for the phone is supplied as part of the phone SDK
  • 9. TOOLS FOR THE JOB: CODE CREATION  A Developer can take the user interface design and use Visual Studio build the program to make it work  Visual Studio provides a design environment but it is not as advanced as Blend
  • 10. DESIGN STYLE AND PROGRAMMING  As programmers we probably start of just worrying about making the program work   This is a very good place to start But in modern systems the “look and feel” of the user interface is very important   No matter how good the code is, if the program is hard to use it will not be popular You should pay careful attention to the user interface when making phone programs  If you know any Graphic Designers it is worth getting them on your development team
  • 11. PROJECT TEMPLATES AND COMPONENTS  Windows Phone SDK provides a set of project templates  Each of them maps onto a particular style of application
  • 12. APPLICATION TEMPLATES  Windows Phone App   Basic single page app Windows Phone Databound App  Project for creating a Windows Phone application using List and navigation controls with a basic Model-View-ViewModel architecture  Windows Phone Pivot App   User can “pivot” between different screens by flicking left and right Windows Phone Panorama application  A single panoramic background with pages of controls that the user can pan between
  • 13. APPLICATION TYPES  Three application types provide quite different user experiences  Select the one that you feel is the most appropriate
  • 15. THE CONTOSO COOKBOOK RECIPE DETAILS PAGE  This is a Pivot page that displays details of a recipe  Picture and directions on one pane  Ingredients list on another pane
  • 17. XAML AND OBJECTS  Every XAML element is a declaration of an object   XAML is a way of describing a UI using XML   XAML stands for XML Application Markup Language This is a declarative way of expressing your UI XAML elements == objects in the System.Windows.Controls namespace  Each of the items on the screen of the application shown is a graphical rendering of an object
  • 19. DISPLAY ELEMENT PROPERTIES  Each of the elements contains properties that define how it appears on the screen  Position on the screen  Height and width  Font colour and size etc..  These values are used by XAML when the display is drawn  If these value are changed by the program the appearance of the element will change
  • 20. XAML ELEMENT CLASS HIERARCHY  The XAML class hierarchy is quite complex  Everything is based on the FrameworkElement class which contains the fundamental properties of all elements  You can derive your own components if you wish
  • 24. APPLYING STYLES TO ELEMENTS  You can set colors and font sizes for elements directly in XAML:  This is generally a BAD IDEA!  Difficult to match builtin styles  Difficult to work with Windows Phone Themes
  • 27. NEW IN VS2012 – APPLY STYLES IN VISUAL STUDIO
  • 28. ALIGNMENT OF ELEMENTS  Alignment of UI elements is important!  The magic number in Windows Phone UI is 12px, or multiples of 12  Your page should have a nice, visually crisp line that is 24 pixels from the left of the device’s screen  Gap between controls should be at least 12px  Align on 12px increments… though 6px or 18px may also be appropriate
  • 29. FIXING THE ALIGNMENT OF THE RECIPE PAGE
  • 30. VISUAL STUDIO AND BLEND ALIGNMENT GRID  Button at bottom of Designer window can be used to show a 12px alignment Grid  Useful for setting alignment of elements  Available in Blend  Now also available in Visual Studio
  • 31. ALIGNMENT GRID OVERLAY  All new projects include AlignmentGrid.png in the Assets folder  You can overlay the grid at design and runtime by uncommenting the XAML that shows it  Included near the foot of MainPage.xaml  Copy to other pages to show on those
  • 33. USE MARGIN PROPERTY TO INSERT SPACING
  • 36. CREATING SAMPLE DATA FROM CLASS
  • 37. EDIT DESIGN-TIME DATA FORMAT AND VALUES
  • 38. EDIT DESIGN-TIME DATA FORMAT AND VALUES
  • 40. DATA BINDING  Simplest way to program UI controls is to write your own “glue” to get and set properties of controls   e.g. , textBox1.Text = "Hello, world"; In complex applications, such code quickly becomes unwieldy and error prone.  Use XAML data binding to link your UI to a class in your application that contains your application data   A data class that is a source for data binding is called a ViewModel UI controls can get their display values automatically from properties of viewmodel class  Changing the property, updates the display  User input can automatically update the bound property of the viewmodel class
  • 41. DATA BINDING IN XAML  Properties of controls can be bound to a public property of a data object  In the example above, the Text property of the TextBlock is bound to the Directions property of some data source  Define the data source by setting  The DataContext property of any containing FrameworkElement-derived class (a containing control, the page, or the frame),  The ItemsSource property of a List control or
  • 42. INOTIFYPROPERTYCHANGED  Data objects that take part in One Way or TwoWay binding must implement the INotifyPropertyChanged interface   This interface requires only that the object publishes the PropertyChanged event Object must fire the PropertyChanged event whenever the value of one of its public properties changes  The XAML runtime subscribes to this event and uses it to update databound UI elements
  • 46. LIST ITEM RENDERING  All Lists – ListBox, LongListSelector – have no default rendering for data items  If you simply bind the ItemsSource property to a collection of objects, all you get displayed in the list for each item is the name of the data object type
  • 47. GENERATING LISTS FROM DESIGN-TIME DATA  In Blend, if you drag a collection from the Data window onto the design surface while in List mode, it generates a ListBox and attempts a default rendering for list items  Manually change to a phone:LongListSelector in the XAML
  • 48. LISTS AND TEMPLATES  All the different elements that affect how a list displays content can be customised  Each aspect is controlled by a template. For the LongListSelector, there are many:  GroupFooterTemplate – area that shows at end of each group if LLS used to show grouped items  GroupHeaderTemplate – area that shows at top of each group if LLS used to show grouped items   JumpListStyle – layout of items in the Jump List, if enabled  ListFooterTemplate – area that shows at the foot of the whole list   ItemTemplate – layout for each data item ListHeaderTemplate – area that shows at the top of the whole list To change the layout of how each data item displays, we need to modify the ItemTemplate
  • 49. MODIFYING THE ITEMTEMPLATE IN BLEND  Right-click on the list control, then access the Edit Additional Templates menu  Design the controls in the template