Thursday, May 28, 2009

RADIOBUTTON PART2

XAML CODE:
<StackPanel Background="White">



Foreground="Blue" Content="C# Corner" Click="RadioButton_Click"/>
Foreground="Orange" Content="ASP Alliance" Click="RadioButton_Click"/>
Foreground="Green" Content="Code Project" Click="RadioButton_Click"/>
Foreground="Purple" Content="Code Plex" Click="RadioButton_Click"/>




CODE BEHIND:
private void RadioButton_Click(object sender, RoutedEventArgs e)
{
if (Button1.IsChecked == true)
TextBox1.Text = Button1.Content.ToString();
else if (Button2.IsChecked == true)
TextBox1.Text = Button2.Content.ToString();
else if (Button3.IsChecked == true)
TextBox1.Text = Button3.Content.ToString();
else
TextBox1.Text = Button4.Content.ToString();
}

RADIOBUTTON

  • A RadioButton is usually used in a group with multiple options where one has to be selected.
  • The GroupName property of a RadioButton assigns a RadioButton to a group.
  • Only one RadioButton can be in the selected states at once and by selecting a new RadioButton unselects the previous selected RadioButton.
  • RadioButton control has Checked event as default event and raised when you check a radio button.

REPEATBUTTON

  • The RepeatButton is a Silverlight control which does an action repeatedly from the time user presses it til the time it is released.
  • An important property is the Interval. Its value is in milliseconds and it determines the interval between the occurrences of the Click event while the button is being pressed. The default is 250.
  • The Delay property determines the time in milliseconds between the pressing of the button and the time when the button starts repeating the Click event. The default is 250.

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.

Saturday, May 23, 2009

WEBSERVICE & API

A web service is a form of API (Application Programming Interface).
Web service is like advanced Urls and API is Programmed Interface.
API contains classes and Interfaces just like a program.

Tuesday, May 19, 2009

IIS 7

  • Windows Server 2008 delivers IIS 7, which is a unified Web platform that integrates IIS, ASP.NET, Windows Communication Foundation, and Windows SharePoint Services.
  • IIS 7 allows developers to customize the functionality of Internet Information Services (IIS), create applications to assist in managing IIS, or create applications that run on IIS.
  • IIS 7 also enables the extensibility of configuration, scripting, event logging, and administration tools, providing software developers with a complete server platform on which to build Web server extensions.

PARTS & STATES MODEL

Parts and States Model, calls for a strict separation between the logic of the control and its appearance.
The advantage of decoupling logic from appearance is that a developer is free to change appearance and behavior separately, providing great freedom, especially when working with professional designers.
The Parts and State Model is built on these key concepts:
  • Parts
  • States and State Groups
  • Transitions

TEMPLATES

Template is nothing more than a way to define custom control rendering.
More complex templates may use many more controls, styles, bindings and even include animations using Silverlight's Visual State Manager.

CONTROL TEMPLATE

Control templates are defined using the ControlTemplate element which acts as a container for template controls and defines the target control type of the template by using the TargetType attribute.
By defining control templates within styles you can easily re-use a template across multiple controls.

Friday, May 8, 2009

.XAP FILE

XAP-Xtensible Ajax Platform
This is a Silverlight package that contains everything you need to deploy you Silverlight applications including the application manifest, the project assembly and any other assemblies that your application uses.
If you want to see the contents inside the xap files means just rename it as for example
MySilverlightapp.xap.zip

DATA TEMPLATE IN DATABINDING

A data template describes the controls we want to use when displaying each individual item in a collection.