Thursday, May 28, 2009

TOGGLEBUTTON PART2

<ToggleButton x:Name="tbtnTest" IsThreeState="True" Indeterminate="tbtnTest_Indeterminate" Checked="tbtnTest_Checked" Unchecked="tbtnTest_Unchecked" Canvas.Top="60" Canvas.Left="30" Content="Change state"/>

Code behind (C#):
private void tbtnTest_Checked( object sender, RoutedEventArgs e )
{
this.tblText.Text = "Checked";
}

private void tbtnTest_Unchecked( object sender, RoutedEventArgs e )
{
this.tblText.Text = "Unchecked";
}

private void tbtnTest_Indeterminate( object sender, RoutedEventArgs e )
{
this.tblText.Text = "Indetermined";
}

TOGGLEBUTTON

The Togglebutton is a Silverlight Control which allows the user to change its state.
It is the base class for Checkbox and RadioButton.
Important events are Checked and Unchecked.
Interesting property is the IsThreeState.

Wednesday, May 27, 2009

HYPERLINK BUTTON PART2

The HyperlinkButton is a Silverlight control which acts as a hyperlink.

NavigateUri-It gets or sets the URI to navigate when the button is clicked.

Target Description

_blank, _media, or _search Loads the linked document into a new blank window.
_parent, _self, _top, or "" Loads the page into the window in which the link was clicked (the active window).

Hyperlink button

HyperlinkButton x:Name="HYPERTEST" Canvas.Top="40" Canvas.Left="30" TargetName="_parent"
Content="Click here to Visit My Blog" Foreground="Red"
FontSize="30" FontFamily="NewTimesRoman"
NavigateUri="http://www.shakthee-silverlight.blogspot.com"

Monday, May 25, 2009

Transformation

A transformation is technically only a change of one or more values. For instance, if an element is rotated, its position and the location of all the drawing points of the element change.
Silverlight supports five transformation:
1.TranslateTransform
Changes the position of an element
2.ScaleTransform
Scales an element by multiplying its dimension horizontally and vertically
3.SkewTransform
Skews an element by using a horizontal and a vertical angle
4.RotateTransform
Rotates an element by using a angle
5.MatrixTransform
Multiplies all points of an element by a given matrix,and uses the result as the new value.

Cross domain Policy

In order for a cross domain request to a particular web service to succeed, that web service needs to explicitly opt-in to 3rd party callers.
In Silverlight 2, the primary way of enabling cross domain calls is through a policy file placed at the root of the server. It support two types of policy files:
1.Silverlight Cross Domain Policy File (clientaccesspolicy.xml)
2.(A subset of the) Flash Cross Domain Policy File (crossdomain.xml)

Silverlight Advantages

Rich UI applications using WPF (similar to Desktop applications).
Cross-browser, cross-platform plug-in.
Rich Media experience. Possible to collaborate Media objects such as Video Streaming, Animations, etc.
Search-engine friendly .
Application is firewall-compatible .
Socket/TCP programming for multi-player networking support .
Overlaying of Silverlight controls is possible as each Silverlight components is rendered in HTML DIV tags.