Sunday 15 May 2011

silverlight 5 features


Silverlight 5 Features:

The full feature set planned for Silverlight 5 was announced at the Firestarter event in December 2011 and also includes the following features:

·         Support for Postscript vector printing enables users to create reports and documents, including the ability to create a virtual print view different from what is shown on the screen.
·         Improved power awareness prevents the screen saver from being shown while watching video and allows the computer to sleep when video is not active.
·         Remote control support, allowing users to control media playback
·         DRM advancements that allow seamless switching between DRM media sources.
·         Enhanced OpenType support.
·         Fluid user interface enables smoother animation within the UI. Inter‐Layout Transitions allow developers to specify animations to apply when elements are added, removed or re‐ordered within a layout. This provides smoother user experiences when, for example, items are inserted into a list.
·         Text clarity is improved with Pixel Snapping.
·         The DataContextChanged event is being introduced.
·         WS‐Trust support: Security Assertion Markup Language authentication token.
·         64 bit support
·         COM Interop for trusted applications running in‐browser.
·         Calling unmanaged code using P/Invoke from trusted applications in and out of browser.
·         The Pivot viewer control enables a visual way to rapidly sort through large collections of graphical data, for example a catalog of movies represented by images of dvd covers, using intuitive transitions to show the effects of filters on the result set.

silverlight 5 beta features

Whats new in Silverlight 5 beta!!
Silverlight 5 Beta technical features:

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

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

ClickCount
Enables Multiclick input on left and right mouse button.
Binding on Style Setter
Binding in style setters allows bindings to be used within styles to reference other properties.

Trusted applications in
Silverlight 5 enables trusted applications to run in

Realtime Sound (low
latency Audio)
Enables pre

Variable Speed Playback (“Trick Play”)
This API enables development of fundamental player experiences such as fast

Linked Text Containers
Enables RichTextBox controls to be associated and text to overflow from one into the next. multiple
RichTextBoxOverflows can be chained (from an initial RichTextBox) to automatically spread text across a pre
Text Tracking & Leading
Tracking/leading set more precisely how far apart each character is for extra creative control, Adding finer grained control over the spacing between letters in words in the RichTextbox control.

Custom 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
support.
edge MVVM
defined freeform layout or multiple column layout.
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.
loading of an audio source for precision timing of playback. Multiple playback instances are supported through creation of SoundEffectInstance objects.
browserbrowser for the first time. The Beta includes support for two features: Elevated InBrowser via Group Policy & InBrowser HTML support w/Group Policy.
Enable proper scoping of DataTemplates


XAML Binding debugging

This allows breakpoints to be set in XAML binding expressions so that we can step through binding issues examine the local windows, and create the conditional breakpoints

3D accelerated APIS

Additional Silverlight 5 Features Included in this Beta

Hardware video decode for H.264 playback.

Multicore background JIT support for improved startup performance.

ComboBox type ahead with text searching.

media viewing applications in
Full keyboard support in fullscreen for trusted inbrowser applications, enables richer kiosk andbrowser.

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

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

improvements from WP7, such as Independent Animations.
Improved Graphics stack – The graphics stack has been rearchitected to bring over

Performance optimizations –

XAML Parser performance optimizations.

Network Latency optimizations.

Text layout performance improvements.Hardware acceleration is enabled in windowless mode with Internet Explorer 9.

Multiple Window Support

silverlight: how to call dataservice from silverlight


This code helps you know how to consume dataservice from silverlight application

public void GetModelsByDataService(string DataServiceURL)
{
try
    {
       context = new ShapeCollection(new Uri(DataServiceURL));

       var models = from m in context.EquipmentModels select m;
       DataServiceQuery<EquipmentModel> equipmentmodelQuery = models as DataServiceQuery<EquipmentModel>;
       equipmentmodelQuery.BeginExecute(new AsyncCallback(OnGetModelsComplete), equipmentmodelQuery);
    }
    catch (Exception ex)
    {
       throw ex;
    }
}

void OnGetModelsComplete(IAsyncResult result)
{
    DataServiceQuery<EquipmentModel> equipmentmodelQuery =result.AsyncState as DataServiceQuery<EquipmentModel>;

    try
    {
       List<EquipmentModel> lstOfEquipmentModels = equipmentmodelQuery.EndExecute(result).ToList();
       var mds = from equipmentAttribute in lstOfEquipmentModels
                select equipmentAttribute.Name;

       List<string> modelsList = mds.ToList<string>();
       modelsList.Sort();
       if (GetEquipmentModelsDataServiceCompleted != null)
       {
           GetEquipmentModelsDataServiceCompleted(modelsList);
       }
    }
    catch (Exception ex)
    {
       if (GetEquipmentModelsDataServiceCompleted != null)
       {
           GetEquipmentModelsDataServiceCompleted(null);
       }
    }
}

silverlight: datagrid column header with image and implement a filter - custom column header

We can achieve this by using the celltemplate which is present in datagridtemplatecolumn. The below code explains you everything



<data:DataGridTemplateColumn Header="Clip Type">
                                <data:DataGridTemplateColumn.CellTemplate>
                                    <DataTemplate>
                                        <Image Width="15" Margin="3" Height="15" Source="{Binding IsLocalClip, Converter={StaticResource DataConverter},ConverterParameter='IsLocalClip'}"></Image>
                                    </DataTemplate>
                                </data:DataGridTemplateColumn.CellTemplate>
                            </data:DataGridTemplateColumn>


Hope this helps!