Dotnetdreamer's Weblog

SharePoint, Silverlight and Azure

Posts Tagged ‘Silverlight’

Silverlight 3 – Out-of-the-Browser Applications

Posted by Ramprasad Navaneethakrishnan on April 24, 2009

Hi fellas,

This post was in my draft for quite a time now. Finally publishing it. ūüôā

Silverlight 3 Beta is released and have already written a post on ‘Element to Element Binding’ which is one of the coolest additions to the latest version of Silverlight. When explored further, I came across this astonishing feature called Out-of-the-Browser Applications – which means your Silverlight Apps can run without the browser, in offline, just like a normal desktop applications will. Remember this kind of feature is not even present in Adobe AIR or Flash.

Now the obvious question in your mind is, should I write additional code to take advaentage of this feature? No there is no extra coding involved. However you need to make samll changes in the AppManifest.xml file. What are those changes?

  • Add two properties ‘EntryPointAssembly’ and ‘EntryPointType’ in the Deployment tag.¬† EntryPointAssembly should contain the value of your application name and EntryPointType should have the value of your applicationname.App. It should look like this.

<Deployment xmlns=”http://schemas.microsoft.com/client/2007/deployment” xmlns:x=http://schemas.microsoft.com/winfx/2006/xaml¬†EntryPointAssembly=”YourApplicationName” EntryPointType=”YourApplicationName.App”

  • Now add the following section under the deploument tag

<Deployment.ApplicationIdentity> 

<ApplicationIdentity ShortName=”Your Application’s Name” Title=”Your Applications’s Title”>

<ApplicationIdentity.Blurb>

Type text that will be displayed as tooltip for your application

</ApplicationIdentity.Blurb>

</ApplicationIdentity>

</Deployment.ApplicationIdentity>

  • Now run your application. Right click on your browser screen. You will get an option “Install this application onto your computer” in addition to the “Silverlight Configuration” option. Select “Install this application onto this computer” option. Now windows will prompt for the shortcut locations to select.¬† When clicked Ok, the application will be installed locally.

 

Pleasea leave your comments. 

Thanks.

 

Advertisements

Posted in Silverlight | Tagged: , , , , , | Leave a Comment »

Silverlight 3 – Element to Element Binding

Posted by Ramprasad Navaneethakrishnan on April 24, 2009

Hi Folks..

Silverlight 3 Beta 1 is released and as expected, Microsoft has added some cool features. I am very excited about this new feature called Element to Element binding and lets do a walk through.

Element To Element Binding let binding a control’s property directly with another control’s property. For example, we can bind the value property of a slider control directly to the width property of a Rectangle control in the XAML iteself. Let’s see the example..

  1. Make sure you have installed the followng Silverlight 3 sdk and tools
  2. Create a Silverlight application in the visual studio and in Page.xaml paste the following lines
  3. < Grid x:Name=”LayoutRoot” Background=”White”>¬†¬†<RowDefinition></RowDefinition>

     <RowDefinition ></RowDefinition>

     </Grid.RowDefinitions>

    ¬†¬†<Slider x:Name=”mySlider” Grid.Row=”0″ Minimum=”0″ Maximum=”400″ Value=”50″ Orientation=”Horizontal” ></Slider>

    ¬†¬†<Image Source=”DSC00443.JPG” Width= “{Binding Value, ElementName=mySlider}” Height=”{Binding Value, ElementName=mySlider}” Grid.Row=”1″ ></Image>

    </Grid>

     

     

    <Grid.RowDefinitions> Note that we have binded the width property of the image with the value property of the Slider control like this

    1. Width =”{ Binding Value, ElementName=mySlider}”
  4. Now go ahead and hit the F5 button
  5. Drag the Slider control and see the width of the image getting changed according to the value of the Slider control.

Cool. Isn’t it.

Please give your feedback on this post.

 Thanks,

Ramprasad

 

Posted in Silverlight | Tagged: , , , , , , , , , | 2 Comments »

Debugging Silverlight Application

Posted by Ramprasad Navaneethakrishnan on March 5, 2009

Yesterday, few of my collegues tried their¬†hands on Silverlight application for the first time and they faced this issue, a simple one which will be faced by most of the Silverlight novices. The issue¬† is “Debugger not getting hit in the Silverlight project . So why is this? How to solve this?

Solution:

All Silverlight applications will have a hosting application which will be an ASP.NET web application..

1. Right click the ASP.NET web application – -> Properties

2. In the properties window, select the tab Web.

3. In the debugger’s section, check the Silverlight checkbox.

 debuggingsilverlight

4. Save the project properties.

5. Hit F5. Now you will be able to debug the Silverlight project

Leave your comments please.

Thanks.

Posted in Silverlight | Tagged: , , , | 19 Comments »

Silverlight 2 Tools – Offline Installation

Posted by Ramprasad Navaneethakrishnan on March 3, 2009

Hi.. 

Ever wondered why the error “Hash value is not correct. ” is coming while installing Silverlight¬†Tools?¬† This is because, while installing Silverlight¬†Tools, the setup tries to download silverlight developer runtime, ‘Silverlight.2.0_Developer.exe’ from internet. If you have¬†an internet connection, a connection that does not block downloading exe’s then you should not face any problem during the installation. But if you are not connected to internet, or your firewall blocks downloading exe’s, then you will get this error – “Hash value is not correct.”

So how to install Silverlight Tools offline, without internet connection?

The solution is simple..

1. Download Silverlight tools and Silverlight developer runtime from a computer that has internet connection.

2. Go to command prompt

3. Navigate to the folder containing the Silverlight tools setup “Silverlight_Tools.exe“.

4. Run the command Silverlight_Tools.exe/x.

5. The windows will show a popup that asks for a location to extract files. Specify a location. The tools setup now extracts all the contents to this location

6. Paste the setup ‘Silverlight.2.0_Developer.exe’ in the above mentioned location. Now the ‘Silverlight Tools offline installation package‘ is ready!

7.  Go to the computer(the one without  internet connection)where you want to install Silverlight tools.

8. Paste the Silverlight Tools offline installation package.

9.  Run SPInstaller.exe (this is present inside the package)

10.¬† Now you can see the message ‘Installation completed successfully’.

 

Let me know your comments please..

Thanks,

Ramprasad.

Posted in Silverlight | Tagged: , , , , , , , | 8 Comments »

Silverlight 2 DataGrid – Frozen Columns

Posted by Ramprasad Navaneethakrishnan on January 31, 2009

Not long ago, we had a requirement in our project where a datagrid should hold 14 columns, out of which the first column should be static and the remaining should be scrollable.

ASP.NET datagrid does not support such requirements or for that matter no control in ASPNET toolbox. So ultimately we had to deal with multiple tables and messy javascripts to satisfy that requirement. Now that piece of code is difficult to manage and not friendly for change.

Now, Silverlight 2 DataGrid is released which comes with new in-built features like Auto-Sizing, Multiple-Column Sorting, Frozen Columns etc..

Frozen Column:

Forzen Column makes the column to freeze(remain static while other columns are scrolling). When you have 14, 15 columns in a datagrid, you might want the first column or the first two column to remain static while scrolling thorough the other columns.

FrozenColumnCount:

The FrozenColumnCount property of the Silverlight 2 DataGrid takes the number of columns the user want to freeze starting from the left most column.

Example:

This is my Silverlight 2 DataGrid..

<my: DataGrid
x:Name=”myDataGrid”>
</my: DataGrid>

It has 10 columns and by default all the columns are scrollable..

Silverlight 2 DataGrid

Silverlight 2 DataGrid

When FrozenColumnCount is set to 1, the first column will remain static and the scroll bar appears only for the remaining 9 columns.

<my: DataGrid
x:Name=”myDataGrid”
FrozenColumnCount=”1″>
</my: DataGrid>

this is how the DataGrid looks

Silverlight 2 DataGrid with Frozen Column

Silverlight 2 DataGrid with Frozen Column

In case, if we want to make the first two columns to remain static, then the FrozenColumnCount should be set to 2.

<my: DataGrid
x:Name=”myDataGrid”
FrozenColumnCount=”2″>
</my: DataGrid>

Silverlight 2 DataGrid with Frozen Columns

Silverlight 2 DataGrid with Frozen Columns

Posted in Silverlight | Tagged: , , , , , , , , , | 1 Comment »