WP7 MVVM lightning talk
-
Upload
rob-bollons -
Category
Technology
-
view
72 -
download
0
description
Transcript of WP7 MVVM lightning talk
7MVVM DEVELOPMENTWindows Phone®
In Approximately 10 Minutes
tools
Visual Studio 2010
WP7 SDK 7.1
app hub membershi
pMVVM
Framework
XAMLexample
page
content
XAML
<phone:PhoneApplicationPage x:Class="My_RSS.Views.AddFeed" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone" xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit" FontFamily="{StaticResource PhoneFontFamilyNormal}" FontSize="{StaticResource PhoneFontSizeNormal}" Foreground="{StaticResource PhoneForegroundBrush}" SupportedOrientations="Portrait" Orientation="Portrait" mc:Ignorable="d" d:DesignHeight="696" d:DesignWidth="480" shell:SystemTray.IsVisible="True">
example
page
content
XAML <shell:SystemTray.ProgressIndicator> <shell:ProgressIndicator IsIndeterminate="true" IsVisible="{Binding IsLoadingProgressVisible}" Text="{Binding ProgressText}" /> </shell:SystemTray.ProgressIndicator> <Grid x:Name="LayoutRoot" Background="Transparent"> <Grid.RowDefinitions> <RowDefinition Height="Auto"/> <RowDefinition Height="*"/> </Grid.RowDefinitions> <StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="12,17,0,28"> <TextBlock x:Name="ApplicationTitle" Text="{Binding AppTitle}" Style="{StaticResource PhoneTextNormalStyle}"/> <TextBlock x:Name="PageTitle" Text="add feed" Margin="9,-7,0,0" Style="{StaticResource PhoneTextTitle1Style}"/> </StackPanel> <Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0"> <StackPanel> <toolkit:PhoneTextBox Hint="RSS Feed URL" x:Name="feedUrl" Text="{Binding FeedUrl}" /> </StackPanel> </Grid> </Grid> <phone:PhoneApplicationPage.ApplicationBar> <shell:ApplicationBar x:Name="saveFeed" IsMenuEnabled="True"> <shell:ApplicationBarIconButton IsEnabled="False" x:Name="saveButton" IconUri="/Content/Themes/Dark/appbar.save.rest.png" Text="save" Click="saveButton_Click" /> </shell:ApplicationBar> </phone:PhoneApplicationPage.ApplicationBar>
example
page
content
MVVM
View-Model
Model View
Commands(e.g. events)
Data Binding(two way)
MVVMmodelviewview-model
MVVMmodelviewview-model
MVVMmodelviewview-model
solution bitsApp.xaml.cs & App.xaml– Tombstoning handlers– Static application resources
WMAppManifest.xml– Tile information– Splash screen– Scheduled tasks – App capabilities (camera, location etc…)
questions
Thanks for listening