Your SlideShare is downloading. ×
0
Parallel minds silverlight
Parallel minds silverlight
Parallel minds silverlight
Parallel minds silverlight
Parallel minds silverlight
Parallel minds silverlight
Parallel minds silverlight
Parallel minds silverlight
Parallel minds silverlight
Parallel minds silverlight
Parallel minds silverlight
Parallel minds silverlight
Parallel minds silverlight
Parallel minds silverlight
Parallel minds silverlight
Parallel minds silverlight
Parallel minds silverlight
Parallel minds silverlight
Parallel minds silverlight
Parallel minds silverlight
Parallel minds silverlight
Parallel minds silverlight
Parallel minds silverlight
Parallel minds silverlight
Parallel minds silverlight
Parallel minds silverlight
Parallel minds silverlight
Parallel minds silverlight
Parallel minds silverlight
Parallel minds silverlight
Parallel minds silverlight
Parallel minds silverlight
Parallel minds silverlight
Parallel minds silverlight
Parallel minds silverlight
Parallel minds silverlight
Parallel minds silverlight
Parallel minds silverlight
Parallel minds silverlight
Parallel minds silverlight
Parallel minds silverlight
Parallel minds silverlight
Parallel minds silverlight
Parallel minds silverlight
Parallel minds silverlight
Parallel minds silverlight
Parallel minds silverlight
Parallel minds silverlight
Parallel minds silverlight
Parallel minds silverlight
Parallel minds silverlight
Parallel minds silverlight
Parallel minds silverlight
Parallel minds silverlight
Parallel minds silverlight
Parallel minds silverlight
Parallel minds silverlight
Parallel minds silverlight
Parallel minds silverlight
Parallel minds silverlight
Parallel minds silverlight
Parallel minds silverlight
Parallel minds silverlight
Parallel minds silverlight
Parallel minds silverlight
Parallel minds silverlight
Parallel minds silverlight
Parallel minds silverlight
Parallel minds silverlight
Parallel minds silverlight
Parallel minds silverlight
Parallel minds silverlight
Parallel minds silverlight
Parallel minds silverlight
Parallel minds silverlight
Parallel minds silverlight
Parallel minds silverlight
Parallel minds silverlight
Parallel minds silverlight
Parallel minds silverlight
Parallel minds silverlight
Parallel minds silverlight
Parallel minds silverlight
Parallel minds silverlight
Parallel minds silverlight
Parallel minds silverlight
Parallel minds silverlight
Parallel minds silverlight
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Parallel minds silverlight

1,605

Published on

ParallelMinds_Silverlight_Demo

ParallelMinds_Silverlight_Demo

Published in: Education, Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
1,605
On Slideshare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
0
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Megha Chavan<br />Junior Solution Developer <br />Parallel Minds Technology Solutions Pvt. Ltd. <br />www.parallelminds.biz<br />(o) + 91-20-65000209 <br />http://silverminders.blogspot.com/<br />Gmail: megha.chavan123@gmail.com<br />
  • 2. Silverlight4<br />For Code<br />Refer ParallelMinds_Silverlight Solutions on codeplex.com<br />
  • 3. Agenda<br />1. Getting started with silver light<br /> 1.1. Introduction<br /> 1.2. First Application<br />2. XAML<br /> 2.1. Introduction<br /> 2.2. Example<br />3. Controls<br /> 3.1. Layout Controls<br /> 3.2. Text Controls<br /> 3.3. Resource Controls<br /> 3.4. Content Controls<br /> 3.5. List Controls<br />4.Images<br />5.Graphics<br />6. Brushes<br /> 6.1. Solid Brushes<br /> 6.2. Linear Gradient Brushes<br /> 6.3. Radial Gradient Brushes<br /> 6.4. Image Brushes<br /> 6.5. Video Brushes<br />7. Control Styles<br />8. Animations<br />9. Video And Audio<br />10.Effects<br />11.Getting Data into silver light<br /> 11.1. Resource Files<br /> 11.2. Isolated Storage<br /> 11.3. Web Service<br />12. Data Binding to Control<br /> 12.1. Binding control to single item<br /> 12.2. Binding control to selection of objects<br /> 12.3.Displaying item in control using Data template<br />
  • 4. What is Silverlight?<br />
  • 5. Introduction<br />Silverlight is a web based technology, launched by Microsoft in April 2007. <br />Silverlight is Microsoft's implementation of a cross-browser, cross-platform client framework that allows designers and developers to deliver Rich Internet Applications (RIA) embedded in Web pages. <br />Silverlight was formerly code-named "WPF/E".<br />Silverlight is a browser plug-in approximately 6MB in size.<br />One of the design goals of the Silverlight technology is to fill the gap between Windows applications and Web applications in terms of creating Graphical User Interfaces (GUI). <br />
  • 6. Why Silverlight?<br /><ul><li> It is a cross-browser, cross-platform technology which provides a consistent user experience everywhere it runs.
  • 7. Better development tools -Visual Studio 2010, Expression Blend.
  • 8. Integration with Enterprise based technologies like WPF, LINQ etc…
  • 9. Silverlight integrates the XAML declarative language with the .NET framework.
  • 10. It delivers rich video, audio, and graphics.
  • 11. Silverlight is considered as a competitor to Adobe's Flash.
  • 12. It can run asynchronous communications with the server, allowing the UI to continue to function while waiting for the server response.
  • 13. Support for managed code – you can write programs in your favorite language which .NET CLR supports like C#, VB.NET, dynamic languages .</li></li></ul><li>Evolution of Silverlight<br />Silverlight 1:<br />Silverlight 1.0, which was developed under the codename Windows Presentation Foundation/Everywhere (WPF/E)<br />Drawback:<br />The major drawback of this release is no support for managed code.<br />
  • 14. Evolution of Silverlight<br />Silverlight 2 :<br />Silverlight 2.0 supports .NET programming languages. Silverlight 2.0 is based on .NET Framework 3.5.<br />Features :<br />Rich base class library<br />Powerful built-in controls<br />Cross-platform and cross-browser support<br />
  • 15. Evolution of Silverlight<br /><ul><li>Silverlight 3 :</li></ul>It is an extension to Silverlight 2.0, and mainly provides improvements in graphics capabilities, media management, application development areas<br /><ul><li>Silverlight 4 :</li></ul> Silverlight version 4 was released on April 15, 2010 (along with Silverlight 4 tools for developers). <br />
  • 16. Difference between Flash and Silverlight<br />Silverlight is more of a presentation tool. If Flash is the content, Silverlight is the container and the mode of delivery. <br />Silverlight goes beyond Flash, as it offers more features for delivering rich web content as a single package. <br />Silverlight tries to combine the creative delivery of Flash with the application development. <br />Silverlight applications are delivered to a browser in a text-based markup language called XAML. <br />Search engines, like Google, can scan XAML but they can't dive into compiled Flash applications. So Silverlight applications are more findable. <br />
  • 17. Difference between ASP.NET and Silverlight<br />
  • 18. Difference between ASP.NET and Silverlight<br />Silverlight runs completely on the client, while ASP.NET mainly runs on the server, but also has a few parts running on the client. <br />When an event fires, Silverlight handles the event on the client, but in ASP.NET, the browser will make an HTTP POST to the server, and after the server handles the request, it sends a new HTML page to the client. <br />A Silverlight application sends rendering commands to the Silverlight rendering engine by either writing XAML or code, and the Silverlight rendering engine will handle the rendering task. On the other hand, ASP.NET doesn’t have a rendering engine. It generates an HTML file on the server, sends it to the client, and allows the browser to parse the HTML file and render the content. <br />Silverlight can’t work with a database directly; instead, it consumes data from Web Services, while ASP.NET has strong support for working with databases directly. <br />
  • 19. Silverlight Architecture<br />
  • 20. Silverlight Architecture<br />Base Class Libraries: <br />It is a collection of classes that handle basic programming functionality such as string handling, regular expressions, collections, and input/output. <br />Common Language Runtime (CLR):<br /> Provides the memory management, type checking, exception handling, and garbage collection for Silverlight applications <br />Dynamic Language Runtime (DLR): <br />Provides the framework to dynamically compile and execute scripting languages like JavaScript, IronPython, and IronRuby managed code in Silverlight applications.<br />Windows Presentation Foundation (WPF):<br />Provide rich set of control.<br />Provides libraries to parse, access, and modify controls defined in XAML files as well as create and dynamically add new ones.<br />
  • 21. Silverlight Architecture<br />Controls:<br /> Implements extensible controls, such as buttons, sliders, calendars, and textboxes, which provide customizable functionality to applications.<br />WCF :<br />Provide libraries to interface with remote services.<br />Using WCF, you can send data as asynchronous messages from one service endpoint to another. Silverlight has incorporated WCF as a communication technology to connect Silverlight applications to WCF endpoints.<br />Data Framework :<br />It is used for data time compatibility.<br />UI renderer: <br /> By default aspx page perform rendering but other web based application does not have this feature.<br /> Handles rendering of XAML objects, such as vector/bitmap graphics, animation, and text, into UI elements that are displayed in the applications.<br />
  • 22. Silverlight Architecture<br />Layout: <br />Utilizes canvas, grid, and other controls to dynamically position and size UI elements.<br />Media pipeline:<br />Provides streaming of audio and video files as well as playback and other management.<br />Input: <br />Handles the input from user input devices such as a mouse, keyboard, and other input requests.<br />XAML:<br />XAML code in Silverlight to create the visual elements that make up the UI. XAML provides a robust set of controls that allow you to create rich,professional-looking UI very rapidly.<br />XAML parser:<br />Parses the XAML files into objects.<br />
  • 23. Silverlight Architecture<br /><ul><li>Silverlight Plug-in:</li></ul>It is a software which is used to run the web application on browser.<br /><ul><li>Application Services :</li></ul>These are the collection of services which is required to run plug-in.<br /><ul><li>Networking Stack:</li></ul>It is used to keep the information related to the networking.<br /><ul><li>DOM Integration :</li></ul>It is used for communication of XML.<br /><ul><li>Installer :</li></ul>It is exe application run on client side.<br />
  • 24. MVVM<br />MVVM common model :<br /> MVVM stands for Model-View-View Model.<br />
  • 25. MVVM<br /><ul><li> MVVM (Model-View-View Model) is the  design Pattern code model used for Silverlight UI. </li></ul>View :<br /><ul><li> A View is a class that represents the user interface that the user will see.
  • 26. In Silverlight this is the MainPage.xaml .
  • 27. The View contains the visual controls .
  • 28. View also contains binding extensions that identify the data points that will be presented to the user</li></li></ul><li>MVVM<br />Model :<br /><ul><li> The Model’s purpose is to represent the data points and it has no knowledge of where it will be presented to a user nor how it will be presented. </li></ul>ViewModel :<br /><ul><li> The ViewModel is the glue between the View and the outside world.
  • 29. The ViewModel is what the View is bound to.</li></li></ul><li>MVVM<br />Advantages of MVVM pattern :<br /><ul><li> Proper layering of the view and the data.
  • 30. The data is not stored in the view, The view is just for presenting the data.
  • 31. Clean testable and manageable code.
  • 32. No code behind so the presentation layer and the logic is loosely coupled.</li></li></ul><li>XAML<br />XAML stands for “Extensible Application Markup Language”.<br />XAML is a declarative language used in Silverlight to create UI, such as controls, shapes, text, and other content presented on the screen.<br />You can use Visual Studio to generate the XAML<br />XAML and the Visual Tree<br />In XAML, you have elements (such as <Button> and <Grid>) that can have other<br />elements (nodes) underneath them (children). This parent/child relationship specifies<br />things like how objects are positioned on the screen and how they respond to user<br />initiated events.<br />
  • 33. Xaml in Action<br />Example:<br /><Grid x:Name="LayoutRoot" Background="Red"> <br /> <StackPanel Margin="20" Background="Yellow”><br /> <TextBlock Name="firstTextBlock" Width="Auto" >First TextBlock</TextBlock> <br /> <TextBlock Name="secondTextBlock" Width="Auto" >Second TextBlock </TextBlock> <br /> <TextBlock Name="thirdTextBlock" Width="Auto" >Third TextBlock</TextBlock> </StackPanel> <br /></Grid><br />
  • 34. XAML Control Hirarchy<br />The following tree diagram shows the relationships between elements.<br />
  • 35. Tools required to develop Silverlight Application<br />Microsoft offers two separate tools to develop Silverlight applications:<br />Microsoft Expression Studio– <br />This tool is meant for web designers to create rich visual elements for Silverlight applications.<br />Microsoft Visual Studio – <br />This is the integrated development environment from Microsoft to develop .NET applications.<br />Programmers can use Visual Studio to develop Silverlight applications which require<br />programming. Visual Studio allows programmers to develop sophisticated Silverlight<br />applications in any .NET language (like C#, VB.NET etc). <br />
  • 36. First Application<br />To create New Project : File->New->Project<br />
  • 37. First Application<br />
  • 38. First Application<br />
  • 39. First Application<br />
  • 40. HelloWorld<br />
  • 41. HelloWorld<br />
  • 42. Output<br />
  • 43. Programming Model<br /><object> tag launches the plug-in. Source parameter points to the Silverlight Application <br /> <object <br /> type=“application/x-silverlight-2-b2”><br /> <param name=“source” value=“ClientBin/HelloWorld.xap”/><br /> </object><br />Use link: Programming Model:<br />http://beyondrelational.com/blogs/dinesh/archive/2010/08/01/what-is-silverlight.aspx<br />
  • 44. Programming Model<br />Browser requests XAP file, unzips it, runs .NET code. .XAP files come from any web server<br />
  • 45. Programming Model<br />.XAP files contains .NET application code <br />
  • 46. Programming Model<br />.NET app code is code with mark-up<br />
  • 47. Programming Model<br />UI/Code separation facilitates design<br />
  • 48. Controls<br />Silverlight4 Tools for Developers<br />To add a control to your application, double-click it in the Toolbox. You can also drag the control to Design view.<br />
  • 49. Controls<br />Setting Control Properties<br />You use properties to change the appearance or content of controls. You can set control properties in the Properties window, in XAML or in code.<br />
  • 50. Event Handler<br /><ul><li> Each control has events that enable you to respond to actions from the user.
  • 51. For example, a button control contains a click event that is raised when the button is clicked.
  • 52. The following example shows the TextChange Event Handler.</li></ul>XAML<br /><Grid x:Name="Layout Root" Background="White" MouseLeftButtonDown="LayoutRoot_MouseLeftButtonDown"><br /> <StackPanel Height="138" HorizontalAlignment="Left" Margin="70,103,0,0" Name="stackPanel1" VerticalAlignment="Top" Width="228"><br /> <TextBox Height="20" Name="textBox1" Width="137" TextChanged="textBox1_TextChanged"/><br /> </StackPanel><br /> </Grid><br />
  • 53. Event Handler<br />Example:<br />
  • 54. Event Handler<br />Output<br />
  • 55. Event Handler<br />Code Behind<br />C#<br /> private void textBox1_TextChanged(object sender, TextChangedEventArgs e)<br /> {<br /> ToolTip tooltip1 = new ToolTip();<br /> textBox1.Text = "this is text";<br /> if (!tooltip1.IsOpen)<br /> tooltip1.PlacementTarget = textBox1;<br /> tooltip1.Content="are u ready";<br /> tooltip1.IsOpen = true;<br /> }<br />
  • 56. Layout Control<br />Layout controls are containers for other controls A layout control serves as the "layout root" of your application. <br />Typically, layout controls derive from the Panel class. Some examples of layout controls include StackPanel, Canvas and Grid. <br />Absolute Layout : <br /> Example-Canvas<br />Dynamic Layout : <br /> Example-StackPanel , Grid<br />
  • 57. Text Control<br />Text controls typically display string content.<br />Example of Text Control :<br />TextBlock: Use this to display simple, read-only snippets of text.<br />TextBox: This is often used for short text input; however, you can also use it for larger, multi-line<br />text input. <br />PasswordBox Masks the text a user inputs.<br />RichTextBox: Provides more advanced formatting features than the TextBox and TextBlock<br />controls. <br />
  • 58. Text Control<br />Example :<br />
  • 59. Text Control<br />Output<br />
  • 60. Content Control<br />The following are examples of content controls.<br /><ul><li> Label
  • 61. Button
  • 62. CheckBox
  • 63. RadioButton</li></li></ul><li>List Control<br />The following are examples of list controls. <br /><ul><li> Item Control : </li></ul> 1) ListBox<br /> 2) TabControl<br /><ul><li>Datagrid</li></li></ul><li>Resource Control<br />Resource controls are designed to display resources such as video/audio, images, or HTML.<br />Image: For images.<br />MediaElement: For audio/video.<br />WebBrowser: Display rendered HTML.<br />
  • 64. Resource Control<br />Images :Example<br />
  • 65. Resource Control<br />Output<br />
  • 66. Resource Control<br />Media Element<br />To render Audio and Video use Media Element. <br />Silverlight includes support to play audio and video files.<br />Adding media to a page is as simple as adding a MediaElement to your markup and providing a Uniform Resource Identifier (URI) to the media to play. <br />The following example creates a MediaElement and sets its Source property to the URI of a video file.<br /><MediaElement Height="180" HorizontalAlignment="Left“ <br />Name="mediaElement1“ Width="273" Source="Hungry.wmv" AutoPlay="True“ /><br />
  • 67. Video And Audio<br />Example<br />
  • 68. Video And Audio<br />Example<br />
  • 69. Video And Audio<br />Output<br />
  • 70. Graphics<br />In Silverlight, there are two sets of classes that define a region of space: Shape and Geometry. <br />The different Shape classes are Line, Ellipse, Rectangle, Polygon, Polyline, and Path. <br />Path is interesting in that it allows you to define an arbitrary geometry for its boundary. <br />Example:<br />1) <Polygon Points=“100,100,120,120,140,140,160,100,100,160" Fill="red" Stroke="Black" StrokeThickness="2“Grid.Row=“0” Grid. Column=“0”/><br />2) <Rectangle Height="100“ Width="200“ Fill="SteelBlue“ Grid. Row=“0” Grid. Column=“1”/><br />3) <Ellipse Height="100“ Width="200" Fill=“Violet” Grid. Row=“1” Grid. Column=“0”/><br />
  • 71. Graphics<br />Example:<br />
  • 72. Graphics<br />Output<br />
  • 73. Brushes<br /><ul><li> To paint an object on the screen, such as a Shape or a Control, you use a Brush.
  • 74. You set the Fill property of the Shape or the Background and Foreground properties of a Control to the desired Brush.
  • 75. The different types of brushes in Silverlight are:
  • 76. SolidColorBrush :
  • 77. LinearGradientBrush:
  • 78. RadialGradientBrush</li></li></ul><li>Brushes<br />SolidColorBrush : <br />A SolidColorBrush paints an area with a single color.<br /><StackPanel> <Rectangle Width="100" Height="100" Fill=“Violet" /> </StackPanel> <br />Output<br />
  • 79. Brushes<br />LinearGradientBrush: <br /><ul><li> A LinearGradientBrush paints an area with a gradient that is defined along a line, called the gradient axis.
  • 80. The GradientStop is the basic building block of a gradient brush.
  • 81. A gradient stop specifies a Color at an Offset along the gradient axis.
  • 82. The gradient stop's Offset property specifies the position of the gradient stop's color on the gradient axis.</li></li></ul><li>Brushes<br />Example :<br /><StackPanel> <br /><Rectangle Width="200" Height="100"> <br /><Rectangle.Fill> <LinearGradientBrush StartPoint="0,0" EndPoint="1,1"> <br /><GradientStop Color=“Red" Offset="0.0" /> <br /><GradientStop Color=“Green" Offset="0.25" /> <br /><GradientStop Color="Blue" Offset="0.75" /> <br /><GradientStop Color=“Violet" Offset="1.0" /> <br /></LinearGradientBrush> <br /></Rectangle.Fill> <br /></Rectangle> <br /></StackPanel><br />Output<br />
  • 83. Brushes<br />RadialGradientBrush<br />Use the GradientOrigin, Center, RadiusX, and RadiusY propeties, to define the radial gradient.<br />Example:<br /><RadialGradientBrush GradientOrigin="0.5,0.5" Center="0.5,0.5" RadiusX="0.5" RadiusY="0.5" SpreadMethod=“Repeat"><br /><GradientStopCollection><br /><GradientStop Color="#FFFF0000" Offset="0" /><br /><GradientStop Color="#FF0000FF" Offset="0.4" /><br /><GradientStop Color="#FF00000F" Offset="0.8" /><br /></GradientStopCollection><br /></RadialGradientBrush><br />Output<br />
  • 84. Brushes<br />Image Brush:<br />The ImageBrush object enables you to use an image to paint an area.<br />Example :<br /><TextBlock Margin="20" FontFamily="Verdana" FontSize="86" FontWeight="Bold"> WELCOME <br /> <TextBlock.Foreground> <br /> <ImageBrush ImageSource=" soulmates.jpg "/><br /> </TextBlock.Foreground> <br /></TextBlock><br />Output<br />
  • 85. Control Styles<br />Silverlight offers many ways to customize the appearance of your applications. Styles enable you to set control properties.<br />Example :<br />
  • 86. Control Styles<br />Example :<br />
  • 87. Control Styles<br />Output:<br />
  • 88. Control Styles<br />Example:<br /><Style TargetType="Button"><br /> <Setter Property="Foreground" Value="Green"></Setter><br /> <Setter Property="BorderBrush"><br /> <Setter.Value><br /> <LinearGradientBrush StartPoint="0,0.5" EndPoint="1,1"><br /> <GradientStop Color="Yellow" Offset="0.0" /><br /> <GradientStop Color="Red" Offset="0.25" /><br /> <GradientStop Color="SteelBlue" Offset="0.50"/><br /> <GradientStop Color="Blue" Offset="0.75" /><br /> <GradientStop Color="LimeGreen" Offset="1.0" /><br /> </LinearGradientBrush><br /> </Setter.Value> </Setter><br /><DropShadowEffect Color="SteelBlue" BlurRadius="1" Direction="45" ShadowDepth=“ 25"></DropShadowEffect><br /><RotateTransform Angle="45"></RotateTransform><br />
  • 89. Animation<br />In Silverlight, animations can enhance your Web site by adding movement and interactivity. <br />Adding an Animation Object to the Storyboard :<br />A Storyboard is the container that you put animation objects in. <br />You have to make the Storyboard a resource that is available to the object that you want to animate. <br />The following XAML shows how to make the Storyboard a resource of the root element.<br />
  • 90. Animation<br />A) From/To/By Animation :<br />From/To/By animation creates a transition between two values<br /><DoubleAnimation By="250" Duration="0:0:1" AutoReverse="True" Storyboard.TargetName="rectangle1" Storyboard.TargetProperty="Width" ><br /></DoubleAnimation><br />Output<br />
  • 91. Animation<br />B) Key-Frame Animation :<br /> It creates a transition among its target values over its duration.<br /> <Storyboard x:Name="RectAnmn"> <br /> <DoubleAnimationUsingKeyFrames Storyboard.TargetName="RenderRect" Storyboard.TargetProperty="x" AutoReverse=“False"><br /><DiscreteDoubleKeyFrame Value=“400" KeyTime="0:0:2"><br /></DiscreteDoubleKeyFrame><br /></DoubleAnimationUsingKeyFrames><br /></Storyboard><br />
  • 92. Animation<br />Key-Frame Animation :<br />
  • 93. Effects<br />In Silverlight, you can use visual effects to enhance the look and design of your application. <br />There are multiple techniques for creating visual effects in Silverlight such as BlurEffect ,DropShadowEffect , Mirror effect.<br /> Blur Effect :<br /> BlurEffect is a pixel shader effect that causes an object to look as if it were out of focus.<br />Example:<br /><TextBlock Text="HELLO" Height="35" Width="105“ ><br /> <TextBlock.Effect><br /> <BlurEffect Radius="4"></BlurEffect><br /> </TextBlock.Effect><br /> </TextBlock><br />Output<br />
  • 94. Effects<br />DropShadow Effect: <br />DropShdow Effect is a pixel shader effect that applies shdow behind object.<br />Example:<br /><TextBlock Text=“Shadow" Height="35" Width="105“ ><br /><TextBlock.Effect><br /> <DropShadowEffect BlurRadius="4"></DropShadowEffect><br /></TextBlock.Effect><br /></TextBlock><br />Output<br />
  • 95. Effects<br />Mirror Image effect<br />
  • 96. Effects<br />Mirror Image effect<br />To create a reflection effect you can use a LinearGradientBrush.<br />Example:<br /><Image Source="soulmates.jpg" Canvas.Top="305" RenderTransformOrigin="0,0"><br /><Image.RenderTransform><br /> <ScaleTransform ScaleY="-1" /><br /> </Image.RenderTransform><br /> <Image.OpacityMask><br /> <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1"><br /> <GradientStopCollection><br /> <GradientStop Color="#00000000" Offset="0" /><br /> <GradientStop Color="#FFFFFFFF" Offset="1" /><br /> </GradientStopCollection><br /> </LinearGradientBrush><br /> </Image.OpacityMask><br /> </Image><br />
  • 97. Effects<br />Output<br />
  • 98. Getting Data into silverlight<br /><ul><li> There are several ways to get data into your Silverlight application.
  • 99. Data can exist in several locations.
  • 100. For example, read-only data can be stored in a local file within your application. User-specific data can be stored locally in an area called isolated storage. Data can be stored on the Internet, which can be accessed through Web services.</li></li></ul><li>Getting Data into silverlight<br />Local Files :<br />You can use files, such as text and XML files, to store read-only data locally. Local files can be compiled as resource files or content files.<br />Resource Files<br />Resource files are embedded in the project assembly. You can use resource files with application and library projects, and deploy the assemblies inside or outside the application package (.xap). <br />Content Files<br />Content files are included in the application package (.xap) without embedding them in the project assembly. <br />
  • 101. Getting Data into silverlight<br />Isolated Storage:<br />Isolated storage is a data mechanism to secure data .<br />If you need to store and retrieve user-specific information, you might consider using isolated storage. <br />In Silverlight, there is no direct access to the operating system's file system. However, you can use isolated storage to store data locally on the user's computer or device. <br />
  • 102. Getting Data into silverlight<br />Isolated Storage: Example<br />
  • 103. Getting Data into silverlight<br />Isolated Storage : Output<br />
  • 104. Getting Data into silverlight<br />Web Services:<br /><ul><li> Web Services can convert your application into a Web-application, which can publish its function or message to the rest of the world.
  • 105. The basic Web Services platform is XML + HTTP.
  • 106. Web Services have three basic platform elements: SOAP, WSDL and UDDI.</li></li></ul><li>Data Binding to Control<br />Binding a Control to a Single Item:<br />A data binding consists of a target and a source.<br />Binding a Control to a Collection of Objects:<br />The generic ObservableCollection class is a good collection choice for data binding<br />Displaying Items in a Control by using a Data Template :<br />A DataTemplate enables you to customize how list items are displayed in a control.<br /><DataTemplate><br /> <StackPanel Orientation="Horizontal"><br /> <TextBlock Text="Name :"></TextBlock><br /> <TextBlock Text="{Binding Author}"></TextBlock><br /> <TextBlock Text=" Address:"></TextBlock><br /> <TextBlock Text="{Binding good}"></TextBlock><br /> </StackPanel><br /> </DataTemplate><br />
  • 107. Data Binding to Control<br />
  • 108. Data Binding to Control<br />
  • 109. Thank You!<br />

×