94 answers Pizza toppings Playstation 94 Poker 94 Reptiles 94 Rodents 94 Skiing 94
September, 2011 | Silverlight tips
Tuesday , 28 July 2015
Home » 2011 » September

Monthly Archives: September 2011

Whats new in Silverlight 5

Silverlight 5 adds over 40 new features over last Silverlight version.

For more information on the Silverlight 5 announcements check http://www.microsoft.com/silverlight/future.

Multiple Window Support

Multiple window support enables a trusted application to dynamically create additional top level

Ancestor RelativeSource Binding

Ancestor RelativeSource Binding enables a DataTemplate to bind to a property on the control that
contains it, equivalent to FindAncestor and AncestorType, AncestorLevel bindings in WPF.

Implicit DataTemplates

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


Enables Multi‐click input on left and right mouse button.

private void OnMouseDownClickCount(object sender, MouseButtonEventArgs e)




        // Checks the number of clicks.


        if (e.ClickCount == 1)




            // Single Click occurred.




        if (e.ClickCount == 2)




            // Double Click occurred.




        if (e.ClickCount >= 3)




            // Triple Click occurred.






Binding on Style Setter

Binding in style setters allows bindings to be used within styles to reference other properties.

<Style x:Key=”TextBlockStyle2” TargetType=”TextBlock”>
<Setter Property=”FontFamily”
    Value=/SL5;Component/Fonts/Fonts/.zip#Segoe UI/>
<Setter Property=”FontSize” Value=”0,3,0,0”/>
    <Setter Property=”Foreground” Value=
”{Binding Source={StaticResource SysColors},Path=ControltextBrush}”/>

Realtime Sound (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.

Variable Speed Playback (“Trick Play”)

This API enables development of fundamental player experiences such as fast‐forward and rewind and

variable speed playback at common speeds (1.2x, 1.4x) – a very common scenario for enterprise training content. The MediaElement.Rate  property supports the values ‐8.0, ‐4.0, 0.5, 1, 4.0, 8.0. Note : AudioPitch correction is not present in the Beta but will be added for the final release

Additional Silverlight 5 Features included

  • Hardware video decode for H.264 playback.
  • Multi‐core background JIT support for improved startup performance.
  • ComboBox type ahead with text searching.
  • Full keyboard support in full‐screen for trusted in‐browser applications, enables richer kiosk and

    media viewing applications in‐browser.

  • Default filename in SaveFileDialog – Specify a default filename when you launch the


  • Unrestricted filesystem access – trusted applications can Read write to files in any directory on

    the filesystem.

  • Improved Graphics stack – The graphics stack has been re‐architected to bring over

    improvements from WP7, such as Independent Animations.

  • Performance optimizations
    • XAML Parser performance optimizations.
    • Network Latency optimizations.
    • Text layout performance improvements.
    • Hardware acceleration is enabled in windowless mode with Internet Explorer 9.

Windows Phone Toolkit Explained

Straight from Microsoft, Silverlight for Windows Phone Toolkit provides the developer community with new FREE components, functionality, and an efficient way to help shape product development. Toolkit releases include open source code, samples & docs, plus design-time support for the Windows Phone platform as well as the Silverlight browser plugin.

In this toolkit you will find user interface controls like those found throughout the Windows Phone, with components like toggle switches, page transitions, picker controls and more.


Silverlight for Windows Phone Toolkit August 2011 offers the following 21 Components:

All Aug 2011 Components

New Components

Key Fixes

  • AutoCompleteBox
  • ContextMenu
  • DatePicker
  • DateTimeConverters
  • DatePicker
  • ExpanderView
  • GestureService/GestureListener
  • HeaderedItemsControl
  • HubTile
  • ListPicker
  • LocalizedResources
  • LockablePivot
  • LongListSelector
  • MultiselectList
  • Page Transitions
  • PerformanceProgressBar
  • PhoneTextBox
  • RecurringDaysPicker (enables a day of the week selection)
  • TiltEffect
  • TimePicker
  • ToggleSwitch
  • WrapPanel


  • DateTimeConverters
  • HeaderedItemsControl
  • HubTile
  • LocalizedResources
  • LockablePivot
  • MultiselectList
  • PhoneTextBox
  • Smooth new LongListSelector designed for Windows Phone 7.1 OS
  • Improved Transitions performance
  • Improved ContextMenu performance
  • ListPicker supports multiselect
  • Various bug fixes
  • AutoCompleteBox focuses correctly after hitting return in the control.
  • ListPicker fixed to correctly bind BorderBrush.
  • ListPicker no longer opens on a “swipe” gesture.
  • ListPicker allows for retrieval of ActualFullModeItemTemplate.
  • LongListSelector smoothed for improved UI performance.
  • The out transition from a page immediately begins, yielding improved perception of performance. Transition values have been slightly tweaked.
  • Hitting the back button during a transition no longer causes a crash.

You can download the new release straight from the CodePlex site at http://silverlight.codeplex.com/ – it requires the latest ‘Mango’ developer tools as well.

The release is also available on NuGet as the SilverlightToolkitWP package.

New features in Windows Phone Toolkit  August 2011 release

Here are some of the new things you will find in this release:

LongListSelector has been rebuilt and redesigned to take advantage of the new smooth scrolling and off-thread touch input support in ‘Mango’. This is a buttery-smooth control for showing lists, including grouping and jump list support.

MultiselectList control enables multiple selection for easily working with lists of data, similar to the Mail app’s capability.

LockablePivot adds a special mode to the Pivot control where only the current item is shown (often used with multiple selection).

ExpanderView is a primitive items control that can be used for expanding and collapsing items (like the threaded views in the Mail app).

HubTile lets you add beautiful, informative, animated tiles to your application, similar to the new People groups in ‘Mango’.

ContextMenu control has been reworked: performance improvements and visual consistency fixes.

ListPicker now supports multiple selection.

RecurringDaysPicker lets your users select a day of the week.

Date & Time Converters localized to 22 languages. The converters let developers easily display date and time in the user interface in one of the many styles found throughout the phone’s UI, from a short date like ‘7/19’ to relative times like ‘about a month ago’.

Page Transitions have improved performance for a more responsive feel.

PhoneTextBox is an early look at an enhanced text box with action icon support, watermarking, etc.

All error messages and interface elements have been localized to all of the supported languages, making for a great experience for users around the world.

Other great components

If you’re new to the Silverlight for Windows Phone Toolkit, you’re in for a treat as an app developer: the simple developer library also contains these great components designed specifically for the Windows Phone:

AutoCompleteBox is a text box control that allows for simple auto-completion based on a filter.

DatePicker lets a user select a date, similar to that found in the Alarms app on the Windows Phone.

PerformanceProgressBar can be used to show indeterminate progress inside an app (though you should also consider the new ProgressIndicator support in ‘Mango’, too).

TiltEffect attached property that gives buttons, list items, and other components that nice ‘tilt’ touch experience.

TimePicker for choosing a time.

WrapPanel is a non-virtualized wrapping panel often used for displaying photo thumbnails.

Helper code for Gestures (touch input manipulations).

Check out the sample app

One of the best ways to learn about the controls is to use the sample app on your Windows Phone. We haven’t published it to the marketplace yet, so in the meantime, just deploy this .XAP to your developer-unlocked Windows Phone (or the Windows Phone Emulator). It should work with the latest Windows Phone ‘Mango’ developer tools.

You can find the sample XAP here.

The app includes a nice list of the controls, touch one to go into a sub-page. The full open source code to the sample is on the CodePlex site at http://silverlight.codeplex.com/