Pages

Showing posts with label Silver light. Show all posts
Showing posts with label Silver light. Show all posts

Thursday, April 14, 2011

SilverLight 5 Beta

Hello All ,

The New Silverlight 5 (Beta) is available to download. You can download it from the below location. There are almost 40 new features are added in this new version. Some of them are listed below. Download from here.


There are a lot of new features has been added to this version for ease of developing some very good application. Some of the new features are as follows.

  • XAML Debugging with breakpoints for binding debugging
  • Implicit data templates for easy UI reuse
  • Double (and multi) click support
  • GPU-accelerated XNA-compatible 3D and immediate-mode 2D API
  • Low-latency sound effects and WAV support
  • Real operating system windows and multi-display support
  • Significant performance improvements, fixes and much more
Please check this details document of the new features available in Silverlight 5 Download
Here you can find the details Description of the new features of silverlight 5.

I hope You are going to have a look on this New Silverlight 5. Waiting for all your valuable comments on this new version of Silverlight and o suggestions as well.


Thanks,

Anil Kumar Pandey
MVP (Visual C# 2009-2010)

Friday, December 3, 2010

Silverlight 5 Plans

Hello All,
I got this news from one of my fellow Silverlight MVP, that the Microsoft is planning for the new version of silver light that is Version 5, with some new features and capability for helping the developer to create some good application.. I have seen the Blog of Timheuer here is the Blog link from where I have got these information. http://tinyurl.com/2wdx6ge


Here are some of the features For the Media side

  • Hardware Decode and presentation of H.264 media
  • “TrickPlay” allows video to be played at different speeds and supports fast-forward and rewind. At up to twice the speed, audio pitch correction allows users to watch videos while preserving a normal audio pitch.
  • 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.
  • Digital rights management advancements allow seamless switching between DRM media sources.

And In the Application Development side.

  • Fluid user interface enables smoother animation within the UI. 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 improvements make it possible to build rich magazine-style text layouts:
    • Multicolumn text and linked text container allow text to flow around other elements.
    • Tracking/leading set precisely how far apart each character is for full creative control.
    • Text clarity is improved with Pixel Snapping.
    • Text layout performance is significantly improved.
    • OpenType support has been enhanced.
  • 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.
  • Applications can now work the way users expect with added support for double-click and ComboBox type ahead.
  • Databinding enhancements allow more work to be done more easily via XAML:
    • Debugging support now allows breakpoints to be set on a binding, so you can step through binding failures.
    • Implicit DataTemplates allow templates to be created across an application to support a particular type by default.
    • Ancestor RelativeSource allows, for example, a DataTemplate to bind to a property on the control that contains it.
    • Binding in style setters allows bindings to be used within styles to reference other properties.
    • The DataContextChanged event is being introduced. Markup extensions allow code to be run at XAML parse time for both properties and event handlers, enabling cutting-edge MVVM support.
  • Networking and Windows Communication Foundation enhancements:
    • Reduced network latency by using a background thread for networking.
    • WS-Trust support: Security Assertion Markup Language authentication token.
  • Silverlight 5 performance improvements include these:
    • Reduced network latency by using a background thread for networking.
    • XAML parser improvements that speed up startup and runtime performance.
    • Support for 64-bit operating systems.
  • Graphics improvements
    • Graphics Processing Unit (GPU) accelerated 3-D application programming interface (API) provides rich graphics on the Web for building advanced data visualizations and rich user experience (UI).
    • Immediate mode graphics API allows direct rendering to the GPU.
    • Hardware acceleration is enabled in windowless mode with Internet Explorer 9.
  • Silverlight offers a new class of trusted applications that brings desktop capabilities to the browser for the first time. These features, when enabled via a group policy registry key and an application certificate, mean users won’t need to leave the browser to perform complex tasks:
    • Host HTML content as a Web browser control within the Silverlight application. HTML pages, such as help content or e-mail, can be integrated within the application.
    • Read and write files to the user’s My Documents folder, making it easier to find media files or create local copies of reports.
    • Launch Microsoft Office and other desktop programs. Users can open Microsoft Outlook and create an e-mail message, or send a report to Word utilizing the power of Office.
    • Access devices and other system capabilities by calling into application COM components. Users can access a USB security card reader or a bar-code scanner.
    • Enjoy full keyboard support in full screen, which enables richer kiosk and media viewing applications.
    • Call existing unmanaged code directly from within Silverlight with P/Invoke.
  • Out-of-browser trusted applications are further enhanced:
    • Existing unmanaged code can be called directly from within Silverlight with P/Invoke.
    • Child Window support allows multiple windows to be launched from the application.

You can read the detail article on this blog Here. And please post your comment and suggestion so that we can forward it to the silver light team.


Thanks,
Anil Kumar Pandey
MVP (Visual C#)



Wednesday, November 10, 2010

Binding Silverlight DataGrid with XML file

Hello All,
In this article I would like to discuss about binding value to a Silver light DataGrid. As we know that there is no direct support for the Dataset or DataTable in the Silver light, so how can we bind the grid??? See there are multiple option for binding the grid in silver light either we can use the-
  1. 1. Collection of the Item Class,
  2. or a Dictionary or
  3. we can also use a XML File
In this article I am going to describe the way to bind a XML file that is present in the server Side, that means a User XML file can be bind to the grid in the Silver light form.Here I am Making use of LINQ to read the data from XMl file.


first We Will see that how can we access the XML file and its element. Please check the below Code.

private void getDatFromXML()
{
Uri newURL = new Uri("mydata.xml", UriKind.Relative);
WebClient cnt = new WebClient();
cnt.DownloadStringCompleted += new DownloadStringCompletedEventHandler(cnt_DownloadStringCompleted);
cnt.DownloadStringAsync(url);
}

Private void cnt_DownloadStringCompleted(object sender, DownloadStringCompletedEventArgs e)
{
dataGrid1.ItemsSource = ReadListItem(e.Result);
}

public List<Item> ReadListItem(string xmlContent)
{
List<Item> il = new List<Item>();
XElement doc = XElement.Parse(xmlContent);
il = (from ele in doc.Elements()
select GetItem(ele)).ToList();
return il;
}

You have seen that how first we downloaded the file from the server machine and then reading its content to bind the Grid. Here ReadListItem is a generic function which returns us the LIST ITEM collection, the collection can be easily bind to the Silver light data grid. We just have to set the ItemSource property of the Silver Light Data Grid. like.

dataGrid1.ItemsSource = ReadListItem(e.Result);


I hope you have Got the Idea. Please look at the XAML part of the XML file that how the content looks.


<UserControl x:Class="DataBinding.MainPage" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d"
d:DesignHeight="513" d:DesignWidth="662" xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk">

<Grid x:Name="LayoutRoot" Background="White" Height="600" Width="600">
<sdk:DataGrid AutoGenerateColumns="False" Height="200" HorizontalAlignment="Left" Margin="20,30,0,0" Name="dataGrid1" VerticalAlignment="Top"Width="450" />
</Grid>
</UserControl>


Hope You Understood the Way to bind the DataGrid in Silver light by a XML file. Please feel free to post the comments.

Thanks,
Anil Kumar Pandey
MVP (Visual C#)

Friday, July 9, 2010

SCROLLVIEWER control in Silver light

Hi all,

This time I am simply showing that how easily can we use a Scroll bar effect in our silver light page.. Scroll bar important in the page when there is an item which is not fully displayed inside the control, and we need to either Scroll UP or Scroll side to view the content completely. This Scroll bar can be taken either Horizontally or vertically and can be used either in a page panel or inside a text box to provide the scrolling functionality for its containing control..

This is a Inbuilt control for the Silver light, I am using the VS2010 and Silver Light 4 to create this sample applciation..Please look at the code for the page..

x:Class="ScrollViewerSample.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="400">

x:Name="LayoutRoot" Background="White">
VerticalScrollBarVisibility="Visible" HorizontalScrollBarVisibility="Visible" Margin="10,20,120,15">
Image Source="Bhokal.jpg" Stretch="Fill" Width="400" Height="400" >
>
>
>
>


(Due to browser problem the "<" and ">" tag are disables please include them.)


Here as you can see , simply I have taken the SCROLLVIEWER control and sets its "VerticalScrollBarVisibility" and "HorizontalScrollBarVisibility" property to true. We can set the Source of a Image(Eg. I am taking an IMAGE here), or we can also take the control like TEXTBOX.


While the Design time the page is like this...



and You can see How our SCROLLVIEWER control is working while running the application...
here is the Output screen for the application.




Hope You have like this sample, Please feel free to post your comment..



Thanks
Anil Kumar Pandey
Micorsoft MVP (C#)
Navi Mumbai,
Maharashtra

Thursday, April 29, 2010

Working with the Data Grid in Silver Light..

Hello all,

We have all worked in ASP.NET data grid and that is simple. The same data grid is also there is Silver Light but a slightly different. While searching for some stuffs i came across several articles on the same topic so i thought to share the same with you all peoples hope you like this small article.
Here simply i am taking a data grid inside the silver light page and i will show that how can be bind the grid easily. A Data grid control sets its height and width according to the page. set the auto generate column property as false, set the name as "dgPersonal" Taking some columns like ID, First Name, Last Name and Email. Using the BINDING property of the grid to bind them. Please check the following XAML code


xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d" xmlns:data="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data" x:Class="Silverlight_Data_Grid.MainPage"
d:DesignWidth="640" d:DesignHeight="480">
x:Name="LayoutRoot">

Margin="5" x:Name="dgPersonal" Height="400" VerticalAlignment="Top" HorizontalAlignment="Center" GridLinesVisibility="All" AutoGenerateColumns="False">
>
Header="User ID" Width="70" Binding="{Binding UserID}" CanUserSort="True" IsReadOnly="True" CanUserReorder="False">>
Header="First Name" Width="150" MinWidth="150" CanUserReorder="False" SortMemberPath="FirstName">
>
>
Text="{Binding FirstName}" ToolTipService.ToolTip="{Binding FirstName}" FontFamily="Arial" FontSize="11" VerticalAlignment="Center" Margin="5,0,0,0" />
>
>
>
Header="Last Name" Width="150" MinWidth="150" Binding="{Binding LastName}" CanUserSort="True" IsReadOnly="True" CanUserReorder="False"/>
Header="Email Address" Width="150" MinWidth="150" Binding="{Binding EmailID}" CanUserSort="True" IsReadOnly="True" CanUserReorder="False"/>
Header="Contact" Width="100" MinWidth="100" Binding="{Binding ContactNumber}" CanUserSort="True" IsReadOnly="True" CanUserReorder="False"/>
Header="Date Of Birth" Width="160" MinWidth="160" Binding="{Binding DateOfBirth}" CanUserSort="True" IsReadOnly="True" CanUserReorder="False"/>
>
>

>
>



The GRID will look like this, please take a look..


On the other hand in the code behind file will be like this.


using System;
using System.Collections.Generic;
using System.Windows.Controls;

namespace Silverlight_Data_Grid
{
public partial class MainPage : UserControl
{
public MainPage()
{
InitializeComponent
();
dgPersonal
.ItemsSource = Persons.GetDataItems();
}

}



here inside the main page we are simply binding the grid from the list. I have made a class for that named as PERSON.This class is creates in another class file which is named as MyData, the Person class consist of the different member variables like the UserID, Firstname, Lastname & email etc.
for creating a data source the Generic list is used inside that we are binding the records. Please take a look towards the code behind file.


using System;
using System.Collections.Generic;

namespace Silverlight_Data_Grid
{
public class Persons
{

public string UserID { get; set; }
public string FirstName { get; set; }
public string LastName { get; set; }
public string EmailID { get; set; }
public string ContactNumber { get; set; }
public DateTime DateOfBirth { get; set; }

public static List<Persons> GetDataItems()
{
List
<Persons> myPersonList = new List<Persons>
{
new Persons{ UserID="Anil", FirstName="Anil", LastName="Kumar", EmailID="anilk@pandey.com", ContactNumber="123456789", DateOfBirth=DateTime.Now.AddYears(-28)},
new Persons{ UserID="Abdul", FirstName="Abdul", LastName="javed", EmailID="abdul.javed@pandey.com", ContactNumber="123456789",DateOfBirth=DateTime.Now.AddYears(-27)},
new Persons{ UserID="chetanD", FirstName="Chetan", LastName="Desai", EmailID="chetan.desai@pandey.com", ContactNumber="123456789",DateOfBirth=DateTime.Now.AddYears(-32)},
new Persons{ UserID="manoj", FirstName="Manoj", LastName="Verma", EmailID="manojv@pandey.com", ContactNumber="123456789",DateOfBirth=DateTime.Now.AddYears(-30)},
new Persons{ UserID="vinod", FirstName="Vinod", LastName="Yadav", EmailID="vinod@pandey.com", ContactNumber="123456789",DateOfBirth=DateTime.Now.AddYears(-29)},
new Persons{ UserID="swati", FirstName="Swathi", LastName="s", EmailID="swati@pandey.com", ContactNumber="123456789",DateOfBirth=DateTime.Now.AddYears(-22)}
};
return myPersonList;

}
}
}


That's it from the coding side now we are ready to run the application.. Because the sort property is set so we can also sort the data grid records based on the column.After running the application the output will be like this.



Isn't it so simple. I too was very comfortable dealing with this grid in the silver light. We can explore more things inside the grid by our own. The main concept of this article was taken from one of the community sites of the official Microsoft Silver Light site that is http://www.silverlight.net Please feel free to comment on the article waiting for your comments....



Thanks
Anil Kumar Pandey
Micorsoft MVP (C#)
Navi Mumbai,
Maharashtra



Kontera