A new home

I’ve made the move to WordPress!

You should be automatically redirected in 5 seconds. Please visit World Wide Code on Wordpress

Hope to see you there!
Showing posts with label silverlight 5. Show all posts
Showing posts with label silverlight 5. Show all posts

Sunday, May 15, 2011

Silverlight 5 - 3D support


The 3D Graphics API was added in the recently released Silverlight 5 Beta.

Having 3D graphics support is a major advancement in Silverlight and is expected to have a huge impact in the near future.

One area where the 3D Graphics API can be useful is 3D Graphics

3D Physics demo




There are a lot of places that you can visit to gain more knowledge about the 3D Physics.
Here are some useful links:
Another nice implementation of the 3D Graphics API is Augmented Reality.
Augmented Reality demo

Useful Links
I would have appreciated more documentation from the Silverlight Team on the 3D Graphics API.
Let's wait and see how these features are implemented by various people. (If you have a good implementation don't forget to ping me)

Sunday, May 1, 2011

What’s Coming In Mango–Reminders


Mango is the next update to Windows Phone 7. Its set to bring a lot of features with it, including something called as "Reminders"

This is what you could be able to do:



What are you waiting for, see this latest post from Jesse Liberty on his blog.

Tuesday, April 26, 2011

Implicit Templates in Silverlight 5


Silverlight 5 has added many new useful features. If you have not read about Silverlight 5's new features then read Silverlight 5: What’s New.

Implicit Templates is one of the new features included in Silverlight 5. Implicit Templates can be said to be data templates associated with a particular data type. These templates will be applied to all template-driven controls which are trying to display the specified data type.

For example, If you have two classes Manager and Employee both derived from the Person class. Now you would like to display the list of people in your company with different styling for each type of person. this is where Implicit Templates make your life easy.

Just specify two Data Templates for each of the two classes i.e. Manager and Employee.

<ListBox x:Name="PeopleList">
<ListBox.Resources>
<DataTemplate DataType="local:Manager">
<StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding Name}" FontWeight="Bold" />
<TextBlock Text="(Manager)"  FontStyle="Italic" Margin="5,0,0,0"/>
</StackPanel>
</DataTemplate>
<DataTemplate DataType="local:Employee">
<StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding Name}" />
<TextBlock Text="{Binding ManagerName, StringFormat='Managed by: {0}'}" FontStyle="Italic" Margin="5,0,0,0" Foreground="Gray" />
</StackPanel>
</DataTemplate>
</ListBox.Resources>
</ListBox>

This will display some thing like this:


Implicit Templates does allow you to easily specific unique characteristics of an object in your data template.

Another example many people use for Implicit Templates  is Twitter. See this example from Pete Brown. In his post, Pete Brown describes Implicit Templates in more detail. 



Install Silverlight

Video: Pete Brown demonstrates Implicit DataTemplates.

Related Links

Saturday, April 23, 2011

Silverlight Trusted Applications


A new feature Silverlight 5 Beta has introduced is the ability to do some of the “trusted” features in the browser.

This brings the current functionality of trusted applications in current form to be used in the browser context without having to be installed.


This still requires the XAP to have the Elevated Permissions security setting in the manifest as it would exist with out-of-browser applications as well as the XAP being signed (and the certificate in the user’s trusted publisher store).


For example, Multiple window support has been added in Silverlight 5 Beta for Trusted OOB applications. Here's a code snippet from xamlgeek.net

Silverlight 5 supports the ability to open multiple top-level windows. It is required that the application run with elevated permissions.
clip_image001
Closing the main application window will cause all windows to close.
I would be writing more in detail about each of the new Silverlight 5 features in future posts...
For more on how to create a trusted application follow the guide below:

Request elevated trust

Check the "Require elevated trust when running outside the browser" check box in the Out-of-Browser Settings dialog box.
Out-of-Browser Settings dialog box, Require elevated trust option

When users attempt to install an application that requires elevated trust, they are shown a security warning instead of the normal install dialog box. The default warning indicates that the publisher is not verified, and does not display your application icon.

Security Warning dialog box for unsigned application requiring elevated trust

Sign your XAP

You should always sign an application that requires elevated trust to enable verification that you are the publisher. For debugging purposes, Visual Studio lets you create and use a test certificate.
Signing page, project designer

A signed application still displays the security warning at install time, but the message is milder and includes your application icon.

If you would like to know more about application signing visit this MSDN article.
Security Warning dialog box for signed application requiring elevated trust

After installation, the trusted application can access all of the out-of-browser features. Additionally, it is not subject to security restrictions such as user-consent requests and full-screen keyboard limitations.


Related links

Thursday, April 21, 2011

Silverlight 5: What's New


Scott Guthrie announced Silverlight 5 in Silverlight Firestarter event last December 2010. Now at the MIX11 conference Scott Guthrie announced the availability of Silverlight 5 Beta.

Lets see what this new Silverlight 5 Beta release has to offer.

    • XAML debugging
    • Media
    • Text
    • Implicit Data Templates
    • Markup Extensions
    • Controls
    • 3D Graphics
    • Trusted Applications in Browser
    • Trusted Applications
    • General “stuff”
XAML debugging
Like the name suggests, you can now set a break point in XAML on any line has a {Binding} syntax. Here is Pete Brown demonstrating XAML debugging.

Media

Silverlight 5 now has something similar to Windows Phone called SoundEffect. You can also control the volume, pitch, etc. in the SoundEffect class. TrickPlay or variable speed playback is also supported in this release.

Text

A RichTextBoxOverflow element has been introduced, that will allow you to have linked text containers where the text flows to another element.  This will help with automatically laying out text in situations like mulit-column.

A few things that are still being worked on are improving text clarity using pixel-snapping and enhanced OpenType support.  Some of these were demonstrated at MIX so be sure to watch the keynote and session videos!


Implicit Data Templates

It is now possible to specify a Data Type for a particular Data Template. This means that you can have different representation of  two different objects in the same list depending on their data types.
<ListBox x:Name="PeopleList">
<ListBox.Resources>
<DataTemplate DataType="local:Manager">
<Border Background="LightBlue">
<StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding FirstName}" />
<TextBlock Text="{Binding LastName}" />
</StackPanel>
</Border>
<DataTemplate>
<DataTemplate DataType="local:Employee">
<Border Background="Bisque">
<StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding FirstName}" />
<TextBlock Text="{Binding LastName}" />
</StackPanel>
</Border>
</DataTemplate>
</ListBox.Resources>
</ListBox>
I would say this feature is going to help a lot for people who deal with different sets of data at a time. As always we have Pete Brown demonstrate Implicit Data Templates.

Markup Extensions

This will help with those who follow the MVVM pattern of development as well as those who have been yearning to be able to have their own expressions run on markup. Allowing Markup Extensions is a great feature, lets see how it affects Silverlight development in the near future.

Controls

On a control level Silverlight 5 Beta brings for us Multi Click and multiple window support.

We now have a ClickCount property in the MouseButtonEventArgs that can be used to determine if a double-click or triple click event has been generated.


Multiple-window is the same Window element that the MainWindow shares and you are able to create numerous Windows that your application can interact with and show as separate windows in the OS.  This is not a ChildWindow implementation where they are all within the main object.  This feature is available to out-of-browser applications.  Once the main application is closed, all the Windows created from that will close as well.


3D Graphics

One of the coolest demos at the Silverlight Firestarter was the 3D demonstrations.

Wednesday, April 20, 2011

Setting the filename in the Save As Dialog in Silverlight


What can I say? Setting the filename in the Save As Dialog in Silverlight is (how should I put it?) not possible.

This is a feature required by many one of you who are using the current version of Silverlight. Current version?


If might not have noticed but this feature suggestion will now be available in Silverlight 5 Beta. This is because Tim Heuer has just flagged the Setting the filename in the Save As Dialog in Silverlight suggestion  as "Planned" (On 14th April).


This is one of many suggestions from the Silverlight Feature Suggestions Forum that have been accepted or planned to debut in Silverlight 5 Beta.


Some other useful suggestions that have been accepted are


If you have not added your favorite feature suggestion, do it now, may be it could be included in the next Silverlight release.


For more on what can you expect from Silverlight 5 , see Scott Guthrie's blog post Announcing Silverlight 5.

Related Links