Category Archives: Silverlight

Quick Tip: a work around the RadListBox’s SelectedIndex issue with Telerik Q1 2013

If you are working with Telerik RadListBox for Silverlight or WPF and if you upgraded your Telerik version to the Q1 2013 , you probably noticed that there is something wrong with it.

Basically the problem is when SelectedIndex is changed , the SelectedItem property is not updated and vice versa.

A classic scenario is when you try to set a by default selection:

_myListBox.SelectedIndex = 0;

If(_myListBox.SelectedItem != null)

   {

       //Do something

   }

This is not working anymore with Telerik Q1 2013 because SElectedItem is not updated.

What you can do is instead of  _myListBox.SelectedIndex = 0;

put  _myListBox.SetValue(RadListBox.SelectedItemProperty, _myListBox.Items[0]);

 

Wala Sourire

Silverlight 5 RC is finally available !

The latest Microsoft Silverlight RC version was released 1st September 2011. Now, you can freely download Silverlight 5 RC from here.

This release, other than the features already existing in the beta, contains new features like :

  • P/Invoke support for calling native functions.
  • 64 bit support .
  • DataContextChanged event.
  • In-Browser Trusted Applications.
  • PivotViewer Control.

And a lot more, you can read about the new features in Pete Brown’s Blog and the Technical Features document.

You want to know more about Silverlight 5 ? here are a series of posts related to Silverlight 5 RC and its new features :

 

More posts to come about Silverlight5 ! Stay Tuned Smile

Mango – Baby Steps: Creating your first application

Mango – baby steps are a serie of posts to learn about Windows Phone 7.1 and you probably know that if you read the first post aiming to help you to set up the environment and know the requirements in order to start writing some rocking code.

Now everything is set , let’s start coding !!!!!

Open a new project

In visual Studio , from the menu in the top, click : File –> New –> Project

When you choose Silverlight for Windows Phone from the installed templates, you will get this window :

As you can notice, you have multiple choices:

  • Windows Phone Application : Generates a basic application with a single start page and header.
  • Windows Phone Databound Application: Generates an application in a Model/View/ViewModel (MVVM) style, with sample data exposed in ViewModel classes.
  • Windows Phone Class Library:  Enables you to create a collection of controls that you can reuse across several projects.
  • Windows phone Panorama Application: This template creates an application with the Panorama Control, which provides a multipage view of options with a parallax scrolling background.
  • Windows Phone Pivot Application:  The Pivot control is much like a Tab Control, but tuned for a gesture-based interface. This template creates an application with the Pivot as its primary navigation.
  • Windows Phone 3D Graphics Application: the application type used to invoke XNA content from a Silverlight application. The idea behind this application is to have a pre-built XAML page that has a game loop and that is calling an included XNA project. This can be considered a pure demo of Silverlight-XNA interop.
  • Windows Phone Audio Playback Agent: a non-UI project time that creates a class based on AudioPlayerAgent. Consider this some sort of a class library, but that will later be tied to a BackgroundAudioPlayer to handle custom events.
  • Windows Phone Audio PStreaming Agent: similar to the audio playback agent, this project is used to create a class that will be used with an application that implements a streaming mechanism coupled with a background player.
  • Windows Phone Task Scheduler Agent: a project that will create a class based on ScheduledTaskAgent that will allow developers to handle task invocation events for existing scheduled tasks.

Since it’s our first application, we will choose a simple Windows Phone Application template and call it ” Hello Mango”. Make sure you select ” Windows Phone 7.1″ version.

Add some controls to the application

Now that the project is created, we will get this window:

That doesn’t look so nice :S

We will change the application and page titles :

Before

After

In the XAML code, i changed :

  •  the text of the textblock named ” Application Title” from ” Application title” to ” Hello Mango” .
  • the text of the textblock named ” Page title” from ” page title” to ” Home page” .

Let’s add the Mango picture to the page:

In the  solution explorer, right click on the project : add –>  existing item

Then browse the location where you saved the image, selected and click add.

from the toolbox, drag and drop an ” image” control to the phone interface :

In order to see the image we added to the project, we need to give the “image” control a ” source” , to specify the path of the image to be visualized.

Run the application in the Emulator

Now let’s see the app in action and discover the emulator new features.

The Mango’s new emulator has some additional tools like the accelometer and location:

This is a first example, it aims to explain the templates and explore the elements in the window.

Please feel free to comment and give me your feedback :)

Silverlight5 Beta is out !

As expected , Earlier today on MIX11 day 2 keynote , the release of Silverlight 5 beta was announced ! Wohooooooooooooo

Downloads are available here : http://www.silverlight.net/getstarted/silverlight-5-beta/ Visual Studio and Expression Blend tooling support for the Silverlight 5 Beta is also available.

This beta release includes almost all features that will be in the final release of Silverlight5, it includes:

*Changes in the XAML stack:

  • Implicit data templates : This feature enables the following capabilities:
     ContentPresenter DataTemplates can be selected based upon the content type.
     Implicit definition of DataTemplates
     Dynamically update the ContentPresenter DataTemplate when its content changes
     Enable proper scoping of DataTemplates
  • Ancestor relativesource: Ancestor RelativeSource Binding enables a DataTemplate to bind to a property on the control that contains it.
  • Binding in styles: Binding in style setters allows bindings to be used within styles to reference other properties.
  • Markup extensions: Custom markup extensions allow you to run custom code from XAML. Markup extensions allow code to
    be run at XAML parse time for both properties and event handlers, enabling cutting‐edge MVVM
    support.
  • XAML debugging ( my favorite): Data binding debugging allows breakpoints to be set in  XAML binding expressions.

*Control improvements

  • Text changes
  • Combobox type-ahead
  • Multi click support: Enables Multi‐click input on left and right mouse button.

*Graphic and media changes:

  • Graphic engine and 3D: Silverlight 5 now has a build- in XNA 3D graphics API, including a new 3D drawing surface control and immediate mode GPU access.
  • Media changes
  • Low latency Audio: Enables pre‐loading of an audio source for precision timing of playback. Multiple playback instances are
    supported through creation of SoundEffectInstance objects.

* Elevated trust changes:

  • Elevated trust in the browser
  • File System access

That’s an overview about the new features and each one of them will be explained in details in my coming posts. Now excuse me , i need to build some Silverlight 5 samples :)

 

Silverlight 5 beta to be released during Mix11

Few days before the Mix11 where .Net developers and PROs expect to see the latest components coming with Silverlight5.

Microsoft officially announced the release of silverlight 5 beta during Mix11 in the Silverlight Team Blog :” As part of the continued support for scenarios that require plug-in based capabilities, we will ship a beta of Silverlight 5 at MIX, with some great demos for compelling scenarios. And as we stated in the summary above, we believe Silverlight delivers the richest set of plug-in based capabilities available to developers today, making the choice of Microsoft technologies even more compelling in aggregate.”

As announced in the last Silverlight FireStarter, Silverlight 5 will support new features like the 3D graphics programming interface, debugging inside the binding and other great features.

Stay tuned to see some great Silverlight5 beta demos in Mix11 !!

Windows Phone 7 for beginners #workshop1

Today i started with the first workshop about Windows phone 7 for DotNet+ Club in the Faculty of Sciences of Tunis.

As my audience is mainly students , some of them don’t know too much about Microsoft Technologies, I decided not to go deeper with development and focus on a WP7 overview.

My talk was devided into 5 parts:

1- Philosophy behind the WP7

2- The Design

3- The Experience

4- The Platform

5- Hello-WP7 Demo

You can find the slides and Demo  here.

 

New feature for Silverlight in Visual Studio 2010 Service Pack 1

Visual Studio 2010 Service Pack 1 is finally out , not only for MSDN subscribers but for everybody. You can download it here.

Service Pack 1 brings some of the most needed features like better help support,IntelliTrace support for 64bit and SharePoint and some tools for Silverlight4.

Performance profinling tools are very important but unfortunately did not exist for Silverlight developpement before. Visual Studio 2010 Service Pack 1 includes a Performance Wizard for Silverlight.

When you launch the application, the performance wizard will record all actions related to the use of CPU.

I think this new feature will be very usefull for your Silverlight projects. Enjoy it :)

Silverlight FireStarter Keynote : Silverlight Future is bright :)

During the Silverlight FireStarter Keynote, Scott Guthrie announced Silverlight5: ” Silverlight Future is bright” :)

Silverlight5 is just awesome and has great features:

*Improved Media support: hardware decode | trickplay(variable play speed) | Power Management | Remote Control support | Digital rights management advancements | IIS Media Services4.0(includes support for Ipad and Iphone).

 

*Data Binding enhacements: Data Binding Debugging | Markup Extensions for MVVM | Implicit Data templates | Binding in Style Setters…

*Networking and WCF enhacements: WS-trust support | MVVM friendly DataSource…

*Graphics improvements: GPU Accelerated 3D | Fluid Layout Transitions …

* Out of Browser : Multiple Window support | P/Invoke

We have seen great Demos showing off all those features.

Silverlight5 Beta will be public on Sprint2011 , Stay Tuned :)

 

 

The new Silverlight Toolkit for Windows Phone 7

This slideshow requires JavaScript.

Microsoft has released more Silverlight Controls for Windows Phone 7 . November Toolkit contains the following controls :

*AutoComplete Box: It’s very important for  applications using search feature . When you start typing on your phone  , you will get relevant matches.

*ListPicker : It’s the ComboBox for WP7

*LongList Selector : It’s an advanced ListBox, it supports full data and UI virtualization, flat lists and grouped lists.

*PageTransitions : It helps you add transitions between your pages. The available transitions in this Toolkit are :

* Turnstile

* Rotate

* Slide

* Roll

* Swivel

All you have to do is to download the toolkit and you will find Samples of how to use these controls.

 



 


 

The Silverlight Buzz

We saw a great stuff in pdc10, but all the talk is about Silverlight !!! When talking to ZDNet’s Mary-Jo Foley, Bob Muglia, the president of Microsoft’s server and tools business affirmed ” Microsoft’s commitment to making Silverlight the development platform for Windows Phone, he noted that the cross-platform solution Microsoft sees going forward is HTML.

That’s what make alot of people wondering if it’s the Dead of Silverlight ? If it’s the HTML5 era ?…

I read alot about it: Tech journalists , Developers and observers are talking about it .

In my humble point of view, i think that Silverlight is much more than a browser Technology, out-of-browsers applications in Silverlight 4 are in demand more than in-browser applications.Also, it’s too early to make a judgement  on HTML5 although we have seen some great Demos during pdc10.

And more important, Silverlight as Bob Muglia said is becomming the Development Platform for Windows Phone ! WOW !!!! Please people, that must mean something…

In the end , i want to say that may be i’m not qualified to make THE right judgement , i just made an observation.

You can read more about this debate and make your own observation on :

* Shawn Wildermuth’s blog

*Laurent Bugnion’s blog

and more and more Buzz about Silverlight :)

Follow

Get every new post delivered to your Inbox.