5 Simple Steps to Commanding in Silverlight

Leave a comment

http://www.johnpapa.net/5-simple-steps-to-commanding-in-silverlight/

Disable intellisense for speed up Silverlight App with WCF RIA Service

1 Comment

1. Disable WCF RIA Service intellisense

[HKEY_LOCAL_MACHINE]\SOFTWARE\Wow6432Node\Microsoft\WCFRIAServices\v1.0

Right click on the right (where the values are) and select NEW > DWord 32 bit value called: DisableLiveIntellisense
Right click the value you just added and select Modify.
Enter the Value 1

2. Disable XAML intellisense

Set the following registry key to 0:
HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\10.0\Text Editor\XAML\Auto List Members

Call javascript from silverlight, How to?

Leave a comment

1. javascript function

<script language=”javascript”>
function SayHello()
{
alert(“Hello from JavaScript, invoked by Silverlight”);
}
</script>

2. .xaml

<Grid x:Name=”LayoutRoot” Background=”White”>
<Button x:Name=”btnSayHello” Content=”Say Hello”
Click=”btnSayHello_Click”></Button>
</Grid>

3. .xaml.cs

private void btnSayHello_Click(object sender, RoutedEventArgs e)
{
HtmlPage.Window.Invoke(“SayHello”);
}

4.  include HtmlPage class

using System.Windows.Browser;

Silverlight 2.0 and ASP.NET tutorial: Getting started

Leave a comment

Introduction

Silverlight 2.0 Beta is available now. So what’s new in this version compared to Silverlight 1.0/1.1? In easy words: It’s (almost) as powerful as WPF. This article will help you getting started with Silverlight 2.0 and VS 2008. We will explain the installation of the Silverlight Tools for VS 2008 and create a little Silverlight project using new Layout-functionalities and controls.

What’s new?

New controls
Silverlight 2.0 ships with many new controls like: CheckBox, Calendar, Grid, GridSplitter, MediaElement, ScrollViewer, StackPanel, TextBox, Slider, Tooltip… 

When using the Designer with VS 2008 and the Toolbox, it feels like you are designing a GUI for WPF. You can add eventhandlers to the controls like a Click-Handler for a Button

<Button Content="Page 1" Margin="3" Click="Button_Click"></Button>
The code of the handler looks like this:
private void Button_Click(object sender, RoutedEventArgs e) { // TODO }
Layout enhancements
The layout manager support in Silverlight 2.0 is a part Silverlight UI Framework which is a compatible subset of the WPF UI Framework. Other parts of this Framework which are available in Silverlight are Databinding supportControl templates and Skinning.

Base class library
Silverlight contains a .NET base class library with support for functionalities of the namespaces Collections, IO, Generics, Threading, Globalization, XML and many more.

Installation

For getting started with Silverlight 2.0 Beta and VS 2008 you will have to download the Silverlight Tools Beta1 for VS 2008 from here.

After installation the following VS project templates for Silverlight are available: