Wednesday, June 10, 2009

Silverlight and Xaml

XAML is an XML-based language that is used to define the visual assets of your application.this includes UI's graphical assets ,Animations,Media,Controls and more.It's designed as discussed earlier to bridge the gap between designers and developers when creating applications.The XAML used in silverlight differs from that of WPF it is asubset that is focussed on Web-Oriented features.Xaml uses XML to define the UI using XML elements.At the root of every Silverlight Document there is a container element,Such as a Canvaswhih defines the spae on which your UIwill be drawn.Here is an example given below:
<Canvas
Xmlns="
http://Schemas.microsoft.com/client/2007 "
Xmlns:X="
http://Schemas.microsoft.com/Winfx/2006/Xaml"
Width="640" Height="480"
Background="White">
</canvas>


Xaml Supports Shapes

It supports number of shapes that can be combined together to form more complex objects.You'll find a lot of more details about using XAML now let me show the basic XAML shapes.
  • Retangle:Allows you to define a rectangular shape on the screen.
  • Ellipse: Allows you to define an ellipse or circle.
  • Line: Draws a line connecting two points.
  • Polygon:Draws a many-Sided shape.
  • Polyline:Draws many line segments.
  • Path: Allows you to create a non-linear path.

PointAnimation

This allows points that define a 2D space to be animated as you change the properties ,You can do it in a linear manner,in which you would define a number of milestones along which the animation occursand it animates the value of a Point property between two target values by using linear interpolation over a specified Duration.

ColorAnimation

Animates the value of a Color property between two target values by using linear interpolation over a specified Duration and this allows colored properties,Such as fills,to be transformed.

DoubleAnimation

This Allows numeric properties,Such as those used to determine location,to be animated.
Animates the value of a Double between two target values by using linear interpolation over a specified Duration.

Xaml supports Animation

It Supports Animation through defining how their properties are changed over time using a timeline.These timelines are continued within a storyboard.Different Types of animation Include:
  • DoubleAnimation.
  • ColorAnimation.
  • PointAnimation.

Alternative input & Accessibility-Features Of WPF

  • WPF supports digital Ink-related functionality.
  • WPF Microsoft UI Automation to allow developers to create accessible interfaces.

Text-Features of WPF

  • WPF includes a number of typographic and text rendering features that were not available in GDI. This is the first Windows programming interface to expose OpenType features to software developers, supporting OpenType, TrueType, and OpenType CFF (Compact Font Format) fonts.
  • Support for OpenType typographic features includes:
  • Ligatures Old-style numerals (for example, parts of the glyph hang below the text baseline)
  • Swash variants Fractions
  • Superscript and Subscript
  • Small caps
  • Line-level justification
  • Ruby characters
  • Glyph substitution
  • Multiple baselines
  • Contextual and Stylistic Alternates
  • Kerning

WPF handles texts in Unicode, and handles texts independent of global settings, such as system locale. In addition, fallback mechanisms are provided to allow writing direction (horizontal versus vertical) handled independent of font name; building international fonts from composite fonts, using a group of single-language fonts; composite fonts embedding.

Tuesday, June 9, 2009

Documents-Features Of WPF

  • WPF natively supports paginated documents. It provides the DocumentReader class, which is for reading fixed layout documents. The FlowDocumentReader class offers different view modes such as per-page or scrollable and also reflows text if the viewing area is re sized.
  • Natively supports XML Page Specification documents.
  • Supports reading and writing paginated documents using Open Packaging Convention.

Effects-Features Of WPF

  • WPF provides for BitmapEffects, which are raster effects applied to a Visual. These raster effects are written unmanaged code and therefore force rendering of the Visual to be performed on the CPU and not hardware accelerated.
  • In .NET Framework 3.5 SP1, one of the new additions was the Effect class, which is a Pixel-Shader 2.0 effect that can be applied to a visual, which allows all rendering to remain on the GPU .

Imaging-Feature Of WPF

  • WPF can natively access Windows Imaging Component(WIC) code and APIs allowing developers to write image codecs for their specific image file formats.

Annotations-Features of WPF

  • Annotations can be applied on a per-object basis, for objects in a Document or FlowDocument.
  • WPF only provides the capability for creating, storing and managing annotations; each application must expose the UI on their own.

Data binding-Features of WPF

  • WPF has a built-in set of data services to enable application developers to bind and manipulate data within applications.
  • There exists support for three types of data binding:
  • one time: where the client ignores updates on the server.
  • one way: where the client has read-only access to data.
  • two way: where client can read from and write data to the server.
  • A set of built-in controls is provided as part of WPF, containing items such as button, menu, grids and list box.
  • A powerful concept in the WPF is the logical separation of a control from its appearance.
  • A control's template can be overridden to completely change its visual appearance.
    and a control can contain any other control or layout, allowing for unprecedented control over composition.
  • Features retained mode graphics, so that applications do not have to be bothered with repainting the display.

Animations-Feature of Silverlight

  • Time-based animation. Scene redraws are time triggered.
  • Presentation timers are initialized and managed by WPF.
  • Scene changes co-ordinated by using a Storyboard.
  • Animations can be triggered by other external events, including user action.
  • Animation effects can be defined on a per-object basis, which can be accessed directly from XAML markup.
  • Ships with a set of predefined effects, such as fade out for all controls.

Media Services -Feature Of WPF

  • WPF provides shape primitives for 2D graphics along with a built-in set of brushes, pens, geometries, and transforms.
  • The 3D capabilities in WPF are a subset of the full feature set provided by Direct3D. However, WPF provides tighter integration with other features like user interface (UI), documents, and media. This makes it possible to have 3D UI, 3D documents, and 3D media.
  • There is support for most common image formats.
  • WPF supports the video formats WMV,MPEG and some AVI files by default, but since it is Windows Media Player running beneath, WPF can use all the codecs installed for it.
  • WPF supports time-based animations, in contrast to the frame-based approach. This decouples the speed of the animation from how the system is performing.

Interoperability-Features Of WPF

  • WPF provides interoperability with the Windows API: Via hosting, one can use Windows Presentation Foundation inside existing Win32 code, or one can use existing Win32 code inside Windows Presentation Foundation.
  • Interoperability with Windows Forms is also possible through the use of the ElementHost and WindowsFormsHost classes.

Graphical Services-Feature of WPF

  • All graphics, including desktop items like windows, are Direct3D applications.
    This aims to provide a unified avenue for displaying graphics, as well as more advanced graphical features.
  • Routing the graphics through Direct3D allows Windows to offload some graphics tasks to the GPUfound on the computer's graphics card. This can reduce the workload on the computer's CPU.
  • Supports vector-based graphics, which allow lossless scaling.
  • Supports 3D model rendering and interaction in 2D applications.
  • Interactive 2D content can be overlaid on 3D surfaces, natively.

Features of Windows Presentation Foundation

The features are:

  • Graphical Services
  • Interoperability
  • Media Services
  • Animations
  • Data binding
  • Annotations
  • Imaging
  • Effects
  • Documents
  • Text

Difference between FLASH and SILVERLIGHT

Flash:

  • Timeline animation in Flash is frame based. It uses transformation matrix.
  • Flash uses a 3rd party library to store shapes
  • Flash supports multiple video formats/codec’s, however the output is proprietary
  • Flash content can be created by using Adobe Flash.
  • As a programming model, ActionScript has a huge learning curve and is not a common
  • programming skill found in developers.
  • Flash provides with 2D animation graphics.
  • The cost of Media server licensing in Flash is more.
  • Full screen video capabilities (720p) not available
  • Flash content binary in nature.

Silverlight:

  • Silverlight uses timeline (vector) based animation.
  • Silverlight uses XAML.
  • Silverlight uses an industry standard codec
  • To create Silverlight content, you can use your existing tools like Visual Studio. Anotherdedicated tool is Expression Blend
  • Silverlight has been developed from ground-up using the languages you are already familiar with as a .NET developer. Silverlight content can be created using XAML and a .NET language. This way, you can utilize your existing skills.
    So does Silverlight
  • The cost is much lesser than Flash
  • Scalable full screen video available up to HD (720p)
  • Silverlight content is textual in nature

Connected to data, servers, and services

Benefits Of Silverlight:
  • Create mash-ups by incorporating data and services from anywhere on the Web by using Silverlight support for LINQ and LINQ-to-XML. Access data with common protocols like JSON, RSS, POX, and REST.
  • Increase discoverability of RIA content that can be indexed and searched, thanks to the Silverlight text-based XAML format.
  • Rapidly scale Silverlight applications by using SilverlightTM Streaming by Windows Live.

High-quality media, low-cost delivery

Benefits of Silverlight:
  • Unified media format scales from high definition (HD) to mobile with Windows Media Video (WMV), the Microsoft implementation of the Society of Motion Picture and Television Engineers (SMPTE) VC-1 video standard, as well as support for Windows Media Audio (WMA) and MP3 audio.
  • Add vector-based graphics and overlays to media with support for integration of graphics that scale to any size and broadcast-style overlays for tickers and closed captioning.
  • Flexible ad-insertion solutions with video and animation including the ability to deliver fluid, broadcast-style video or animated advertisements without any loss of visual fidelity or motion quality.

Flexible Programming Model with Collaboration Tools

Benefits of Silverlight:
  • Based on the Microsoft .NET Framework, Silverlight enables developers and designers to easily use existing skills and tools to deliver media experiences and RIAs for the Web.
  • Choice of programming languages such as AJAX, Visual Basic .NET, C#, Python, and Ruby offers developers and designers the flexibility to use their existing skills without the need to learn a new language.
  • Simple integration with existing Web technologies and assets means Silverlight works with any back-end Web platform or technology. No "rip and replace" required. Silverlight integrates with your existing infrastructure and applications, including Apache and PHP, as well as with JavaScript and XHTML on the client.

Compelling cross-platform user experiences-Silverlight Benefits

  • Deliver media experiences and rich interactive applications (RIA) for the Web that incorporate video, animation, interactivity, and stunning user interfaces (UIs).
  • Seamless, fast installation for users, thanks to a small, on-demand, easy-to-install plug-in that is under 2 megabyte (MB) in size and works with all leading browsers.
    Consistent experiences on Windows and on Mac OS without any additional installation requirements.
  • Create richer, more compelling Web experiences that take greater advantage of the client for increased performance.
  • Stunning vector-based graphics, media, text, animation, and overlays enable seamless integration of graphics and effects into any existing Web application.
    Enhance existing standards/AJAX-based applications with richer graphics and media and improve their performance and capabilities by using Silverlight.

Benefits Of Silverlight

  • Compelling cross-platform user experiences.
  • Flexible Programming Model with Collaboration Tools
  • High-quality media, low-cost delivery
  • Connected to data, servers, and services

Rotate transform in a clockwise direction

We rotate it in a clockwise direction by setting angle to a negative value between 0 and -360,the following code shows an example for it.
<image.rendertransform>
<transformgroup>
<scaletransform/>
<skewtransform/>
<rotatetransform angle=" -45">
<translatetransform/>
</transformgroup>
</Image.RenderTransform>
</image>

Rotate transform

This allows you to adjust the rotation of the silverlight controland it is done by setting the angle property to adjust the angle of rotation
Height="200"Width="300"
RenderTransformOrigin=" 0.5,0.5">








Scale Transform

This allows you to adjust the horizontal and vertical scale of the Silverlight control.This is done by setting the scaleXproperty to adjust the horizontal scale and the scaleX property to adjust the vertical scale and the values are based on 1 being the current size of the control.For example the following code scales image control to twice the initial size.

<image.rendertransform>
<transformgroup>
<scaletransform scalex="2" scaley="2">
<skewtransform/>
<rotatetransform/>
<translatetransform/>
</transformgroup>
</Grid.RenderTransform>
</image>

Xaml Using Transformations

Transformations are defined in a TransformGroup block Consisting of one or more of the following :

  • ScaleTransform
  • SkewTransform
  • RotateTransform
  • TranslateTransform

    The following codeshows the basic framework needed to apply transformations on an image control:

<image.rendertransform>
<transformgroup>
<scaletransform/>
<skewtransform/>
<rotatetransform/>
<translatetransform/>
</transformgroup>
<image.rendertransform/>

The centre point of the translation is based off the RenderTransformOrigin property of the control and this is based on two coordinates points.To render around the centre of the control, the following code is set for that:
RenderTransformOrigin=”0.5,0.5”

ListBox

The ListBox tag represents a Silverlight ListBox control in XAML.

The Width and Height attributes represent the width and the height of a ListBox. The x:Name attribute represents the name of the control, which is a unique identifier of a control.

The following code snippet sets the name, height, and width of a ListBox control.




Monday, June 8, 2009

DatePicker control

  • This enables you to select a date by either typing it into a text field or by using a drop-down Calendar control.
  • When you type a date directly into a text field, the Text property of the DatePicker control gets set.
  • This is available in the Toolbox of any Silverlight application and you can use the drag and drop approach to add it to your XAML code.
  • The DateValidationError event is raised if the DatePicker cannot convert whatever you typed to a valid date.
  • Normally, this causes an exception, but you can set the ThrowException property to false in an event handler and prevent an exception from being raised.

How to Create a Checkbox Control

To create a checkbox, select the checkbox tool:
The mouse cursor changes to a checkbox image. Position the mouse cursor to the the upper left corner of where you want to draw your new checkbox created, press the left button, and drag it to the size you want.
When you release the button, the panel editor will ask for the
checkbox properties.
Notice that the status bar contains the characteristics of your new checkbox control; the status bar content is updated whenever you move the mouse cursor over any control. It's a quick way to see the basic definition of a control.
You can try out your checkbox by selecting Panel/Execute from the menu.

Calender Events

The DisplayDateChanged event is fired where the DisplayDate property is changed. The DisplayModeChanged event is fired when the DisplayMode property is changed. The SelectedDatesChanged event is fired when the SelectedDate or SelectedDates properties are changed. The following code snippet sets these three events attributes.
x:Name="MonthlyCalendar"
SelectedDatesChanged="MonthlyCalendar_SelectedDatesChanged"
DisplayDateChanged="MonthlyCalendar_DisplayDateChanged"
DisplayModeChanged="MonthlyCalendar_DisplayModeChanged"
HorizontalAlignment="Left"
VerticalAlignment="Top"
Margin="10,10,0,0">

private void MonthlyCalendar_SelectedDatesChanged(object sender, SelectionChangedEventArgs e)
{
}
private void MonthlyCalendar_DisplayDateChanged(object sender, CalendarDateChangedEventArgs e)
{
}
private void MonthlyCalendar_DisplayModeChanged(object sender, CalendarModeChangedEventArgs e){
}

Calendar Events

Besides the normal control events, the Calendar control has three events calendar related events. These events are given below:
  • DisplayDateChanged,
  • DisplayModeChanged.
  • SelectedDatesChanged.

Silverlight Calendar Control

The Silverlight Calendar control is great for scenarios where date selection by an end user is needed.It is very useful for Picking the dates by the exact month which is displayed.

Scroll Viewer Control

  • This control encapsulates horizontal and vertical ScrollBar elements and a content container in order to display other visible elements in a scrollable area.
  • You must build a custom object in order to use the ScrollBar element for content scrolling. However, you can use the ScrollViewer element by itself because it is a composite control that encapsulates ScrollBar functionality.
  • This control responds to both mouse and keyboard commands, and defines numerous methods with which to scroll content by predetermined increments.
  • You can use the ScrollChanged event to detect a change in a ScrollViewer state.
  • It can only have one child, typically a Panel element that can host a Children collection of elements. The Content property defines the sole child of the ScrollViewer.

Predefined elements in Wpf Applications

There are two predefined elements that enable scrolling in WPF applications:
  • ScrollBar
  • ScrollViewer.

ItemViewer

This allows you to group similar items together in an area that will automatically wrap when resized and is easy to implement on your Silverlight driven website and is also customizable to provide a visual feel suitable for any site design and is used in our Silverlight Controls Demo to simulate a Windows File Explorer.

Indeterminate progress bar

This is used in situations where the extent of the task is unknown or the progress of the task cannot be determined in a way that could be expressed as a percentage. This bar uses motion or some other indicator to show that progress is taking place, rather than using the size of the filled portion to show the total amount of progress, making it more like a Throbber than a progress bar.

Pop up message box

This control is used to display the selected one which will appear in a second and this is why it is given in programs or any other application to get the immediate result.

Drop-down list

It is a User control GUI element, similar to a list box, which allows the user to choose one value from a list. When a drop-down list is inactive, it displays a single value. When activated, it displays a list of values, from which the user may select one. When the user selects a new value, the control reverts to its inactive state, displaying the selected value.

Dropdownbox in Silverlight

A drop-down list is a User interface control GUI element, similar to a list box, which allows the user to choose one value from a list. When a drop-down list is inactive, it displays a single value. When activated, it displays (drops down) a list of values, from which the user may select one. When the user selects a new value, the control reverts to its inactive state, displaying the selected value

Indeterminate Progressbar

This is used in situations where the extent of the task is unknown or the progress of the task cannot be determined in a way that could be expressed as a percentage. This bar uses motion or some other indicator to show that progress is taking place, rather than using the size of the filled portion to show the total amount of progress, making it more like a throbber than a progress bar.

How to Use the TextBox Control

<UserControl x:Class="TextBoxPlus.Page"
xmlns="http://schemas.microsoft.com/client/2007"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Width="400" Height="300">
<Canvas>
<TextBlock x:Name="userNameLabel" Canvas.Left="0" Canvas.Top="52" Text="User Name:" FontFamily="Arial" />
<TextBlock x:Name="passwordLabel" Canvas.Left="0" Canvas.Top="82" Text="Password:" FontFamily="Arial" />
<TextBox x:Name="userName" Canvas.Top="50" Canvas.Left="80" Width="150" MaxLength="20" TabIndex="0" />
<PasswordBox x:Name="password" Canvas.Top="80" Canvas.Left="80" Width="150" TabIndex="1" />
</Canvas>
</UserControl>

Silverlight TextArea

<UserControl x:Class="TextArea.Page"
xmlns="http://schemas.microsoft.com/client/2007"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:liquid="clr-namespace:Liquid;assembly=Liquid"
Width="400" Height="300">
<Canvas>
<liquid:TextArea x:Name="textarea" Canvas.Top="20" Canvas.Left="20" Width="250" Height="250" TabIndex="1" Text="This is a test!" />
</Canvas>
</UserControl>

How to Use the Radio Button

<UserControl x:Class="RadioButtons.Page"
xmlns="http://schemas.microsoft.com/client/2007"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Width="400" Height="300">
<Canvas>
<RadioButton Canvas.Left="100" Canvas.Top="10" Content="Option 10" GroupName="group2" />
<RadioButton Canvas.Left="100" Canvas.Top="30" Content="Option 20" GroupName="group2" />
</Canvas>
</UserControl>

How to Use the NumericUpDown Control

<UserControl x:Class="NumericUpDown.Page"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:liquid="clr-namespace:Liquid;assembly=Liquid"
Width="400" Height="300">
<Grid x:Name="LayoutRoot" Background="White">

</Grid>
</UserControl>

How to Use the ListBox Control

<UserControl x:Class="ListBox_Test.Page"
xmlns="http://schemas.microsoft.com/client/2007"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Width="400" Height="300">
<Canvas>
<ListBox x:Name="list" Canvas.Top="10" Canvas.Left="10" Width="200" Height="200" SelectionChanged="list_ItemSelected">
<ListBoxItem Content="Australia" />
<ListBoxItem Content="Canada" />
<ListBoxItem Content="China" />
</ListBox>
</Canvas>
</UserControl>

How to Use the Date Picker Control

<UserControl x:Class="DatePicker.Page"
xmlns="http://schemas.microsoft.com/client/2007"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:liquid="clr-namespace:Liquid;assembly=Liquid"
Width="400" Height="300">
<Canvas>
<liquid:DatePickerPlus x:Name="testPicker" Canvas.Left="10" Canvas.Top="10" Width="200" />
</Canvas>
</UserControl>

How to use Checkbox in Silverlight

<UserControl x:Class="Checkbox_Test.Page"
xmlns="http://schemas.microsoft.com/client/2007"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Width="400" Height="300">
<Canvas>
<CheckBox x:Name="testCheckBox" Canvas.Left="10" Canvas.Top="0" Content="This is a checkbox" Click="testCheckBox_Click" />
<CheckBox x:Name="testCheckBox2" Canvas.Left="10" Canvas.Top="20" Content="This is another checkbox" />
</Canvas>
</UserControl>

How to use Calender Control

<UserControl x:Class="Calendar.Page"
xmlns="http://schemas.microsoft.com/client/2007"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:liquid="clr-namespace:Liquid;assembly=Liquid"
xmlns:extended="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls"
Width="400" Height="300">
<Canvas>
<extended:Calendar x:Name="testCal" Canvas.Top="10" Canvas.Left="10" />
</Canvas>
</UserControl>

Standard Controls of Silverlight

some standard controls of Silverlight is given below:
Calendar
CheckBox
Date Picker
DropDownList/ComboBox
ListBox
NumericUpDown
Radio Buttons
TextArea (Multi-line TextBox)
TextBox
Text Label

Viewer Control

<UserControl x:Class="Viewer.Page"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:extended="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls"
xmlns:liquid="clr-namespace:Liquid;assembly=Liquid"
xmlns:liquidRichText="clr-namespace:Liquid;assembly=Liquid.RichText"
Width="800" Height="600">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition Width="4" />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<liquid:Viewer Grid.Column="0" Minimum="0.4" Maximum="5">
<liquidRichText:RichTextBlock Width="600" RichTextURL="assets/RichText.xml" />
</liquid:Viewer>
<extended:GridSplitter x:Name="grsplSplitter" Grid.Column="1" VerticalAlignment="Stretch" HorizontalAlignment="Center" Width="4" Margin="0 2 0 2" Background="#00ffffff" />
<liquid:Viewer Grid.Column="2">
<Image Source="assets/reef.jpg" />
</liquid:Viewer>
</Grid>
</UserControl>

Sunday, June 7, 2009

File Upload

<UserControl x:Class="FileUpload.Page"
xmlns="http://schemas.microsoft.com/client/2007"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:liquid="clr-namespace:Liquid;assembly=Liquid"
Width="400" Height="300">
<Canvas>
<liquid:ProgressBarPlus x:Name="progress" Canvas.Left="8" Canvas.Top="8" Width="200" Height="24" />
<Button x:Name="startUpload" Canvas.Left="80" Canvas.Top="50" Content="Upload" Width="60" Height="32" Click="StartUpload_Click" />
</Canvas>
<UserControl>

Item viewer Control

<UserControl x:Class="ItemViewer.Page"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:liquid="clr-namespace:Liquid;assembly=Liquid"
Width="400" Height="300">
<liquid:ItemViewer x:Name="myList" Width="400" Height="300" DoubleClick="Items_DoubleClick">
<liquid:ItemViewer.Items>
<liquid:FileItem Text="My File.pdf" OtherText="300KB" Icon="images/large/pdf.png" />
<liquid:FileItem Text="My File 2.doc" OtherText="360KB" Icon="images/large/doc.png" />
<liquid:FileItem Text="My File 3.xls" OtherText="100KB" Icon="images/large/xls.png" />
<liquid:FileItem Text="My File 4.xaml" OtherText="40KB" Icon="images/large/xaml.png" />
<liquid:FileItem Text="My File 5.jpg" OtherText="167KB" Icon="images/large/jpg.png" />
<liquid:FileItem Text="My File 6.mp3" OtherText="96KB" Icon="images/large/mp3.png" />
</liquid:ItemViewer.Items>
</liquid:ItemViewer>
</UserControl>

ProgressBar Control

A progress bar is a component in a graphical user interface used to convey the progress of a task, such as a download or file transfer. Often, the graphic is accompanied by a textual representation of the progress in a percent format.
<UserControl x:Class="ProgressBar.Page"
xmlns="http://schemas.microsoft.com/client/2007"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:liquid="clr-namespace:Liquid;assembly=Liquid"
Width="400" Height="300">
<Canvas>
<Canvas.Triggers>
<EventTrigger RoutedEvent="Canvas.Loaded">
<BeginStoryboard>
<Storyboard x:Name="timer">
<DoubleAnimation x:Name="animation" BeginTime="00:00:00" Duration="00:00:0.02" Storyboard.TargetName="InvisibleRect" Storyboard.TargetProperty="Width" />
</Storyboard>
</BeginStoryboard>
</EventTrigger>
</Canvas.Triggers>
<Rectangle Visibility="Visible" x:Name="InvisibleRect" Width="1" Height="1" />
<liquid:ProgressBarPlus x:Name="progress" Canvas.Top="0" Canvas.Left="0" Width="128" Height="16" Text="Uploading"/>
</Canvas>
</UserControl>

Popup MessageBox Control

<UserControl x:Class="MessageBox.Page"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:liquidPopup="clr-namespace:Liquid;assembly=Liquid.Popup"
Width="400" Height="300">
<Canvas x:Name="LayoutRoot" Background="White">
<Button x:Name="messageboxButton" Canvas.Left="16" Canvas.Top="8" Width="250" Height="32" Content="MessageBox Dialog" Cursor="Hand" Click="MessageBox_ButtonClick" />
<liquidPopup:MessageBox x:Name="messageBoxDialog" Canvas.Left="50" Canvas.Top="50" />
</Canvas>
</UserControl>

DropDown Control in Silverlight

<UserControl x:Class="DropDown.Page"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:liquid="clr-namespace:Liquid;assembly=Liquid"
xmlns:liquidTreeView="clr-namespace:Liquid;assembly=Liquid.TreeView"
Width="400" Height="300">
Grid x:Name="LayoutRoot" Background="White">
<liquid:DropDown x:Name="dropDown" Width="100" Height="23" SelectedItemContent="Pick...">
<liquidTreeView:Tree x:Name="treeView" Width="150" Height="150" EnableLines="True" SelectionChanged="Tree_SelectionChanged">
<liquidTreeView:Node Title="Root Node">
<
<liquidTreeView:Node Title="Item 2" />
<liquidTreeView:Node Title="Item 3" />
<liquidTreeView:Node Title="Item 4" />
<liquidTreeView:Node Title="Item 5" />
</liquidTreeView:Node>
</liquidTreeView:Tree>
</liquid:DropDown>
</Grid>
</UserControl>

ColorSelector in Silverlight Controls

This Color Selector control provides the user with a simple way to select from a list of pre-defined colors.
This Silverlight only Color Selector Control is easy to implement on your Silverlight driven website and is also customizable to provide a visual feel suitable for any site design.


<UserControl x:Class="ColorSelector.Page"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/
presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:liquid="clr-namespace:Liquid;assembly=Liquid"
Width="400" Height="300">
<Grid x:Name="LayoutRoot" Background="White">
<liquid:ColorSelector x:Name="selectColor" SelectionChanged="selectColor_SelectionChanged" />
</Grid></UserControl>

Tuesday, May 26, 2009

Advantages Of Isolated Storage

Small data files.
Provides client side storage space.
Since the Silver light applications runs in a sandbox model.
The default size in Silver light 2 Beta 2 is 1MB.
Isolated storage remains even if the cache is cleared.
Every application has its own portion of the isolated storage

Isolated storage

When an application stores data in a file, the file name and storage location must be carefully chosen to minimize the possibility that the storage location will be known to another application and, therefore, vulnerable to corruption. Without a standard system in place to manage these problems, developing ad hoc techniques that minimize storage conflicts can be complex and the results can be unreliable.

With isolated storage, data is always isolated by user and by assembly. Credentials such as the origin or the strong name of the assembly determine assembly identity. Data can also be isolated by application domain, using similar credentials.

Friday, May 22, 2009

Linq Providers

LINQ also defines another interface, IQueryable, which defines the same interfaces to the Standard Query Operators as IEnumerable.

different providers of Linq:
LINQ to Objects
LINQ to XML
LINQ to SQL
LINQ to DataSets

Linq-Language Extensions

It also defines a set of language extensions that can be optionally implemented by languages to make queries a first class language construct and provide syntactic sugar for writing queries.

The language extensions include:
Query syntax
Implicitly typed variables
Anonymous types
Object Initializer
Lambda expressions

Language Integrated Query-Linq

It is a set of proprietary query operators that can be used to query, project and filter data in arrays, enumerable classes, XML (XLINQ), relational database, and third party data sources.

Wednesday, May 20, 2009

Application Programming Interface

This also provides an interface that allows a program to communicate with other programs, running in the same environment.

Rich Internet Application

It is a Web application designed to deliver the same features and functions normally associated with deskop applications. RIAs generally split the processing across the Internet/network divide by locating the user interface and related activity and capability on the client side, and the data manipulation and operation on the application server side.

Web Services

A Web serviceis defined by the W3C as "a software system designed to support interoperable machine-to-machine interaction over a network".These are frequently just Internet application programming interfaces that can be accessed over a network, such as the Internet, and executed on a remote system hosting the requested services.

Windows Presentation Foundation

The WPFis formerly code-named Avalon, is a graphical subsystem in .NET Framework 3.0 which uses a markup language, known as XAML, for rich user interface development.It also enables rich control, design, and development of the visual aspects of Windows programs. It aims to unify a number of application services: user interface, 2D and 3D drawing, fixed and adaptive documents.

Silverlight 2.0:

Silverlight 2.0 is a cut down cross-platform version of WPF and is a browser plugin that lets you run rich internet applications, including media, animation and games. This allows applications to be written in any .NET language including C#. Unlike most Microsoft software, Silverlight will run on most popular platforms.
Silverlight 2.0 comes with a class library which features extensible controls, XML Web Services, networking components and LINQ APIs.

Tuesday, April 28, 2009

  • Difference between silverlight 1.0 and 2.0:
    Silverlight 1.0 (Features):
  • Cross-Browser Support for Firefox, IE, Safari
  • Cross-Platform Support for Windows and Mac (and Linux through the Moonlight Project)
  • 2D Vector Animation/Graphics
  • AJAX Support
  • HTML DOM Integration
  • HTTP Networking
  • Canvas Layout Support
  • JavaScript Support
  • Silverlight ASP.NET Controls (asp:media, asp:xaml)
  • XAML Parser (based on WPF)
  • Media – 720P High Definition (HD) Video
  • Media – Audio/Video Support (VC-1, WMV, WMA, MP3)
  • Media – Image Support (JPG, PNG)
  • Media Markers
  • Windows Media Server Support
    Silverlight 2.0 (features):
  • Cross-Browser Support for Firefox, IE, Safari
  • Cross-Platform Support for Windows and Mac (and Linux through the Moonlight Project)
  • 2D Vector Animation/Graphics
  • AJAX Support
  • HTML DOM Integration
  • HTTP Networking
  • Canvas Layout Support
  • JavaScript Support
  • Silverlight ASP.NET Controls (asp:media, asp:xaml)
  • XAML Parser (based on WPF)
  • Media – 720P High Definition (HD) Video
  • Media – Audio/Video Support (VC-1, WMV, WMA, MP3)
  • Media – Image Support (JPG, PNG)
  • Media Markers
  • Windows Media Server Support
  • Support for Visual Basic.NET and C#; Common Language Runtime (CLR) based languages
  • Support for IronPython, IronRuby, Managed JScript, and other Dynamic Language Runtime (DLR) based languages
  • Rich Core Framework (e.g. Generics, collections)
  • Multi-Threading
  • Layout controls including StackPanel and Grid
  • Full suite of Controls (TextBox, RadioButton, Slider, Calendar, DatePicker, DataGrid, ListBox, TabControl, and others)
  • Managed Control Framework
  • Templating Model
  • Visual State Manager
  • Isolated Storage
  • Deep Zoom Technology
  • Media – DRM Powered by PlayReady
  • Media - Windows Media Audio 10 Professional support
  • Media - MediaStreamSource for managed code media file parser and protocol extensibility
  • High quality resizing
  • Media - Basic SSPL Support
  • Cross Domain Network Access
  • Easy access to server-side data via Web Services
  • Direct access to TCP sockets
  • Interoperability with SOAP and REST services, including support for XML, JSON, RSS and Atom data formats
  • LINQ (including LINQ to XML, LINQ to JSON, and LINQ to Entities)
  • Duplex communications (“push” from Server to Silverlight client)
  • Data Binding
  • ADO.NET Data Services
  • Managed HTML Bridge
  • Managed Exception Handling
  • .NET Framework Security Enforcement
  • Type Safety Verification
  • XMLReader/Writer
  • Enhanced Keyboard Input Support
  • File Upload Support (via WebClient API)
  • WPF Compatibility
  • Accessibility
  • Localization
  • Remote Debugging (PC and Mac)

Silverlight Architecture

Silverlight Architecture:

  • This topic describes the essential architecture and components of Microsoft Silverlight.
  • Silverlight is not only an appealing canvas for displaying rich and interactive Web and media content to end users.
  • It is also a powerful yet lightweight platform for developing portable, cross-platform, networked applications that integrate data and services from many sources.
  • Furthermore, Silverlight enables you to build user interfaces that will significantly enhance the typical end user experience compared with traditional Web applications.
  • While Silverlight as a client-side runtime environment seems simple and compact in size, the Silverlight development platform integrates a number of features and complex technologies, making them accessible for developers.
  • To create effective Silverlight-based applications, developers need a working knowledge of the platform architecture.

The Silverlight Platform:
The Silverlight platform as a whole consists of two major parts, plus an installer and update component, as described in the following table.
Core presentation framework: Components and services oriented toward the UI and user interaction, including user input, lightweight UI controls for use in Web applications, media playback, digital rights management, data binding, and presentation features, including vector graphics, text, animation, and images. Also includes the Extensible Application Markup Language (XAML) for specifying layout.
.NET Framework for Silverlight: A subset of the .NET Framework that contains components and libraries, including data integration, extensible Windows controls, networking, base class libraries, garbage collection, and the common language runtime (CLR).
Some parts of the .NET Framework for Silverlight are deployed with your application. These "Silverlight Libraries" are assemblies not included in the Silverlight runtime and are instead shipped in the Silverlight SDK. When Silverlight Libraries are used in your application, they are packaged up with your application and downloaded to the browser. These include new UI controls, XLINQ, Syndication (RSS/Atom), XML serialization, and the dynamic language runtime (DLR).
Installer and updater: An installation and update control that simplifies the process of installing the application for first-time users, and subsequently provides low-impact, automatic updates.

Thursday, April 16, 2009

dnn skins

Skins:
Designing a custom look and feel for a DotNetNuke site requires changes to all or some of the key five design elements, these being:
Skins Containers Style Sheet Body Background
A summary of each of these design elements and the design areas of the portal which they reflect are detailed below.
Skins
A skin is the design applied to the standard DotNetNuke portal to change the layout and design. A skin package is a zip file includes the HTML layout, images, and may also include a stylesheet.
Containers:
A skin package must be uploaded to your File Manager and can be globally added or removed on the Site Settings tab, or under the Tab Settings of each tab.
Containers frame individual modules and can be applied to one or more modules, or can be set globally across all modules.
A container package are uploaded to your File Manager and can be globally managed on the Site Settings tab, or under the Module Settings of each modules.
The Style Sheet:
The default Style Sheet provides a standardized look to the portal. The Style Sheet controls the fonts, colors and styles throughout the portal.
Body Background:
An image or colour can be added to the background of all tabs to further customize the look of the portal. The body background image is tiled.
The image must be uploaded to your File Manager and can be added or removed on the Site Settings tab.

Modules in dnn

Modules:
"Modules" are modular pieces of code that each present some functionality to the user. Popular modules include user forums, photo galleries, blog publishers, directory tools, chat applications, contact managers, and events calendars.
In typical use cases, several modules will be grouped together to create a webpage or intranet page. These modules can easily be added, edited, deleted, restored, moved within a tab, or transfer to another page.
Within the DotNetNuke ecosystem, there are a wide variety of developers continually producing new and exciting modules for the DotNetNuke application framework. These module developers often build modules which they will sell on their sites or through
marketplaces or reseller stores- and some offer modules for free. Developers will often offer up their services to design custom modules for their clients.

Extensions in dnn

Extensions:
DotNetNuke was designed to easily fit in to existing computing environments. The core framework includes a series of open APIs that make integration with existing applications simple and straightforward- ensuring businesses can focus on extending features and functionality rather than troubleshooting installations. DotNetNuke comes with over 25 free modules (modular pieces of code with specific functionality). These modules can be easily added, edited, deleted, restored, moved or transferred among pages, and include features like banners, discussion, FAQs, Searches, Weblogs and XML/XSL.
Because DotNetNuke is standards-based and open source, the core technology can easily be extended through a variety of add-on modules available from third-party vendors in the DotNetNuke Marketplace and users within the community.

Wednesday, April 15, 2009

dotnetnuke-Installation

Installation
Where can I download DotNetNuke?
DotNetNuke is available exclusively as a download from DotNetNuke.com. To perform the download, one must simply register on the site. A verification code is then sent to the email address provided, and used upon the first log-in to the DNN site. After logging in, the user is able to freely download DotNetNuke.
What kind of platform is recommended for DotNetNuke?
Most DotNetNuke sites run on a Windows platform using SQL Server or SQL Express.
What software must I have prior to installation?
To install DotNetNuke, you must have a computer running Windows, IIS version 6.0 or newer, ASP.NET Framework version 2.0 or newer and either SQL Express or SQL Server 2005 or newer.

dotnetnuke-Benefits

Benefits
Is DotNetNuke easy to use?
Yes. DotNetNuke was originally designed for end-users -- everyday people, like those who maintain websites for minor sports associations, non-profits, and charitable groups. This focus on ease of use has been translated into a well-researched and intuitive interface, a site wizard, and help icons throughout.
Is DotNetNuke easy to install? To host?
Absolutely. The DotNetNuke software can be downloaded, installed, and running in short order. In addition, several hosting companies have established DotNetNuke-specific hosting packages, which include the tools and support to make project set-up even easier.
Is DotNetNuke affordable?
Yes. DotNetNuke Community Edition is free, and is suitable for businesses with internal applications and test environments. DotNetNuke Professional Edition includes additional security, stability, and support assurances for production or mission-critical applications, and is available at a substantially lower cost than alternative proprietary solutions.
Is DotNetNuke secure?
Yes. The DotNetNuke community and core team of developers place great emphasis on identifying potential threats, tracking "bugs,” and improving validation and encryption.
Is DotNetNuke static, or can I extend its functionality?
DotNetNuke is both scalable and extensible. While websites can be developed entirely with built-in DotNetNuke features, they can be also be "supercharged" through third-party private assembly tools and private custom assemblies. These add-ons are readily available from DotNetNuke community members and developers, either to purchase or as free offerings.

dotnetnuke

What is DotNetNuke?
DotNetNuke is a development framework that enables businesses to quickly build and deploy feature-rich, interactive websites and applications in Microsoft environments. Through an intuitive, menu-driven interface, even non-technical users can use DotNetNuke to easily create new sites or extend the functionality and features of existing web applications.
With hundreds of thousands of portals, intranets, extranets, and public websites built on DotNetNuke—and an enthusiastic open-source community that is more than 600,000 strong and growing—DotNetNuke is the world’s most widely adopted framework for building web solutions on the Microsoft stack.

Wednesday, April 8, 2009

Animation

Today,we did animation for our module in blend and we came to know many things in that.We also tried some coding part then, we searched some websites these are the websites.
http://www.fusioncharts.com/free/Demos/Blueprint/
http://officeone.mvps.org/ppttips/effect_loop_blend.html
http://www.sothink.com/product/animation-maker-for-silverlight/index.htm
http://www.codeproject.com/KB/silverlight/SilverlightBouncingBall.aspx
To know the basic steps in animation in expression blend you can view the following websites.
http://www.kirupa.com/blend_silverlight/creating_animation_silverlight2_pg1.htm
http://www.codeproject.com/KB/silverlight/SilverlightBouncingBall.aspx

Path Controls

Path controls are used for almost everything else that rectangle and ellipse controls cannot do.
The coding for creating path in silverlight application is:
Fill="Red"
stretch="Fill"
Stroke="Black"/>

Monday, April 6, 2009

Web Services

What is SOAP?

SOAP is a simple XML-based protocol to let applications exchange information over HTTP.

Or more simple: SOAP is a protocol for accessing a Web Service.

SOAP stands for Simple Object Access Protocol

SOAP is a communication protocol

SOAP is a format for sending messages

SOAP is designed to communicate via Internet

SOAP is platform independent

SOAP is language independent

SOAP is based on XML

SOAP is simple and extensible

SOAP allows you to get around firewalls

SOAP is a W3C standard

web services

What is WSDL?

WSDL is an XML-based language for describing Web services and how to access them.

WSDL stands for Web Services Description Language

WSDL is based on XML

WSDL is used to describe Web services

WSDL is also used to locate Web services

WSDL is a W3C standard




What is UDDI?

UDDI is a directory service where businesses can register and search for Web services.

UDDI stands for Universal Description, Discovery and Integration

UDDI is a directory for storing information about web services

UDDI is a directory of web service interfaces described by WSDL

UDDI communicates via SOAP

UDDI is built into the Microsoft .NET platform

Web Services

The two types of Web Services:
Reusable application components.

Web services can offer applications components like currency conversion, weather reports, or even language translation as services.

Ideally, there will be only one type of each application component, and anyone can use it in their application.

Connect existing software.

Web services help to solve the interoperability problem by giving different applications a way to link their data.

With Web services you can exchange data between different applications and different platform.