DCSIMG
March 2010 - Posts - Alex Golesh's Blog About Silverlight Development

March 2010 - Posts

DevAcademy 4 – the event is over…

Today we had great event – DevAcademy 4 – for the developers in Israel. Thanks for all participants, organizers and sponsors!

 

image

I had a session about Silverlight 4 new features.

Thanks for all attendees! It was a pleasure to present for such nice audience!

As promised, the sessions slides here.

image

For samples visit “Samples” page

image

Direct samples links:

Text Editor

Silverlight 4 Features

 

Stay tuned for articles about Silverlight 4 and Windows Phone 7 development – arriving soon!

 

 

Enjoy,

Alex

Silverlight 4 Quick Tip: Out-Of-Browser Improvements

This post will focus on improvements (well some of them) in Silverlight’s 4 RC Out-Of-Browser features.

I’ll show how to change shape of your Out-Of-browser (OOB) application.

Note: the application has to be elevated application.

All needed to take application out of browser is to check this small checkbox in Silverlight’s project settings:

image

This is not new. But the combo in OOB Setting dialog is new:

image

This allows to change the Windows shape in Elevated OOB applications.

Small tip here: when you changing you window to be Borderless (Round Corner or standard one) to have decide how your application will be moved across the screen and how it will be closed.

To close elevated OOB use the following snippet:

if (Application.Current.IsRunningOutOfBrowser && Application.Current.HasElevatedPermissions)
  Application.Current.MainWindow.Close();

To move the application, subscribe to MouseLeftButtonDown, MouseLeftButtonUp and MouseMove events. Here is the sample to handle those events and let your application move around the screen:

bool isDragged = false;
private void UserControl_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
   if (Application.Current.IsRunningOutOfBrowser && !isDragged)
      isDragged = true;
}

private void UserControl_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
{
   if (Application.Current.IsRunningOutOfBrowser && isDragged)
      isDragged = false;      
}

private void UserControl_MouseMove(object sender, MouseEventArgs e)
{
   if (isDragged)
      Application.Current.MainWindow.DragMove();
}

Additional feature exist with new OOB model is ability to install application not from the web page (like it was from version 3), but from command line (having XAP file available). Silverlight 4 OOB launcher has new command line parameters to install, uninstall and execute application in “emulation mode” – without installing it.

image

For example. to install application on the desktop use the following command:

"%ProgramFiles(x86)%\Microsoft Silverlight\sllauncher.exe" /overwrite /install:"X:\PACKAGE_LOCATION\SL4Features.Web\ClientBin\APPLICATION.xap"
/origin:http://ORIGINAL_LOCATION/ORIGINAL_HOSTING_PAGE /shortcut:desktop

To uninstall it use the following command:

"%ProgramFiles(x86)%\Microsoft Silverlight\sllauncher.exe" /overwrite /uninstall:"X:\PACKAGE_LOCATION\APPLICATION.xap"
/origin:http://ORIGINAL_LOCATION/ORIGINAL_HOSTING_PAGE /shortcut:desktop

To run application without installing it (in emulation mode), use the following command:

"%ProgramFiles(x86)%\Microsoft Silverlight\sllauncher.exe" /overwrite /emulate:"X:\PACKAGE_LOCATION\APPLICATION.xap" /origin:http://ORIGINAL_LOCATION/

 

Last, but not least, now you could execute and debug your OOB application directly from Visual Studio 2010 without installing it first. It is as simple, as setting it as “StartUp Project”:

image

Next time I’ll show more new features in “just-released” Silverlight 4 RC.

 

Stay tuned,

Alex

Silverlight at Windows Phone 7

Microsoft announced today, that new Windows Phone 7 Series will support Silverlight as one of 2 development frameworks. Second development framework will be XNA (will blog about it later).

So, what’s new for Silverlight developers there?

First, we have familiar tools: Windows Phone applications with Silverlight will be developed either with Visual Studio 2010, either with new “express” version called Visual Studio 2010 Express for Windows Phone. This “express” version will enable development with both frameworks (Silverlight and XNA).

Full Visual Studio 2010 will also get new project types to develop with both frameworks.

image

First template is to create empty Windows Phone (WP7) applications. Second template is to create “list-based” applications. This post will focus Silverlight development.

Let’s create simple WP7 application. Silverlight application in Windows Phone are very close to standard Silverlight applications, and has full semantics of OOB applications. The closest version to this WP7 Silverlight is Silverlight 3.

After creating a new project VS2010 opens design surface. Design surface has very nice preview of UI.

image

The controls being added to the designer surface automatically getting “phone” look and feel:

image

The project created with number of WP7 styles for controls. Changing styles in VS2010 is very easy and preview works fantastic:

image

Code behind was always a strong part for Visual Studio and:

image

Before running the application check, that it will run on Windows Phone Emulator (unless you have a real Windows Phone 7 Series device connected to the computer):

image

Emulator take some time to load – first quick tip here: don’t close it between debug sessions – but when it finally run it is pretty fast:

image image

It supports the phone rotation, and even generates corresponding events:

image

Debugging works as expected.

image

The project has new item types (in addition to standard .NET stuff):

image

I’ll overview more in-depth the features of WP7 development with Silverlight soon and post and update.

 

Stay tuned for WP7 & XNA short overview.

Alex

MIX10: Keynotes – LIVE BLOGGING

This year MIX10 will be exciting!

Scott Guthrie on stage, and he is talking about Silverlight 4 support. Cool demos of Winter Olympics with Silverlight 4 & Smooth Streaming! All the sources which used to for Olympics creation just were open sourced here!

New control to Silverlight Controls family - and additional cool demo - Pivot control. Wow!

Just announced – Silverlight penetration rate is 65%!

Now Scott talking about Elevated Out-of-browser support and the demo coming on stage is eBay desktop client using Silverlight 4 OOB (available after Silverlight RTW)! Wow! I still have the Flash one on my home desktop :) Seems need to change it soon…

 

Silverlight 4 RC available online. Final version – in a month.

 

Now its a turn for Windows Phone 7. Very smooth and fluid UI experience, cool demos, nice phone responsiveness :)

Silverlight and XNA will be the platforms to develop Windows Phone 7 applications – seeing demos of 3rd party applications on the phone, Silverlight apps and 3d XNA game.

 

Now Scott shows the Visual Studio 2010 Express for Windows Phone – known tools, same look and feel as the rest controls on Windows Phone 7, same skill applied

image

Tooling supports debugging, full intellisense, and uses same known Silverlight controls

image

Scott writing twitter application for Windows Phone 7 – live on stage!

In addition – Expression Blend 4 for Windows Phone announced.

Just announced – those tools will be available for FREE for everyone here!!!

And now more great Windows Phone application demos by partners (Netflix, Graphic.Ly, etc.).

 

Stay tuned,

Alex