Friday, July 10, 2009

Silverlight websites

There are two types of Silverlight web sites that you can create in Visual
Studio 2008:
Ordinary HTML web site: In this case, the entry point to your Silverlight application is a basic HTML file that includes a Silverlight content region.
ASP.NET web site: In this case, Visual Studio creates two projects?one to contain the Silverlight application files, and one to hold the server-side ASP.NET web site that will be deployed alongside your Silverlight files.

The entry point to your Silverlight application can be an ordinary HTML file or an ASP.NET web form that also includes server-generated content.
No matter which option you choose, your Silverlight application will run the same way,the client browser will receive an HTML web page, that HTML page will include a Silverlight content region, and the Silverlight
code will run on the local computer, not the web server.

However, the ASP.NET web approach makes it easier to mix ASP.NET and Silverlight content.

Wednesday, June 10, 2009

OVERVIEW OF SILVERLIGHT


MICROSOFT SILVERLIGHT

  • Silverlight was formerly known as Windows Presentation Foundation Everywhere.

  • It is a fast and a strong competitor to Adobe Flash.

  • It is a cross-browser, cross platform plug-in, a light-weight subset of XAML, which supports Ajax, Python, Ruby, etc., and helps develop Rich Internet Applications (RIA) , and enables a rich .NET development platform that runs in the browser.

Features:
Cross-platform:
Developers can write Silverlight applications using any .NET language (including VB, C#, JavaScript, IronPython and IronRuby).

Cross-browser: It runs on all major browsers(IE, FireFox, Safari, etc).

  • Silverlight 2 does not require the .NET Framework to be installed on a computer in order to run.
  • Visual Studio 2008 and Expression Studio tool support that enables great developer / designer workflow and integration when building Silverlight applications.
  • Silverlight enables the display of high-definition video files.
  • Silverlight framework allows the developer to create impressive animation effects in less time.

Some of the important features:

WPF UI Framework: Silverlight 2 includes a rich WPF-based UI framework that makes building rich Web applications much easier. It includes a powerful graphics and animation engine, as well as rich support for higher-level UI capabilities like controls, layout management, data-binding, styles, and template skinning.

Rich Controls: Silverlight 2 includes a rich set of built-in controls that developers and designers can use to quickly build applications.

Rich Networking Support: Silverlight 2 includes rich networking support. It includes out of the box support for calling REST, WS*/SOAP, POX, RSS, and standard HTTP services.

Rich Base Class Library: Silverlight 2 includes a rich .NET base class library of functionality (collections, IO, generics, threading, globalization, XML, local storage, etc).

Monday, June 8, 2009

GRID

The Grid control is the most flexible layout panel and supports arranging controls in multi row and multi column layouts.
It is similar to HTML table.
You can use the Grid layout to create fixed or relative sized cells and you can place controls within a cell or have them span a cell.

CANVAS

  • Simplest and basic layout.
  • It provides the simple ability to absolutely position child elements.
  • It is used as a container for other Silverlight controls.

Canvas control has three properties:

  • The Left property represents the distance between the left side of a control and its parent container canvas.
  • The top property represents the distance between top of a control and its parent container canvas.
  • The Z-Index property represents the z-order of a control. that is it determines whether the control is in front of or behind another overlapping control.

RULES OF ANIMATION

1.You can set the initial state, final state and duration of the animation.Silverlight calculates the frame rate.
2.That means a Silverlight animation can do only one thing. Modify the values of a property over an interval of time.
3.For eg., the button , Width property uses the double data type. To animate in, you use the Double Animation class .If you want to modify the color that's used to paint the background of your canvas,you need to use the ColorAnimation class.

ANIMATION

  • Animation allows you to create truly dynamic user interface.
  • Animation are a core part of the Silverlight model that means you dont need to use timers and events handling code to put them into action.
  • Silverlight animations is a scaled down version of the Windows Presentation Foundation animation system.

SILVERLIGHT.JS LIBRARY

  • Silverlight.js library is a set of Javascript functions that provide interaction between unmanaged Javascript, the Silverlight plug in and Silverlight application.
  • It is a helper file which enables web sites to create advanced Silverlight installation and installation experiences.
  • It exposes function that helps to implement Silverlight application in web pages using Javascript.
  • This library allows to create a Silverlight object in the DOM, Load Silverlight applications into the object, and then handle load events.

SAMPLE CODE RESOUECE

RESOURCE

Resources can be used to:
  • Create non-visual objects.
  • Resuse objects.
  • Centralize details.

RESOURCE DICTIONARY

  • A resource dictionary can store any object.
  • You can loop through all the items.
  • Each item stored must have a unique key.
  • You can access the items using the Key or using their Index.

Sunday, June 7, 2009

LIFE CYCLE OF SILVERLIGHT

  • The user request the HTML entry page in the browser.
  • The Silverlight plug in is loaded.It downloads the XAP file with your application.
  • The Silverlight plug in reads the AppManifest.xml file from the XAP to find out what assemblies your application uses.It creates the Silverlight runtime environment and then loads your application assembly into it.
  • The Silverlight plug in creates an instance of your custom application class.
  • The default constructor of the application class raises the Startup event.
  • Your application handles the startup event and creates the Startup page.

ABOUT PANELS IN ENCODER

There are four main panels:
1.Panel-Display the video being encoded.
2.Timeline Panel-Displays the video's Timeline and various controls.
3.Media Conent Panel-Display the control you imported in the application as well as the logs.
4.Encode/Enhance/Metadata/Output panel-You can set up the way the video will be encoded.

EXPRESSION ENCODER

  • Expression encoder encodes and publishes video.
  • To encode video files,It is not a video editor though it has some video editing capabilities.
  • It is not a Silverlight application editor,though it can produce a Silverlight content.

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.




Thursday, April 30, 2009

CHARACTERISTICS OF API

1.Easy to learn.
2.Easy to use, even without documentation.
3.Hard to misuse.
4.Easy to read and maintain code that uses it.
5.Sufficiently powerful to satisfy requirements.
6.Easy to extend.
7.Appropriate to audience.

API

An application programming interface (API) is a set of routines, data structures, object classes and/or protocols provided by libraries and/or operating system services in order to support the building of applications.
An API may be:
Language-dependent:
i.e., available only in a particular programming language, using the particular syntax and elements of the programming language to make the API convenient to use in this particular context.
Language-independent:
i.e., written in a way that means it can be called from several programming languages (typically an assembly/C-level interface).
This is a desired feature for a service-style API that is not bound to a particular process or system and is available as a remote procedure call.

DATAGRID EVENTS

DataGrid columns have an ‘IsReadOnly’ property.
When set to false, the cell is an editable one.
To get the changed values and for updating the data source, the DataGrid provides the following events:
1.BeginningCellEdit
2.CommitCellEdit
3.CommittingCellEdit
4.CommittingRowEdit
5.CurrentCellChanged

DATAGRID PROPERTIES

The DataGrid supports a text box column, check box column, and a template column for customizing content.
Text box column:
The text box column will show content in a text block control in non-editing mode and in a text box control in editing mode.
Check box column:
The check box column renders content in a check box control.
It provides an IsThree state property when set to true.
The state of the check box can be Checked, Unchecked, or Indeterminate.
Template column:
For custom content/controls on the column, we can use the template column.
CellTemplate and CellEditing template columns can be used for changing content in edit mode.

DATAGRID

The DataGrid is one of the powerful controls in Silverlight 2.0.
Data binding is a powerful way to create a connection between our UI and a source of data.
This simple technique can be used to create a clean separation between our user interface and its underlying data.

STORYBOARD

A Storyboard is the container that we can put animation objects in.
We have to make the storyboard a resource that is available to the object that we want to animate.

Wednesday, April 29, 2009

SOCKET CLASS

The Socket class allows you to perform asynchronous data transfer using the following methods:
· ConnectAsync - Starts an asynchronous request for a connection to the remote host.
· SendAsync - Writes outgoing data from one or more buffers on a connected socket.
· ReceiveAsync - Reads incoming data into one or more buffers from a connected socket.
· Shutdown - Finishes any pending send operations, and signals the remote endpoint that the connection should be closed. If Send is specified, data may still be received until the remote computer closes its end of the connection (indicated by receiving 0 bytes).
· Close - Closes the remote host connection and releases all managed and unmanaged resources associated with the socket.

SOCKETS

Sockets are used for communication among applications over a network.
Network architecture can be generalized as consisting of four layers:
1. Application
2. Transport
3. Network
4. Link and Physical

WEB 2.0

Web 2.0 is all about the following and more...

1. User Centric and User Oriented

2. Web Services, Web API's

3. Widgets, Gadgets, Mashup's

4. Blogs, Feeds, Wiki's, Tagging, Podcasting

5. Social profile

6. Social bookmarking

7. Client rich technologies like CSS, HTML, DOM, XML, AJAX, JSON, XHTML, REST, SOAP

Sunday, April 19, 2009

XAML

Extensible Application Markup Language (XAML) is a declarative language.
We can create visible user interface (UI) elements in the declarative XAML markup.
We can then use a separate code-behind file to respond to events and manipulate the objects you declared in XAML.
An XML-based declarative language is very intuitive for creating interfaces from prototype to production, especially for people with a background in Web design and technologies.
XAML files are XML files that generally have the .xaml file name extension.

Creating a Silverlight plug-in

The goal of creating a Silverlight plug-in is to host a Silverlight application.
This plugin can be created in at least two different ways.
One of these approaches is to use the Silverlight server control that’s part of the Silverlight 2 Software Development Kit (SDK).2
In general, if you’re an ASP.NET developer, this is the approach you’ll want to use.
But we’re going to discuss the specifics of a Silverlight plug-in while covering another approach. Another approach for creating a Silverlight plug-in enables you to deliver Silverlight content through any server technology.
You can use Silverlight along with a variety of technologies including PHP, JSP, ASP, and ASP.NET.
To get Silverlight to work with these technologies, you use the two steps covered in this section. The first step is to reference the required Silverlight utility file.
The second step involves writing the JavaScript that will create an instance of the Silverlight plug-in.

Delegates properties

  • Delegates are similar to C++ function pointers, but are type safe.
    Delegates allow methods to be passed as parameters.
    Delegates can be used to define callback methods.
    Delegates can be chained together; for example, multiple methods can be called on a single event.
    Methods don't need to match the delegate signature exactly.

C# version 2.0 introduces the concept of Anonymous methos, which permit code blocks to be passed as parameters in place of a separately defined method.

Delegates

A delegate in C# is similar to a function pointer in C or C++.
Using a delegate allows the programmer to encapsulate a reference to a method inside a delegate object.
The delegate object can then be passed to code which can call the referenced method, without having to know at compile time which method will be invoked.
The signature of a single cast delegate is shown below:
delegate result-type identifier ([parameters]);

Events

Delegate usefulness does not just lie in the fact that it can hold the references to functions but in the fact that it can define and use function names at runtime and not at compile time.
A large goal of design delegates is their applicability in events model of .Net.
Events are the actions of the system on user manipulations (e.g. mouse clicks, key press, timer etc.) or any event triggered by the program.

Resource Dictionary

A resource dictionary is a keyed dictionary of objects that can be used both in XAML and in code. XAML is the most common usage, particularly for initially defining objects in a resource dictionary.
Resource dictionaries can exist at several positions in an application structure, including as immediate (page) resources, application resources (as part of the application object) or as XAML files that are kept separate and unloaded in the application structure, for later run-time use. Resource dictionaries commonly support two major Silverlight scenarios: defining templates for controls, and defining storyboards for animated properties.
We can change the build properties on the Resource Dictionary from Page to Content or Resource depending on our intentions; Content for Xaml; and Resource for codebehind.

Moonlight

Moonlight is an open sourceimplementation of the Silverlight browser plug-in based on Mono(an open source implementation of .Net)
  • Allows Silverlight application to run on LINUX.
  • Offers a Linux SDK for silverlight applications.
  • Use the existing silverlight engine to develop desktop application.

Mouse Events

Mouse Entered event is raised when mouse pointer enters inside the object area.
Mouse Leave event is raised when mouse pointer leaves object area.
MouseLeftButtonDown event is raised when left mouse button is clicked.
MouseLeftButtonUp event is raised when left mouse button is released button after clicking.

Path element

Path element is used to draw complex type of shapes. To use Path element we need to set a special type of attribute called Data. The Data attribute string contains several single character string and all have different meaning.

  • M denotes the start point in the absolute valuem denotes the start point in an offset to the previous point.
  • L denotes the straight line between the current line and the specified point.
  • H denotes the horizontal line between the current point and the specified x-coordinate.
  • V denotes the vertical line between the current point and the specified y-coordinate.
  • C denotes a cubic Bezier curve between the current point and specified end point by using the two specified control points.
  • Q denotes the quadratic Bezier curve point between the current point and the specified end point by using a specified control point.
  • S denotes a cubit Bezier curve between the current point and specified end point by using the two specific control points.
    A denotes the elliptical arc between the current point and the specified end point.
  • Z denotes the end of the current shape and creates the line that connect the current point to the starting point.

Silverlight websites

There are two types of Silverlight web sites that you can create in Visual
Studio:
Ordinary HTML web site: In this case, the entry point to your Silverlight application is a basic HTML file that includes a Silverlight content region.
ASP.NET web site: In this case, Visual Studio creates two projects-one to contain the Silverlight application files, and one to hold the server-side ASP.NET web site that will be deployed alongside your Silverlight files.
The entry point to your Silverlight application can be an ordinary HTML file or an ASP.NET web form that also includes server-generated content.

Silverlight plug-in

  • The Silverlight plug-in is a lightweight browser plug-in responsible for rendering Silverlight content.
  • This content is intended to be rendered consistently across platforms.
  • To ensure that this occurs, the Silverlight plug-in must take advantage of each platform’s plug-in technology.

Windows Workflow Foundation (WF)

WF is used to model complex workflow processes.
CardSpace is the embodiment of new security and user authorization functionality.

Windows Communication Foundation (WCF)

WCF encompasses the ASP.NET Web Services and .NET remoting functionality that was contained in the .NET Framework 2.0 as well as new communication technologies.

Windows Presentation Foundation (WPF)

  • WPF is used to develop elaborate user interfaces like those that adorn Windows Vista and managed advanced media streaming and integration.
  • WPF is the a complete revamp of Windows Forms so that user interface, graphic, and media development is now designed around the .NET Framework.

.NET Framework

The four primary additions to the .NET Framework as of version 3.0 are:
Windows Presentation Foundation (WPF)
Windows Communication Foundation (WCF)
Windows Workflow Foundation (WF)
CardSpace Windows Presentation Foundation (WPF)

Canvas layout container

A Canvas layout container defines a rectangular region in which you place child containers and controls.
Unlike all other components, you cannot let Flex lay child controls out automatically.
You must use absolute or constraint-based layout to position child components.
With absolute layout you specify the x and y positions of the children; with constraint-based layout you specify side or center anchors.

Stack panel

A stack panel allows you to stack elements in an assigned direction. Based on the properties that you define within a stack panel, content can flow both vertically (by default) and horizontally.
A stack panel is predominantly used within list controls, such as within a list box or within the pop-up list in a combo box.
Any element that you create or draw within a stack panel will be added automatically as the last child element in the stacking order of the elements in the panel.

Grid Layout

The grid layout is an invisible control that helps you in arranging and aligning controls in an application, group or other container in a tabular manner.
USAGE:-

  • Use the grid layout to align controls within containers in a tabular fashion. The grid consists of cells that are arranged in rows and columns. Various controls can be added to the cells. We can insert the grid layout into any container control. Especially, use it in groups, tabstrips and trays (iViews).
  • The most common usage of the grid layout is the layout of forms inside containers and the arrangement of different containers. There are two attributes for managing the spacing between rows and columns, cellSpacing and cellPadding.

RIA

Rich Inernet Applications are Web applications that have the features and functionality of traditional desktop applications
RIAs typically transfer the processing necessary for the user interface to the web client but keep the bulk of the data processing on the application server

Silverlight

Silverlight is a programmable Web browser plug-in that enables features such as animation,vector graphics and audio-video playback that characterises rich internet application

Friday, April 3, 2009

silverlight

hi i'm currently working in silverlight..i want to add agmenu.how can i?

3/4/09

created own blog