Steady Silverlight 2.0 Series article index

Source: Internet
Author: User
Tags json object model polyline socket thread time interval silverlight visual studio

Online Demo


1, slow-moving Silverlight (1)-1.0 examples of electronic tables

2, steady-motion Silverlight (2)-1.0 examples of support for recording and playback of the piano ( ajax+dlinq)

3, Steady Silverlight (3)-2.0 control border, Button, Calendar, Canvas, CheckBox, ComboBox


Silverlight 2.0 Control Overview: Border, Button, Calendar, Canvas, CheckBox, ComboBox

4, Steady Silverlight (4)-2.0 control of the DataGrid, DatePicker, Grid, GridSplitter, Hyperlinkbutton, Image


Silverlight 2.0 Control Overview: DataGrid, DatePicker, Grid, GridSplitter, Hyperlinkbutton, Image

5, Steady Silverlight (5)-2.0 control of the ListBox, MediaElement, MultiScaleImage, PasswordBox, ProgressBar, RadioButton


Silverlight 2.0 Control Overview: ListBox, MediaElement, MultiScaleImage, PasswordBox, ProgressBar, RadioButton

6, Steady Silverlight (6)-2.0 control ScrollViewer, Slider, StackPanel, TabControl, TextBlock, TextBox, ToggleButton


Silverlight 2.0 Control Overview: ScrollViewer, Slider, StackPanel, TabControl, TextBlock, TextBox, ToggleButton

7, Steady Silverlight (7)-2.0 graphics ellipse, line, Path, Polygon, Polyline, Rectangle


Silverlight 2.0 Graphics:



Path-a series of interconnected lines and curves

Polygon-Polygon, closed graph, beginning and end automatically connected

Polyline-closed graphics, a string of connected lines, starting point and end will not automatically connect


8, Steady Silverlight (8)-2.0 Graphics base class System.Windows.Shapes.Shape


Silverlight 2.0 Graphics: base class System.Windows.Shapes.Shape (Ellipse, line, Path, Polygon, Polyline, Rectangle are inherited from the abstract class System.Windows.Shapes.Shape).

Fill-padding; Stroke-strokes (border)

StrokeThickness-Stroke (border) dimension

Stretch-Stretch value

Strokedasharray-A collection of values for dashes and clearances

Strokedashcap-type of dashed ends (line caps)

StrokeStartLineCap-type of dashed start end (line cap)

Strokeendlinecap-type of dashed end (line cap)

Strokedashoffset-The starting position of the dashed line. Draw a dashed line from the strokedashoffset distance from the starting end of the dotted line

Strokelinejoin-type of connection at the graphics connection point

Strokemiterlimit-the ratio of miter length to STROKETHICKNESS/2. Default value 10, Minimum value 1

9, Steady Silverlight (9)-2.0 brushes SolidColorBrush, ImageBrush, VideoBrush, LinearGradientBrush, RadialGradientBrush


Silverlight 2.0 Brushes:

SolidColorBrush-Monochrome brushes

ImageBrush-Image brushes

VideoBrush-Video Brushes

LinearGradientBrush-Linear Gradient brush

RadialGradientBrush-Radioactive gradient brush

10, slow-moving Silverlight (10)-2.0 other transform detailed, and UIElement and FrameworkElement Common properties


Silverlight 2.0 Other:

RenderTransform-Conversion of render position (System.Windows.Media.Transform type)

Rendertransformorigin-center point of position conversion

Clip-clipping region of the container (System.Windows.Media.Geometry type)

IsHitTestVisible-hit test is visible

Opacity-Opacity. Between 0-1

OpacityMask-Opacity Mask (mask) (System.Windows.Media.Brush type)

UseLayoutRounding-Use full pixel layout

Cursor-the mouse pointer style when you move the mouse over the FrameworkElement

Margin-The space between the edge of the container and the edge (pixel value: up or down, up, down, left, up, right, bottom)

Tag-Save Some extra information (System.Object type)

11, slow and steady Silverlight (11)-2.0 animation coloranimation, DoubleAnimation, pointanimation, interpolation key frame animation


Silverlight 2.0 Animation:

ColorAnimation-linear interpolation animation between two Color values

DoubleAnimation-linear interpolation animation between two Double values

PointAnimation-linear interpolation animation between two point values

Interpolation Keyframe Animation-inserts key frames in a Color or Double or point animation to do linear, discrete, three-time Bezier curve animation

Dynamically changing animations-dynamically changing animations by program control

12, Steady Silverlight (12)-2.0 appearance of the style, template, visual state and Visual state Manager


Silverlight 2.0 Appearance Control: styles (Style), templates (Template), visual status (VisualState), and Visual state Manager (VisualStateManager)

13. Steady Silverlight (13)-2.0 interactive mouse events and keyboard events


Silverlight 2.0 Man-machine interaction: Responds to user mouse actions and keyboard actions.

MouseEnter-Events that trigger when the mouse enters (obviously, this event cannot bubble)

MouseLeave-Events that trigger when the mouse leaves (obviously, this event does not bubble)

MouseLeftButtonDown-left mouse button click the event triggered when pressed

MouseLeftButtonUp-left mouse button click the event that is triggered when you press and release

MouseMove-Events that are triggered when the mouse is moved

Mouseeventargs.getposition ()-mouse coordinates relative to the specified element

Mousebuttoneventargs.handled-whether this event has been processed

KeyDown-Events triggered when the mouse is pressed

KeyUp-Events triggered when the mouse is pressed and released

Keyeventargs.key-Key to the event-related keyboard [Input.key enumeration]

Keyeventargs.handled-whether this event has been handled

Keyboard.modifiers-The currently pressed secondary key [Input.modifierkeys enum]

14, Steady Silverlight (14)-2.0 interactive InkPresenter (graffiti board)


Silverlight 2.0 Man-Machine Interaction: InkPresenter (Graffiti Board).

InkPresenter-Graffiti board, which is to render ink on the panel. InkPresenter can contain child controls

Cursor-the mouse pointer style when you move the mouse over the InkPresenter

Background-Graffiti Background

Opacity-Opacity of ink on panel

Clipping region of Clip-inkpresenter

Appearance properties of Stroke.drawingattributes-stroke (stroke)

Uielement.capturemouse ()-Enable mouse capture for the UIElement object

Uielement.capturemouse ()-release mouse capture for UIElement object

15, Steady Silverlight (15)-2.0 data binding, one-way binding, two-way binding, inotifypropertychanged, data conversion, data validation


Silverlight 2.0 Data binding:

Binding-Joins the properties of the binding target object with the data source

INotifyPropertyChanged-Notifies the client that a property value has changed

IValueConverter-Value Conversion interface that converts a value of one type to a value of another type. It provides a way to apply custom logic to bindings

Bindingvalidationerror-This event is triggered when a validation error occurs or the last validation error is resolved

16. Steady Silverlight (16)-2.0 independent storage of data (Isolated Storage)


Independent storage of Silverlight 2.0 data (Isolated Storage):

IsolatedStorageFile-classes that manipulate isolated storage;

Isolatedstoragefile.getuserstoreforsite ()-Get the user's isolated storage by site

Isolatedstoragefile.getuserstoreforapplication ()-Get the user's isolated storage by application

Isolatedstoragesettings-Key-value dictionary table saved in isolated storage

Isolatedstoragesettings.sitesettings-Key-value Dictionary table saved by site

Isolatedstoragesettings.applicationsettings-Key-value Dictionary table saved by application

17, slow-moving Silverlight (17)-2.0 data of the detailed DataGrid, detailed listbox


Silverlight 2.0 detailed DataGrid, binding data to ListBox:

AutoGenerateColumns-Automatically generate columns based on data source

Rowdetailsvisibilitymode-display mode used when displaying detailed data for the corresponding row

Datagrid.rowdetailstemplate-template for displaying detailed data for the corresponding row

Arerowdetailsfrozen-whether to freeze Rowdetailstemplate

GridLinesVisibility-How table dividers are displayed

Rowbackground-odd data row background

Alternatingrowbackground-even data row background

IsReadOnly-whether the cell is read-only

Frozencolumncount-The total number of columns frozen in the table (starting from the left)

SelectionMode-Select mode for row

Canuserreordercolumns-Allow dragging of columns

Canuserresizecolumns-Allows you to change the width of the column

Canusersortcolumns-whether to allow column sorting

18, Steady Silverlight (18)-2.0 video of the detailed MediaElement, the development of a simple version of the full function of the player


Silverlight 2.0 detailed MediaElement: Develop a simple version of the full function player.

Source-the media address that needs to be played

Stretch-Stretch value

AutoPlay-whether to play the media automatically

CurrentState-Playback status

Position-The location of the media

Droppedframespersecond-the number of frames that the media is dropping per second

BufferingProgress-Buffering Progress

DownloadProgress-Download Progress

Naturalduration-length of media files;

Volume-Volume size

Balance-Volume balance

Bufferingtime-length of time needed for buffering

CurrentState-Playback status


Play ()-playing media

Pause ()-Pause media playback

Stop ()-stops playback of media

19, Steady Silverlight (19)-2.0 communication Call Rest service, processing JSON format, XML format, rss/atom format data


Silverlight 2.0 calls the rest service to handle JSON-formatted, XML-formatted, Rss/atom-formatted data.

Calling the REST service through the System.Net.WebClient class

Processing Json data by using classes under the System.json named control

Processing Xml data by using classes under the System.Xml.Linq namespace (Linq to XML)

Processing Rss/atom data through classes in System.ServiceModel.Syndication namespaces

20, slow-moving Silverlight (20)-2.0 communication WebClient, upload/download data as String, upload/download data in streaming way


Silverlight 2.0 detailed WebClient, in the form of strings to transmit, download data, streaming to upload, download data.

WebClient-class that sends data to a specified URI or receives data from a specified URI

DownloadStringAsync (URI address, Object usertoken)-Download the resource of the specified Uri as a string

UploadStringAsync (URI address, string data)-uploads data to the specified URI as a string. The HTTP method you use defaults to POST

OpenReadAsync (URI address, Object usertoken)-Download the resource for the specified URI as a stream

OpenWriteAsync (Uri Address, string method, Object usertoken)-opens the stream to write data to the specified Uri using the specified method

21. Steady Silverlight (21)-2.0 communication WebRequest and WebResponse, requesting and receiving responses to the specified URI


Silverlight 2.0 Details WebRequest and WebResponse, makes get and post requests to the specified URI, and receives its response.

HttpWebRequest-Requests are made to the specified URI

Create ()-Initialize a WebRequest

BeginGetResponse ()-Starts an asynchronous request for the specified URI resource

EndGetResponse ()-Ends an asynchronous request to the specified URI resource

HttpWebResponse-Responds to the specified URI

GetResponseStream ()-Gets the data stream of the response

22, slow and slow Silverlight (22)-2.0 Communication Call WCF service, the transmission of information to do encryption


Silverlight 2.0 invokes the WCF service to encrypt messages that are transmitted by the client and the server. Using Add Service reference in Visual Studio 2008 automatically generates the proxy class. Supports only BasicHttpBinding

23, slow-moving Silverlight (23)-2.0 communication call WCF's bidirectional communication (Duplex Service)


Silverlight 2.0 invokes WCF's bidirectional Communication Service (Duplex service).

The development of a service-side initiative to send stock information to the customer service, first, the client sent to the server to be monitored stock code, and then the server in the stock information changes when the information pushed to the client

24, slow and steady Silverlight (24)-2.0 communications socket, the development of a multiplayer chat room


Silverlight 2.0 socket communication. Develop a chat room for multiple people.

Server side: Instantiate socket, bind, monitor, connect, receive data, send data

Client: Instantiate socket, specify service-side address, connect, receive data, send data

25, Steady Silverlight (25)-2.0 threads thread, Timer, BackgroundWorker, ThreadPool


Silverlight 2.0 uses thread, Timer, BackgroundWorker, ThreadPool to achieve multithreaded development.

Thread-classes for thread creation and control

Timer-class that is used to execute a specified method at a specified time interval

BackgroundWorker-for running an operation on a separate thread

ThreadPool-management class for thread pools

26, Steady Silverlight (26)-2.0 Threads Lock, interlocked, EventWaitHandle, Monitor, ThreadStaticAttribute


Silverlight 2.0 uses lock, interlocked, eventwaithandle, and monitor to achieve thread synchronization.

Lock-Make sure that the code block runs without being interrupted by another thread

Interlocked-provides atomic-level operations for variables shared by multiple threads

EventWaitHandle-classes that inform other threads whether they are accessible

Monitor-Provides a mechanism for synchronizing access to objects

ThreadStaticAttribute-The static variable specified is unique to each thread

27. Slow-moving Silverlight (27)-2.0 Web pages can be scripted, interacting with the DOM, interacting with JavaScript


Silverlight 2.0 uses C # to develop scriptable code, the interaction between Silverlight and the DOM of the host home page, and the interaction between Silverlight and JavaScript on the host page.

ScriptableMemberAttribute-attributes, methods, events that need to be scripted to mark this

Htmlpage.registerscriptableobject-Registers a scriptable object with the client

HtmlElement-HTML element representing the Document Object Model (DOM) of a Web page

HtmlWindow-a managed representation of the Silverlight end of the Window object that provides JavaScript

28, slow-moving Silverlight (28)-2.0 communication calls Data Services


Silverlight 2.0 invokes data Services. This article takes the Northwind database as the sample database and makes a demo for adding, querying, updating and deleting.

The invocation of a data service in Silverlight 2.0 can only be invoked using asynchronous means. In addition, the data service is placed on the same domain as the Silverlight host

System.Data.Services.Client.DataServiceContext-Data Service context

System.Data.Services.Client.DataServiceQuery-Querying the data service with the specified URI syntax

AddObject (), Updateobject (), DeleteObject ()-This is used to add, update, delete entities

BeginExecute ()/endexecute (), Beginexecutebatch ()/endexecutebatch-used to perform a dataservicequery Query or Bulk execution (submit a set of queries to a data service at once)

Beginsavechanges ()/endsavechanges ()-for submitting changes to the entity (add, delete, change)

Beginloadproperty ()/endloadproperty ()-is used to load the value of the specified property, and it is required to load the navigation property

Addlink (), Setlink (), Deletelink ()-Create a connection, added state (One-to-many), create a connection, added state (many-to-many), delete a connection, deleted status

29, slow and steady Silverlight-2.0tip/trick cookies, custom fonts, pass parameters for the program, customize the right mouse button, program commonly used configuration parameters


Silverlight 2.0 Tips and Tricks series

Cookies-manipulating cookies via JavaScript

Custom fonts-Use custom fonts in your programs

Passing parameters for programs-passing initialization parameters for Silverlight programs

Customizing the right mouse button-responding to and processing a custom right mouse button event

Frequently used configuration parameters for programs-common parameters for object tags, and common properties for corresponding Silverlight controls

30. Slow-motion Silverlight (2.0tip/trick)-Silverlight.js, Silverlight.supportedUserAgent.js, customizing the launch interface, responding to mouse wheel events


Silverlight 2.0 Tips and Tricks series

Silverlight.js-some JS help functions for embedding into the Silverlight plug-in and customizing the installation experience to help

Silverlight.supportedUserAgent.js-a function that is used to determine if Silverlight supports the user's browser

Custom launch interface-comprehensive application of three parameters: SplashScreenSource, onsourcedownloadprogresschanged, OnSourceDownloadComplete

Respond to mouse wheel events-to respond and handle mouse wheel events

31. Steady Silverlight (2.0tip/trick)-load xap, load XAML, load DLL, AppManifest.xaml file description, customize mouse pointer


Silverlight 2.0 Tips and Tricks series

Load XAP-Loads the specified XAP file into the current Silverlight application

Load XAML-loads the specified XAML file into the current Silverlight application

Load DLL-loads the specified DLL file, invokes the method in it, or loads the control in it

AppManifest.xaml File Description-Brief description of the role of each node in the AppManifest.xaml file content

Custom mouse pointer-implements a custom mouse pointer, that is, the mouse follows

32, slow-motion Silverlight (2.0tip/trick)-MessageBox, Popup, the cycle of several implementation methods, dynamic transformation theme, localization (multi-language), response to the mouse double-click event


Silverlight 2.0 Tips and Tricks series

Messagebox-messagebox's Demo

Demo of the Popup-popup bomb window

Several implementation methods of circulation-dispatchertimer way, Storyboard Way, Timer way, Compositiontarget.rendering Way

Dynamic Transformation Theme-demonstrates how to dynamically transform a theme

Localization (Multilingual)-demonstrates how to implement support for multiple languages

In response to the mouse double-click event-a double-click event that responds and handles the mouse


SOURCE Download Address: Http://

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.