02.designing windows phone application
DESCRIPTION
Windows Phone 8 progammingTRANSCRIPT
![Page 1: 02.Designing Windows Phone Application](https://reader034.vdocuments.net/reader034/viewer/2022051817/5485785fb47959050d8b4e99/html5/thumbnails/1.jpg)
Nguyen Tuan | Microsoft Certified Trainer
![Page 2: 02.Designing Windows Phone Application](https://reader034.vdocuments.net/reader034/viewer/2022051817/5485785fb47959050d8b4e99/html5/thumbnails/2.jpg)
• Windows Design
• Designing an Applications
• Working with XAML Layout
• Styles & Themes in WP8.
• Design Considerations
• Model-View-ViewModel
• Application Lifecycle
Agenda
![Page 3: 02.Designing Windows Phone Application](https://reader034.vdocuments.net/reader034/viewer/2022051817/5485785fb47959050d8b4e99/html5/thumbnails/3.jpg)
8/16/2014 3
Windows Phone Design
![Page 4: 02.Designing Windows Phone Application](https://reader034.vdocuments.net/reader034/viewer/2022051817/5485785fb47959050d8b4e99/html5/thumbnails/4.jpg)
Metro styles or Windows Phone Design Style?
• The Windows Phone team have taken a lot of trouble over the look and feel of the phone
• They have created a design style, inspired by metropolitan signage, to express this
• Programs on the phone should reflect this style
4
![Page 5: 02.Designing Windows Phone Application](https://reader034.vdocuments.net/reader034/viewer/2022051817/5485785fb47959050d8b4e99/html5/thumbnails/5.jpg)
![Page 6: 02.Designing Windows Phone Application](https://reader034.vdocuments.net/reader034/viewer/2022051817/5485785fb47959050d8b4e99/html5/thumbnails/6.jpg)
Take care of the details
Make it safe and reliable
Uncompromising Sensitivity to Weight, Balance and Scale
Align to the grid
![Page 7: 02.Designing Windows Phone Application](https://reader034.vdocuments.net/reader034/viewer/2022051817/5485785fb47959050d8b4e99/html5/thumbnails/7.jpg)
Principle: Be fast and fluid
Life is mobile
Delight with motion
Design for touch
Intuitive interaction
Be responsive and ready
Immersive and compelling
![Page 8: 02.Designing Windows Phone Application](https://reader034.vdocuments.net/reader034/viewer/2022051817/5485785fb47959050d8b4e99/html5/thumbnails/8.jpg)
Principles: Do more with less
Be great at something
Focused and direct
Content before chrome
Inspire confidence
![Page 9: 02.Designing Windows Phone Application](https://reader034.vdocuments.net/reader034/viewer/2022051817/5485785fb47959050d8b4e99/html5/thumbnails/9.jpg)
Principle: Authentically Digital
Don’t Try to be What It’s NOT
Cloud connected
Dynamic and alive
Beautiful use of typography
Bold vibrant colours
Motion
![Page 10: 02.Designing Windows Phone Application](https://reader034.vdocuments.net/reader034/viewer/2022051817/5485785fb47959050d8b4e99/html5/thumbnails/10.jpg)
Principle: Win as one
Fit into the UI model
Reduce redundancy
Work together to complete scenarios
Tools and templates are designed to scale
![Page 11: 02.Designing Windows Phone Application](https://reader034.vdocuments.net/reader034/viewer/2022051817/5485785fb47959050d8b4e99/html5/thumbnails/11.jpg)
Principles
Pride in craftsmanship
Be Fast and Fluid
Win as One
Do More with Less
Authentically Digital
![Page 12: 02.Designing Windows Phone Application](https://reader034.vdocuments.net/reader034/viewer/2022051817/5485785fb47959050d8b4e99/html5/thumbnails/12.jpg)
![Page 13: 02.Designing Windows Phone Application](https://reader034.vdocuments.net/reader034/viewer/2022051817/5485785fb47959050d8b4e99/html5/thumbnails/13.jpg)
13
![Page 14: 02.Designing Windows Phone Application](https://reader034.vdocuments.net/reader034/viewer/2022051817/5485785fb47959050d8b4e99/html5/thumbnails/14.jpg)
Paper prototyping
![Page 15: 02.Designing Windows Phone Application](https://reader034.vdocuments.net/reader034/viewer/2022051817/5485785fb47959050d8b4e99/html5/thumbnails/15.jpg)
User Experience Bar Document
![Page 16: 02.Designing Windows Phone Application](https://reader034.vdocuments.net/reader034/viewer/2022051817/5485785fb47959050d8b4e99/html5/thumbnails/16.jpg)
![Page 17: 02.Designing Windows Phone Application](https://reader034.vdocuments.net/reader034/viewer/2022051817/5485785fb47959050d8b4e99/html5/thumbnails/17.jpg)
![Page 18: 02.Designing Windows Phone Application](https://reader034.vdocuments.net/reader034/viewer/2022051817/5485785fb47959050d8b4e99/html5/thumbnails/18.jpg)
18
![Page 19: 02.Designing Windows Phone Application](https://reader034.vdocuments.net/reader034/viewer/2022051817/5485785fb47959050d8b4e99/html5/thumbnails/19.jpg)
19
![Page 20: 02.Designing Windows Phone Application](https://reader034.vdocuments.net/reader034/viewer/2022051817/5485785fb47959050d8b4e99/html5/thumbnails/20.jpg)
20
![Page 21: 02.Designing Windows Phone Application](https://reader034.vdocuments.net/reader034/viewer/2022051817/5485785fb47959050d8b4e99/html5/thumbnails/21.jpg)
21
![Page 22: 02.Designing Windows Phone Application](https://reader034.vdocuments.net/reader034/viewer/2022051817/5485785fb47959050d8b4e99/html5/thumbnails/22.jpg)
22
![Page 23: 02.Designing Windows Phone Application](https://reader034.vdocuments.net/reader034/viewer/2022051817/5485785fb47959050d8b4e99/html5/thumbnails/23.jpg)
23
![Page 24: 02.Designing Windows Phone Application](https://reader034.vdocuments.net/reader034/viewer/2022051817/5485785fb47959050d8b4e99/html5/thumbnails/24.jpg)
24
![Page 25: 02.Designing Windows Phone Application](https://reader034.vdocuments.net/reader034/viewer/2022051817/5485785fb47959050d8b4e99/html5/thumbnails/25.jpg)
Introduction to XAML Layout
8/16/201425
![Page 26: 02.Designing Windows Phone Application](https://reader034.vdocuments.net/reader034/viewer/2022051817/5485785fb47959050d8b4e99/html5/thumbnails/26.jpg)
![Page 27: 02.Designing Windows Phone Application](https://reader034.vdocuments.net/reader034/viewer/2022051817/5485785fb47959050d8b4e99/html5/thumbnails/27.jpg)
Pivot Pages• <phone:PhoneApplicationPage
x:Class="ContosoCookbook.RecipeDetailPage"... />
<Grid x:Name="LayoutRoot" Background="Transparent"><phone:Pivot Title=“PIVOT APPLICATION">
<!--Pivot item one--><phone:PivotItem Header=“item1">
<Grid></Grid>
</phone:PivotItem><!--Pivot item two--><phone:PivotItem Header=“item2">
<Grid></Grid>
</phone:PivotItem></phone:Pivot>
</Grid></phone:PhoneApplicationPage>
27
Pivot Control
Pivot Headers
Pivot Items Control
![Page 28: 02.Designing Windows Phone Application](https://reader034.vdocuments.net/reader034/viewer/2022051817/5485785fb47959050d8b4e99/html5/thumbnails/28.jpg)
![Page 29: 02.Designing Windows Phone Application](https://reader034.vdocuments.net/reader034/viewer/2022051817/5485785fb47959050d8b4e99/html5/thumbnails/29.jpg)
29
![Page 30: 02.Designing Windows Phone Application](https://reader034.vdocuments.net/reader034/viewer/2022051817/5485785fb47959050d8b4e99/html5/thumbnails/30.jpg)
30
![Page 31: 02.Designing Windows Phone Application](https://reader034.vdocuments.net/reader034/viewer/2022051817/5485785fb47959050d8b4e99/html5/thumbnails/31.jpg)
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
31
FrameworkElement
TextBlock
TextBox ContentControl
ButtonBase
Button
Control
![Page 32: 02.Designing Windows Phone Application](https://reader034.vdocuments.net/reader034/viewer/2022051817/5485785fb47959050d8b4e99/html5/thumbnails/32.jpg)
Elements and XAML
32
<!--Pivot item one--><phone:PivotItem Header="recipe"><Grid><Grid.RowDefinitions><RowDefinition Height="240"/><RowDefinition Height="*"/><RowDefinition Height="Auto"/>
</Grid.RowDefinitions><Image x:Name="RecipeImage" Stretch="UniformToFill"/><ScrollViewer Grid.Row="1"><TextBlock x:Name="DirectionsTextBlock" TextWrapping="Wrap" />
</ScrollViewer><StackPanel Grid.Row="2" Orientation="Horizontal"><TextBlock Text="Prep time: " /><TextBlock MinWidth="200" x:Name="PrepTimeTextBlock" />
</StackPanel></Grid>
</phone:PivotItem>
![Page 33: 02.Designing Windows Phone Application](https://reader034.vdocuments.net/reader034/viewer/2022051817/5485785fb47959050d8b4e99/html5/thumbnails/33.jpg)
Grid Container Element
33
<!--Pivot item one--><phone:PivotItem Header="recipe"><Grid><Grid.RowDefinitions><RowDefinition Height="240"/><RowDefinition Height="*"/><RowDefinition Height="Auto"/>
</Grid.RowDefinitions><Image x:Name="RecipeImage" Stretch="UniformToFill"/><ScrollViewer Grid.Row="1"><TextBlock x:Name="DirectionsTextBlock" TextWrapping="Wrap" />
</ScrollViewer><StackPanel Grid.Row="2" Orientation="Horizontal" ><TextBlock Text="Prep time: " /><TextBlock MinWidth="200" x:Name="PrepTimeTextBlock" />
</StackPanel></Grid>
</phone:PivotItem>
![Page 34: 02.Designing Windows Phone Application](https://reader034.vdocuments.net/reader034/viewer/2022051817/5485785fb47959050d8b4e99/html5/thumbnails/34.jpg)
8/16/2014 34
![Page 35: 02.Designing Windows Phone Application](https://reader034.vdocuments.net/reader034/viewer/2022051817/5485785fb47959050d8b4e99/html5/thumbnails/35.jpg)
• 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
Visual Studio and Blend Alignment Grid
8/16/2014 35
![Page 36: 02.Designing Windows Phone Application](https://reader034.vdocuments.net/reader034/viewer/2022051817/5485785fb47959050d8b4e99/html5/thumbnails/36.jpg)
• 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
<!--Uncomment to see an alignment grid to help ensure your controls are
aligned on common boundaries. The image has a top margin of -32px to
account for the System Tray. Set this to 0 (or remove the margin altogether)
if the System Tray is hidden.
Before shipping remove this XAML and the image itself.-->
<!--<Image Source="/Assets/AlignmentGrid.png" VerticalAlignment="Top" Height="800" Width="480" Margin="0,-32,0,0" Grid.Row="0"
Grid.RowSpan="2" IsHitTestVisible="False" />-->
Alignment Grid Overlay
36
![Page 37: 02.Designing Windows Phone Application](https://reader034.vdocuments.net/reader034/viewer/2022051817/5485785fb47959050d8b4e99/html5/thumbnails/37.jpg)
Using the Alignment Grid
8/16/2014 37
<Image Source="/Assets/AlignmentGrid.png" VerticalAlignment="Top"Height="800" Width="480" Margin="0,-32,0,0"Grid.Row="0" Grid.RowSpan="2" IsHitTestVisible="False" />
![Page 38: 02.Designing Windows Phone Application](https://reader034.vdocuments.net/reader034/viewer/2022051817/5485785fb47959050d8b4e99/html5/thumbnails/38.jpg)
<phone:PivotItem Header="recipe"><Grid>
<Grid.RowDefinitions><RowDefinition Height="240"/><RowDefinition Height="*"/><RowDefinition Height="Auto"/>
</Grid.RowDefinitions><Image x:Name="RecipeImage" Margin="12" Stretch="UniformToFill"/><ScrollViewer Grid.Row="1">
<TextBlock x:Name="DirectionsTextBlock" TextWrapping="Wrap" Margin="12,0,0,0" /></ScrollViewer><StackPanel Grid.Row="2" Orientation="Horizontal" Margin="12" HorizontalAlignment="Left" >
<TextBlock Text="Prep time: " Margin="0" /><TextBlock x:Name="PrepTimeTextBlock" />
</StackPanel></Grid>
</phone:PivotItem>
Use Margin Property to Insert Spacing
38
![Page 39: 02.Designing Windows Phone Application](https://reader034.vdocuments.net/reader034/viewer/2022051817/5485785fb47959050d8b4e99/html5/thumbnails/39.jpg)
DemoGridsRowsAndColumns
![Page 40: 02.Designing Windows Phone Application](https://reader034.vdocuments.net/reader034/viewer/2022051817/5485785fb47959050d8b4e99/html5/thumbnails/40.jpg)
Styles and Themes
8/16/2014
![Page 41: 02.Designing Windows Phone Application](https://reader034.vdocuments.net/reader034/viewer/2022051817/5485785fb47959050d8b4e99/html5/thumbnails/41.jpg)
• You can set colors and font sizes for elements directly in XAML:<ScrollViewer Grid.Row="1"><TextBlock x:Name="DirectionsTextBlock" TextWrapping="Wrap"
Margin="12,0,0,0" Foreground="White" FontSize="12" /></ScrollViewer><StackPanel Grid.Row="2" Orientation="Horizontal" Margin="12" HorizontalAlignment="Left" ><TextBlock Text="Prep time: " Margin="0" Foreground="White"/><TextBlock x:Name="PrepTimeTextBlock" Foreground="LightGray" FontSize="24" />
</StackPanel>
• This is generally a BAD IDEA!• Difficult to match builtin styles
• Difficult to work with Windows Phone Themes
Applying Styles to Elements
8/16/2014 41
![Page 42: 02.Designing Windows Phone Application](https://reader034.vdocuments.net/reader034/viewer/2022051817/5485785fb47959050d8b4e99/html5/thumbnails/42.jpg)
Foreground Colors and Themes
8/16/2014 42
![Page 43: 02.Designing Windows Phone Application](https://reader034.vdocuments.net/reader034/viewer/2022051817/5485785fb47959050d8b4e99/html5/thumbnails/43.jpg)
<phone:PivotItem Header="recipe"><Grid><Grid.RowDefinitions><RowDefinition Height="240"/><RowDefinition Height="*"/><RowDefinition Height="Auto"/>
</Grid.RowDefinitions><Image x:Name="RecipeImage" Margin="12" Stretch="UniformToFill"/><ScrollViewer Grid.Row="1"><TextBlock x:Name="DirectionsTextBlock" TextWrapping="Wrap"
Margin="12,0,0,0" Style="{StaticResource PhoneTextSmallStyle}" /></ScrollViewer><StackPanel Grid.Row="2" Orientation="Horizontal" Margin="12" HorizontalAlignment="Left" ><TextBlock Text="Prep time: " Margin="0" Style="{StaticResource PhoneTextNormalStyle}" /><TextBlock x:Name="PrepTimeTextBlock" Style="{StaticResource PhoneTextSubtleStyle}" />
</StackPanel></Grid>
</phone:PivotItem>
Use Built-In Styles
43
![Page 44: 02.Designing Windows Phone Application](https://reader034.vdocuments.net/reader034/viewer/2022051817/5485785fb47959050d8b4e99/html5/thumbnails/44.jpg)
New in VS2012 – Apply Styles in Visual Studio
8/16/2014 44
![Page 45: 02.Designing Windows Phone Application](https://reader034.vdocuments.net/reader034/viewer/2022051817/5485785fb47959050d8b4e99/html5/thumbnails/45.jpg)
DemoAlignmentAndMargins
![Page 46: 02.Designing Windows Phone Application](https://reader034.vdocuments.net/reader034/viewer/2022051817/5485785fb47959050d8b4e99/html5/thumbnails/46.jpg)
The MVVM pattern
![Page 47: 02.Designing Windows Phone Application](https://reader034.vdocuments.net/reader034/viewer/2022051817/5485785fb47959050d8b4e99/html5/thumbnails/47.jpg)
From MVC
Model View
Controller
![Page 48: 02.Designing Windows Phone Application](https://reader034.vdocuments.net/reader034/viewer/2022051817/5485785fb47959050d8b4e99/html5/thumbnails/48.jpg)
Presentation Model(ViewModel)
To MVVM
Model View
![Page 49: 02.Designing Windows Phone Application](https://reader034.vdocuments.net/reader034/viewer/2022051817/5485785fb47959050d8b4e99/html5/thumbnails/49.jpg)
The relationships
View
ViewModel
DataBinding Commands ServicesMessages
Model
![Page 50: 02.Designing Windows Phone Application](https://reader034.vdocuments.net/reader034/viewer/2022051817/5485785fb47959050d8b4e99/html5/thumbnails/50.jpg)
Commands
“Point of entry” for a method Can be data boundICommand interface
Execute methodCanExecute methodCanExecuteChanged event
![Page 51: 02.Designing Windows Phone Application](https://reader034.vdocuments.net/reader034/viewer/2022051817/5485785fb47959050d8b4e99/html5/thumbnails/51.jpg)
Implementing commands
It’s quite a lot of workMost toolkits and frameworks have a “relay” implementation
RelayCommand (MVVM Light)DelegateCommand (PRISM)…
![Page 52: 02.Designing Windows Phone Application](https://reader034.vdocuments.net/reader034/viewer/2022051817/5485785fb47959050d8b4e99/html5/thumbnails/52.jpg)
Why MVVM?
Model
public class KittenObject{
public KittenObject() { }public string KittenImage { get; set; }public string KittenName { get; set; }public string KittenAge { get; set; }
}
![Page 53: 02.Designing Windows Phone Application](https://reader034.vdocuments.net/reader034/viewer/2022051817/5485785fb47959050d8b4e99/html5/thumbnails/53.jpg)
Why MVVM?
ViewModel
public class MainViewModel : INotifyPropertyChanged{
public event PropertyChangedEventHandler PropertyChanged;private void NotifyPropertyChanged(String propertyName){
PropertyChangedEventHandler handler = PropertyChanged;if (null != handler){
handler(this, new PropertyChangedEventArgs(propertyName));}
}}
![Page 54: 02.Designing Windows Phone Application](https://reader034.vdocuments.net/reader034/viewer/2022051817/5485785fb47959050d8b4e99/html5/thumbnails/54.jpg)
Why MVVM?
ViewModel
private string _sampleProperty = "my start value";public string SampleProperty{
get { return _sampleProperty; }set{
_sampleProperty = value;NotifyPropertyChanged("SampleProperty");
}}
![Page 55: 02.Designing Windows Phone Application](https://reader034.vdocuments.net/reader034/viewer/2022051817/5485785fb47959050d8b4e99/html5/thumbnails/55.jpg)
Why MVVM?
View
<TextBlock Text="{Binding SampleProperty, Mode=TwoWay}" />
![Page 56: 02.Designing Windows Phone Application](https://reader034.vdocuments.net/reader034/viewer/2022051817/5485785fb47959050d8b4e99/html5/thumbnails/56.jpg)
Why MVVM?
View
<phone:LongListSelectorItemsSource="{Binding MyListOfItems}"SelectedItem="{Binding MySelectedItem, Mode=TwoWay}" />
![Page 57: 02.Designing Windows Phone Application](https://reader034.vdocuments.net/reader034/viewer/2022051817/5485785fb47959050d8b4e99/html5/thumbnails/57.jpg)
Model-View-ViewModel
View
ViewModel
Commands
Data Binding
Model
![Page 58: 02.Designing Windows Phone Application](https://reader034.vdocuments.net/reader034/viewer/2022051817/5485785fb47959050d8b4e99/html5/thumbnails/58.jpg)
Data Binding Modes
• The Mode property determines how changes are synchronized between the target control and data source
• OneTime – Control property is set once to the data value and any subsequent changes are ignored
• OneWay – Changes in the data object are synchronized to the control property, but changes in the control are not synchronized back to the data object
• TwoWay – Changes in the data object are synchronized to the control property and vice-versa
<TextBlock x:Name="ContentText" Text="{Binding LineThree, Mode=OneWay}"/>
![Page 59: 02.Designing Windows Phone Application](https://reader034.vdocuments.net/reader034/viewer/2022051817/5485785fb47959050d8b4e99/html5/thumbnails/59.jpg)
• In the XAML snippet, make sure that the DataContext is set to an instance of the ViewModel class.
• The ViewModel class exposes an AddCommand property of type AddItemCommand
• The ViewModel is responsible for actually adding a new item
Commands
<Button Command="{Binding AddCommand}"
CommandParameter="Untitled" Content="Button"
HorizontalAlignment="Center"
VerticalAlignment="Center"/>
class AddItemCommand : ICommand
{
ViewModel _viewModel;
public AddItemCommand(ViewModel viewModel)
{
_viewModel = viewModel;
}
public event EventHandler CanExecuteChanged;
public bool CanExecute(object parameter)
{
return true;
}
public void Execute(object title)
{
_viewModel.AddItem(title as string);
}
}
![Page 60: 02.Designing Windows Phone Application](https://reader034.vdocuments.net/reader034/viewer/2022051817/5485785fb47959050d8b4e99/html5/thumbnails/60.jpg)
MVVM Benefits
• Reuse Model and View-Model code
• Test the ViewModel with unit tests
• Maintainability
• Can show design-time data in Expression Blend and the Visual Studio designer
![Page 61: 02.Designing Windows Phone Application](https://reader034.vdocuments.net/reader034/viewer/2022051817/5485785fb47959050d8b4e99/html5/thumbnails/61.jpg)
DemoSimpleDataBinding
![Page 62: 02.Designing Windows Phone Application](https://reader034.vdocuments.net/reader034/viewer/2022051817/5485785fb47959050d8b4e99/html5/thumbnails/62.jpg)
MVVM Libraries
http://caliburnmicro.codeplex.com/http://mvvmlight.codeplex.com/
Rob EisenbergLaurent Bugnion
![Page 63: 02.Designing Windows Phone Application](https://reader034.vdocuments.net/reader034/viewer/2022051817/5485785fb47959050d8b4e99/html5/thumbnails/63.jpg)
![Page 64: 02.Designing Windows Phone Application](https://reader034.vdocuments.net/reader034/viewer/2022051817/5485785fb47959050d8b4e99/html5/thumbnails/64.jpg)
Not running
Running
Launching
Running
![Page 65: 02.Designing Windows Phone Application](https://reader034.vdocuments.net/reader034/viewer/2022051817/5485785fb47959050d8b4e99/html5/thumbnails/65.jpg)
Not running
Running
LaunchingClosing
Deactivating
Dormant
ExitApplication_Closing
DeactivateApplication_Deactivated
Closing vs Deactivating
Dormant
![Page 66: 02.Designing Windows Phone Application](https://reader034.vdocuments.net/reader034/viewer/2022051817/5485785fb47959050d8b4e99/html5/thumbnails/66.jpg)
Not running
Running
LaunchingClosing
DeactivatingActivating
Dormant
Dormant
![Page 67: 02.Designing Windows Phone Application](https://reader034.vdocuments.net/reader034/viewer/2022051817/5485785fb47959050d8b4e99/html5/thumbnails/67.jpg)
Tombstoned
Not running
Running
LaunchingClosing
DeactivatingActivating
Dormant
Tombstoned
![Page 68: 02.Designing Windows Phone Application](https://reader034.vdocuments.net/reader034/viewer/2022051817/5485785fb47959050d8b4e99/html5/thumbnails/68.jpg)
Tombstoned
Not running
Running
LaunchingClosing
DeactivatingActivating
Dormant
Tombstoned or Dormant?
private void Application_Activated(object sender, ActivatedEventArgs e){
if (e.IsApplicationInstancePreserved){
// Dormant - objects in memory intact}else{
// Tombstoned - need to reload}
}
![Page 69: 02.Designing Windows Phone Application](https://reader034.vdocuments.net/reader034/viewer/2022051817/5485785fb47959050d8b4e99/html5/thumbnails/69.jpg)
Fast Application Resume
Tombstoned
Not running
Running
LaunchingClosing
DeactivatingActivating
Dormant
![Page 70: 02.Designing Windows Phone Application](https://reader034.vdocuments.net/reader034/viewer/2022051817/5485785fb47959050d8b4e99/html5/thumbnails/70.jpg)
Enabling FAR in Properties\WMAppManifest.xml
<Tasks><DefaultTask Name ="_default" NavigationPage="MainPage.xaml">
<BackgroundExecution><ExecutionType Name="LocationTracking" />
</BackgroundExecution></DefaultTask>
</Tasks>
<Tasks><DefaultTask Name ="_default“ NavigationPage="MainPage.xaml“ />
</Tasks>
![Page 71: 02.Designing Windows Phone Application](https://reader034.vdocuments.net/reader034/viewer/2022051817/5485785fb47959050d8b4e99/html5/thumbnails/71.jpg)
Why Not Use FAR All The Time?
Launch from Start
Page 1 Page 2
Launch from Start
Page 2deep link
![Page 72: 02.Designing Windows Phone Application](https://reader034.vdocuments.net/reader034/viewer/2022051817/5485785fb47959050d8b4e99/html5/thumbnails/72.jpg)
Why Not Use FAR All The Time?
Launch from Start
Page 1 Page 2
Launch from Start
Page 2FARPage 1
![Page 73: 02.Designing Windows Phone Application](https://reader034.vdocuments.net/reader034/viewer/2022051817/5485785fb47959050d8b4e99/html5/thumbnails/73.jpg)
Demo1. AppLifeCycle2. Lifetime
![Page 74: 02.Designing Windows Phone Application](https://reader034.vdocuments.net/reader034/viewer/2022051817/5485785fb47959050d8b4e99/html5/thumbnails/74.jpg)
Review
• Windows Phone Design has five key principles:• Clean, Light, Open, Fast• Celebrate Typography• Alive in Motion• Content, Not Chrome• Authentically Digital
• WP8 use XAML to express the design of their user interface• The design is expressed in a XAML text file that defines and arranges display elements
• There are a set of project templates for applications based on the Windows Phone design
• In Blend, you can create design-time data to aid during design of a UI• Databinding in XAML allows you to declaratively markup UI elements to link
them to a property of a data class• List controls define layout using XAML Templates