Archives for posts with tag: Windows Phone

Everybody can spare 90 seconds, so why not put that time to good use and learn something new?

Take your ideas from concept, to completed apps quickly and easily with Expression Blend 4 for Windows Phone. Built in templates for Windows Phone, controls that automatically take on the look and feel of the phone and the ability to test your application on the Windows Phone emulator or directly on a Windows Phone device are all features that help keep you focused, thinking creatively and building compelling apps for your users.

More 90 second videos HERE

In this video, John meets with Deepesh Mohnani from the WCF RIA Services team. Deepesh demonstrates how to expose various endpoints from WCF RIA Services. This is a great explanation and walk through of how to open RIA Services domain services to clients, including:

  • Silverlight clients (of course)
  • Creating an OData endpoint and showing how Excel can use it
  • Creating a SOAP endpoint to a domain service and using it from a Windows Phone 7 application
  • Creating a JSON endpoint and having an AJAX application talk to it

Relevant links:

Follow us on Twitter @SilverlightTV or on the web at http://silverlight.tv/

While Silverlight and XNA Framework enable developers to create new and innovative applications and games for the Windows Phone (WP), these are just sets of libraries. In order to complete the development experience, a set of powerful tools is required. Microsoft Visual Studio 2010 Express for Windows Phone is a free express version of Visual Studio tailored to the Windows Phone. It includes Visual Studio Express to write great software, but more importantly for our purposes, it also includes the Windows Phone Emulator, which allows you to test and debug your application without even having a WP device. This enables you to create your software with high predictability and ease.

 Join Amit Chopra, Raghuram Lanka, and Mukund Bhoovaraghavan from the Windows Phone and Tools team, and Yochay Kiriaty, Senior Technical Evangelist, for a tour of the internals of the Windows Phone Emulator.

Windows Phone Push Notification Service provides developers with the infrastructure to support sending notification messages to a Windows Phone device even when their applications are not running, in a better conservative manner. Since Windows Phone doesn’t allow 3rd party applications to run in the background, your code can’t listen to or poll the Web for updates. Windows Push Notification Service was created to overcome this communication issue by enabling developers to send Push Notification Messages to Windows Phone devices even when their applications are not running.

Join Jorge Raastroem, a Program Manager in the Windows Phone Application Platform team, and Yochay Kiriaty, a Senior Technical Evangelist, as they describe what push notifications are and how they work with Windows Phone Push Notification Service.

You can also read  abot Understanding Microsoft Push Notifications for Windows Phones and Understanding How Microsoft Push Notification Works – Part 2

Windows Phone 7 provides developers with two main frameworks in which to work:  Silverlight and XNA Framework. Regardless of the framework you chose, you will end up with a Windows Phone application that must be deployed to the Windows Phone market place and from there installed on a Windows Phone device, and provisioned and managed by the user.

Join Tudor Toma – a Principal Program Manager in the Windows Phone team, Jaime Rodriguez – a Principal Technical evangelist, and Yochay Kiriaty – a Senior Technical Evangelist, as they provide an overview of the Windows Phone Application life cycle, explaining the internal architecture of Windows Phone and how application get installed and executed on.

This week on Channel 9, Brian returns from his European tour and there is much rejoicing with Dan as they discuss the week’s top developer news, including:

Picks of the week:
- Brian’s pick: TFS 2010 Power Tools now available, via Greg Duncan
- Dan’s pick: Auto-Update your wallpaper with Flickr images using your location with Arian Kulp’s Coding4Fun app – Geo-location and Flickr

If you have played around with Silverlight on Windows Phone 7, one thing you may have tried to figure out is how to add nice transitions between different pages of your application. By default, Windows Phone page transitions aren’t really transitions at all. The new PhoneNavigationPage is just popped into the root PhoneNavigationFrame. Effective, yes. Cool? Certainly not. Face it, modern mobile applications need to not only be functional, but also stylish. Simple “snap” transitions just don’t cut it.

The most common solution to this problem is to use brute force and manage the transitions yourself. You commonly see a “pattern” used in WP7 apps where events in your current page launch a Storyboard animation. When that animation is complete, the actual navigation to the new page is invoked and the new page then runs its own Storyboard once it is loaded. It looks something like this…

// CURRENT PAGE private void CurrentPage_Click(object sender, EventArgs e) {     SomeStoryboard.Completed += new EventHandler(SomeStoryboard_Completed);         SomeStoryboard.Begin(); }

void SomeStoryboard_Completed(object sender, EventArgs e) {     NavigationService.Navigate(new Uri("/Favorites", UriKind.Relative)); }

 

// NEWPAGE protected override void OnNavigatedTo(Microsoft.Phone.Navigation.PhoneNavigationEventArgs e) {     base.OnNavigatedTo(e);      SomeNewStoryboard.Begin(); }

It’s a straightforward solution, and it works just fine if your app has only a few pages. If you have lots of pages in your application, however, it becomes quite tedious and hard to maintain.

A better solution can be found by turning to the Silverlight Toolkit. The great thing about having Silverlight on WP7 is that you can leverage many existing Silverlight assets. In this case, we leverage the TransitioningContentControl from the Toolkit. The TransitioningContentControl was created for the traditional navigation-based Silverlight application to solve the same problem we are currently facing.

To get started, download the Silverlight Toolkit from CodePlex. Once installed, you will need to add the System.Windows.Controls.Layout.Toolkit assembly to your WP7 project.

If you are not familiar with the TransitioningContentControl, it’s a fairly simple control. The TCC is comprised of two ContentPresenters – current and previous. When you update the Content property of the TCC, it will take the content of the CurrentContentPresenter (if present) and move it to the PreviousContentPresenter. The new content is loaded into the CurrentContentPresenter. The TCC, however, manages the visibility of the previous and current ContentPresenters so that the “old” content is visible and the “new” content is hidden. It then uses a Storyboard, which is defined as part of the TCC’s VisualStateManager, to transition from the “old” content to the “new” content. If you are not familiar with Storyboards, the Visual State Manager, or other designer-type topics, have no fear. The TCC comes with a set of standard transitions, which you can use out of the box.

Getting the TCC to work with our WP7 app is a simple process. First, we need to modify the ControlTemplate for our PhoneNavigationFrame to use the TCC. By doing so, we automatically enable transitions between any PhoneNavigationPages we add to our app. To change the PhoneNavigationFrame, open the App.xaml file. Then, add a couple of namespaces to the xaml:

xmlns:layout="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Layout.Toolkit"xmlns:vsm="clr-namespace:System.Windows;assembly=System.Windows" 

Now, modify the PhoneNavigationFrame as shown below:

<phoneNavigation:PhoneApplicationFrame x:Name="RootFrame" Source="/MainPage.xaml">         <phoneNavigation:PhoneApplicationFrame.Template>         <ControlTemplate>                 <layout:TransitioningContentControl Content="{TemplateBinding Content}" Style="{StaticResource TransitioningStyle}"/>         </ControlTemplate>     </phoneNavigation:PhoneApplicationFrame.Template> </phoneNavigation:PhoneApplicationFrame> 

The TCC has its Style property set to a StaticResource. This Style provides the default transitions and is also where you would add your own VisualStates and Storyboards if you would like to add custom transitions.  This Style can be found in the Silverlight Toolkit in the TCC Sample Application, or you can get it from the sample WP7 application linked to at the end this article. The Style is long, so I won’t show the entire thing here, but the first parts of the Style are included below to give you an idea of what the Style contains and how it is used by the TCC.

<Style x:Key="TransitioningStyle" TargetType="layout:TransitioningContentControl">     <Setter Property="Transition" Value="DefaultTransition" />     <Setter Property="Template">     <Setter.Value>         <ControlTemplate TargetType="layout:TransitioningContentControl">             <Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="2">             <vsm:VisualStateManager.VisualStateGroups>             <vsm:VisualStateGroup x:Name="PresentationStates">                 <vsm:VisualState x:Name="DefaultTransition">                     <Storyboard>                         <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="CurrentContentPresentationSite" Storyboard.TargetProperty="(UIElement.Opacity)">                         <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0" />                         <SplineDoubleKeyFrame KeyTime="00:00:02.300" Value="1" />                         </DoubleAnimationUsingKeyFrames>                         <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="PreviousContentPresentationSite" Storyboard.TargetProperty="(UIElement.Opacity)">                         <SplineDoubleKeyFrame KeyTime="00:00:00" Value="1" />                         <SplineDoubleKeyFrame KeyTime="00:00:02.300" Value="0" />                         </DoubleAnimationUsingKeyFrames>                      </Storyboard>                 </vsm:VisualState>                 <vsm:VisualState x:Name="Normal">                     <Storyboard>                     <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="PreviousContentPresentationSite" Storyboard.TargetProperty="(UIElement.Visibility)">                     <DiscreteObjectKeyFrame KeyTime="00:00:00">                         <DiscreteObjectKeyFrame.Value>                             <Visibility>                                 Collapsed                             </Visibility>                         </DiscreteObjectKeyFrame.Value>                     </DiscreteObjectKeyFrame>                 </ObjectAnimationUsingKeyFrames>                 </Storyboard>             </vsm:VisualState> 


Though I won’t break the Style down in detail, I’ll point a couple of highlights. First, the Transition property is set to the VisualState that you would like to use as the transition between pages. Every transition will use this VisualState storyboard. The DefaultTransition VisualState is an example of how Storyboards are constructed for use in a transition. As you can see, each Storyboard must target both the CurrentContentPresentationSite and the PreviousContentPresentationSite (these are the ContentPresenters discussed earlier). You can target more than one property, if you like. Below is a custom transition that rotates the projection plane and the opacity of the ContentPresenters.

<vsm:VisualState x:Name="SwingTransition">    <Storyboard>                 <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Projection).(PlaneProjection.RotationY)" Storyboard.TargetName="PreviousContentPresentationSite">             <EasingDoubleKeyFrame KeyTime="0" Value="0"/>             <EasingDoubleKeyFrame KeyTime="0:0:0.7" Value="90"/>         </DoubleAnimationUsingKeyFrames>         <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="PreviousContentPresentationSite">             <EasingDoubleKeyFrame KeyTime="0" Value="1"/>             <EasingDoubleKeyFrame KeyTime="0:0:0.7" Value="0"/>         </DoubleAnimationUsingKeyFrames>         <DoubleAnimation Duration="0" To="0" Storyboard.TargetProperty="(UIElement.Projection).(PlaneProjection.CenterOfRotationX)" Storyboard.TargetName="PreviousContentPresentationSite" />         <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.Projection).(PlaneProjection.CenterOfRotationX)" Storyboard.TargetName="CurrentContentPresentationSite" />         <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Projection).(PlaneProjection.RotationY)" Storyboard.TargetName="CurrentContentPresentationSite">             <EasingDoubleKeyFrame KeyTime="0" Value="90"/> <EasingDoubleKeyFrame KeyTime="0:0:0.7" Value="0"/>         </DoubleAnimationUsingKeyFrames>         <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="CurrentContentPresentationSite">             <EasingDoubleKeyFrame KeyTime="0" Value="0"/>                     <EasingDoubleKeyFrame KeyTime="0:0:0.7" Value="1"/>         </DoubleAnimationUsingKeyFrames>     </Storyboard> </vsm:VisualState> 

That’s it. You now have transitions any time you Navigate to a new PhoneNavigationPage

Part II in our “Channel 9 in the Dark” series is a look at how Microsoft streams an experience via IIS and Silverlight across devices. This video shows the experience of streaming Silverlight on Windows Phone 7, Nokia Series 60, and even on an iPhone. No, we’re not announcing Silverlight for iPhone; this simply shows how adaptive streaming can account for different devices depending on capability.

Here is the update you’ve all been waiting for. Charlie Kindel sat down with us to dive a little deeper into what this developer tools update means and what to expect from it. Notable to mention is that it has been tested and works with the final release of Visual Studio 2010. He also gives a few words of advice on how to make the most of your Windows Phone 7 developing experience. Tune in for sure and then get to building apps!

Download the Refresh HERE.

Today we’re previewing the new Windows Live Messenger in Sao Paulo, so I stopped by Dharmesh Mehta’s office to get you a look. This new Messenger has some things that we’ve been waiting for. Fullscreen high definition video chat is here, and for $50 on each side you can now chat in HD. Look for more HD video chats in our Channel 9 Studio with people we couldn’t otherwise talk with.

Messenger includes status updates synched across other networks, a coupled yet de-dup’d contact list, social highlights from your favorite people, and apps for Windows Phone and iPhone. Timeframe is in the coming months and will be available from download.live.com. You can find more info at messengerpreview.com.