15. Metro Design and Typeface
The Windows Phone OS 7 User Interface (UI) is based on a design that is
internally named Metro, and echoes the visual language of airport and metro
system signage in its design and typeface.
16.
17. Tiles
Tiles are links to applications, features, functions
and individual items (such as contacts, web
pages, applications or media items). Users can
add, rearrange, or remove Tiles. Tiles are
dynamic and update in real time
Tiles that use the Tile Notification feature can
update the Tile graphic or title text, or
increment a counter.
18. Themes
A Theme is a user-selected combination of background and accent colors that
personalizes the visual elements on a Windows Phone for that user.
20. Silverlight Essentials
Xaml – Extensible Application Markup Language (ala HTML types)
Xaml.cs – Backend Program that controls the UI state and data (ala JavaScript)
23. Panorama Application
Unlike standard applications that are designed to fit within the confines of
the phone screen, these applications offer a unique way to view controls,
data, and services by using a long horizontal canvas that extends beyond
the confines of the screen
24. Pivot Application
A pivot control provides a quick way to manage views or pages within the
application. The control places individual views horizontally next to each other,
and manages the left and right navigation. Flicking or panning horizontally on
the page cycles the pivot functionality.
26. Isolated Storage - Defined
Isolated storage enables managed applications to create and maintain local
storage. Application developers have the ability to store data locally on the
phone, leveraging all the benefits of isolated storage including protecting data
from other applications.
27. Isolated Storing
System.IO.IsolatedStorage
using (IsolatedStorageFile isoStorage = IsolatedStorageFile.GetUserStoreForApplication())
{
using (IsolatedStorageFileStream stream = isoStorage.OpenFile("xconfpune.dat",
FileMode.OpenOrCreate))
{
DataContractSerializer serializer = new DataContractSerializer(typeof(XConfSession));
XConfSession info = serializer.ReadObject(stream) as XConfSession;
}
}
29. features
Not Supported:
• Duplex communication over HTTP
• WCF Data Services.
• Custom bindings, sockets, RSS and Atom feeds
• WS proxy cannot be generated dynamically using ‘CreateChannel’.
Supported:
• Asynchronous communication over HTTP
• Silverlight 3 SDK feature support for WCF.
• Compile time proxy through ‘Add Service Reference’ in VS2010
31. Data Binding - Defined
Data binding is a way of linking user input to program data automatically.
a. User input will fire property changed events.
b. Changing a property in the program will update the display.
32. Data Binding - Setting
Defining the data source:
a. DataContext property of any containing Element
b. ItemSource of a List control – (ObservableCollection type)
<phone:PhoneApplicationPage.Resources>
<local:DamageClass x:Key="DamageClass" />
</phone:PhoneApplicationPage.Resources>
<!--LayoutRoot contains the root grid where all other page content is placed-->
<Grid x:Name="LayoutRoot" Background="Transparent" DataContext="{StaticResource DamageClass}">
Binding the Data:
<TextBlock Grid.Column="0" Text="{Binding TimeSlot}" Style="{StaticResource PhoneTextSubtleStyle}"/>
33. Data Binding - Modes
Mode determines how changes are synchronized:
a. OneTime
b. OneWay
c. TwoWay
35. Application Bar - Defined
The Application Bar provides a place for developers to display up to four of the
most common application tasks and views as icon buttons.
36. Application Bar
<shell:ApplicationBar IsVisible="True" IsMenuEnabled="True">
<shell:ApplicationBarIconButton IconUri="/Images/appbar_button1.png" Text="Button 1"/>
<shell:ApplicationBarIconButton IconUri="/Images/appbar_button2.png" Text="Button 2"/>
<shell:ApplicationBar.MenuItems>
<shell:ApplicationBarMenuItem Text="MenuItem 1"/>
<shell:ApplicationBarMenuItem Text="MenuItem 2"/>
</shell:ApplicationBar.MenuItems>
</shell:ApplicationBar>
Icons need to be developed only in white, Windows Phone API will take care of
converting it into respective dark color when the theme changes from dark to
light.
Text hint is mandatory. A maximum of 4 icons are allowed in the application bar.
A maximum of 5 menu items are allowed under the application bar.
39. Tombstoning
The procedure in which the operating system terminates an application’s process
when the user navigates away from the application. The operating system maintains
state information about the application. If the user navigates back to the application,
the operating system restarts the application process and passes the state data back
to the application.
40. App.xaml
Application_Launching
- Triggered on starting the app, not on activation after being tomstoned.
Application_Activated
- Triggered on reactivating the app after being tomstoned.
Application_Deactivated
- Triggered when an app is being tomstoned.
Application_Closing
- Triggered on closing the application.
42. Launchers and Choosers - Defined
The Launcher and Chooser APIs invoke distinct built-in applications that replace
the currently running application.
Launcher:
A Launcher is an API that launches one of the built-in applications through
which a user completes a task, and in which no data is returned to the calling
application. E.g. Phone Call
Chooser:
A Chooser is an API that launches one of the built-in applications through which
a user completes a task, and which returns some kind of data to the calling
application E.g. Choosing a Photo
46. Location Services
The Location Service allows you to create location-aware applications. The service
obtains location data from multiple sources such as GPS, Wi-Fi, and cellular.
System.Device.Location
GeoCoordinateWatcher
// The watcher variable was declared as type GeoCoordinateWatcher.
if (watcher == null)
{
watcher = new GeoCoordinateWatcher(GeoPositionAccuracy.High); // using high accuracy
watcher.MovementThreshold = 20; // to ignore noise in the signal in metres.
watcher.StatusChanged += new EventHandler<GeoPositionStatusChangedEventArgs>(w_StatusChanged);
watcher.PositionChanged += new
EventHandler<GeoPositionChangedEventArgs<GeoCoordinate>>(w_PositionChanged);
}
watcher.Start();
47. GeoPosition Statuses
switch (e.Status) {
case GeoPositionStatus.Disabled:
// The Location Service is disabled or unsupported. Check to see if the user has disabled the
Location Service.
if (watcher.Permission == GeoPositionPermission.Denied) {
// The user has disabled the Location Service on their device.
} else {
//location is not functioning on this device
}
break;
case GeoPositionStatus.Initializing:
// The Location Service is initializing.
break;
case GeoPositionStatus.NoData:
// The Location Service is working, but it cannot get location data.
break;
case GeoPositionStatus.Ready:
// The Location Service is working and is receiving location data.
break;
}
49. Push Notifications
Push Notification Service in Windows Phone offers a dedicated, and persistent
channel to send information and updates to a mobile application from a web service.
50. Types of Push Notifications
1. Tile Notification
1. Image, Count, Title can be notified
2. Toast Notification
1. Displayed on top of the screen for 10 seconds.
3. Raw Notification
1. To send raw information to application if running.
51. Send a push notification to service
// The URI that the Push Notification Service returns to the Push Client when creating a
notification channel.
string subscriptionUri = “http://hostedlive.com/hello"
HttpWebRequest sendNotificationRequest = (HttpWebRequest)WebRequest.Create(subscriptionUri);
// HTTP POST is the only allowed method to send the notification.
sendNotificationRequest.Method = "POST";
// The custom header X-MessageID uniquely identifies a message. If it is present, the same value is
returned in the notification response.
sendNotificationRequest.Headers.Add("X-MessageID", "<UUID>");
// Sets the web request content length.
sendNotificationRequest.ContentLength = notificationMessage.Length;
// Sets the notification payload to send.
byte[] notificationMessage = new byte[] {<payload>};
using (Stream requestStream = sendNotificationRequest.GetRequestStream())
{
requestStream.Write(notificationMessage, 0, notificationMessage.Length);
}
// Sends the notification and gets the response. HttpWebResponse response =
(HttpWebResponse)sendNotificationRequest.GetResponse();
53. Receive a Push Notification
Microsoft.Phone.Notification
HttpNotificationChannel
// Only one notification channel name is supported per application.
channel = new HttpNotificationChannel("channel","www.contoso.com");
channel.Open();
//receiving a raw notification
channel.HttpNotificationReceived += new
EventHandler<HttpNotificationEventArgs>(channel_HttpNotificationReceived);
// If the application is running in the foreground, the toast notification is instead routed to the
application.
channel.ShellToastNotificationReceived += new
EventHandler<NotificationEventArgs>(channel_ShellToastNotificationReceived);
// Binding a notification channel to a tile notification.
if (!channel.IsShellTileBound) {
channel.BindToShellTile();
}
// Binding a notification channel to a toast notification.
if (!channel.IsShellToastBound) {
channel.BindToShellToast();
}
55. Available Gestures
• Tap
• DoubleTap
• Hold
• FreeDrag
• VerticalDrag Touch Gestures is available only in XNA
framework, though the library can be used in
• HorizontalDrag a Silverlight application.
• DragComplete
• Flick
• Pinch
• PinchComplete
56. Gesture Sample
Microsoft.Xna.Framework.Input.Touch
//enable the gestures we care about.you must set EnabledGestures before you can use any of
the other gesture APIs.
TouchPanel.EnabledGestures=GestureType.Hold|GestureType.Tap|GestureType.FreeDrag;
//since we may have multiple gestures available, we use a loop to read in all of the
gestures
while(TouchPanel.IsGestureAvailable) {
//read the next gesture from the queue
GestureSample gesture=TouchPanel.ReadGesture();
//we can use the type of gesture to determine our behavior
switch(gesture.GestureType)
{
case GestureType.Tap:
case GestureType.DoubleTap:
case GestureType.Hold:
case GestureType.FreeDrag:
case GestureType.Flick:
case GestureType.Pinch:
}
}
58. Expression Blend 4 - Defined
The Microsoft Expression Blend Software Development Kit (SDK) for
Windows Phone provides conceptual topics and programming reference
for behaviors, which are reusable pieces of packaged code that can be
dragged onto any object and then fine-tuned by changing their
properties.