Beruflich Dokumente
Kultur Dokumente
Microsoft has released Silverlight 1.0. There are lot example applications up. See for
example this beta application showing a search UI made in Silverlight. Silverlight is often
portrayed as Microsoft’s Flash-killer. Flash is important as a tool for showing rich multi-
media content, but in the future, frameworks like this might be the new platform
applications are based on.
First some words on WPF… WPF is Microsoft’s new GUI framework that replaces all
of the old “Windows Forms” and Win32 API. It builds on a vector based and GPU-
enabled drawing framework (DirectX), and adds the ability to create richer UIs than
Windows Forms does. The look and feel is also new. In my view, WPF is Microsoft most
important project the last years. Everybody is discussion Windows Vista, but WPF is
probably more important for application developers than Vista is. WPF also runs on
Windows XP, so it is not tied to Vista.
Read this and this and this to get a better understanding of WPF. Also watch this video.
Even if you never plan to use WPF, knowing the technology and the concepts is useful.
WPF applications can be deployed to the desktop or run in Internet Explorer (on
Windows only, as far as I know). When WPF application run in Internet Explorer they
run in a sandbox, so users simply point Internet Explorer at an URL and your application
appears without any installation or confirmation need. All development tools are the
same (Visual Studio) when making desktop and browser-based WPF applications, and
you can use the same widgets for both.
WPF running in Internet Explorer have some restrictions compared to a program running
on the desktop. For example, opening new windows is not possible and communication
(WCF) is not allowed. Apparently SOAP calls can be used instead.
Making a WPF application run in the browser is easy. You create a project in Visual
Studio marking it as a “WPF Browser Application”. After compilation, you publish the
executable to a web server. I think one idea in Visual Studio is to allow a desktop-based
WPF application and the same browser-based application to be produced from the same
codebase. I have not tried this yet, but this looks like a promising concept.
“ (…) it's important to note that a lot of the staple approaches you may be familiar with
from building Windows Presentation Foundation (WPF) applications will not work in
Silverlight, which uses only a subset of WPF's capabilities. Silverlight does not support
most of the WPF component primitives, such as Buttons and TextBoxes, and it supports
only one layout type: the absolute positioning layout. As a result, porting an existing
WPF application to Silverlight will force a total rewrite of all the UI-related code.” (From
DevX)
Of course, people are building widget libraries for Silverlight, but wouldn’t it better if
WPF was fully included? There could be various reasons for not including it… One could
be size, but does that really matters these days? Another reason could be that Microsoft
simply does not want all other operating systems to be able to run (the new wave of)
Windows programs for free.
For application developers this sums up to using one of these platforms (not counting
web interfaces) when writing new software in Visual Studio:
For the two solutions above, you use same tools and frameworks. Then, for the third one
you enter another world:
If you develop a Rich Internet Application, it seems like choosing between WPF and
Silverlight will be an important decision that will heavily shape your project.
esigning an external-facing website, then Silverlight is the better choice because potential
customers can access the website from a variety of different operating systems and
browsers.
The .NET collection definedFEATURES MATRIX
The Features Matrix below provides an overview of the new capabilities in Silverlight 3. Silverlight 3
is able to run Silverlight 2 and Silverlight 1.0 applications without change.
2D Vector Animation/Graphics
AJAX Support
HTTP Networking
JavaScript Support
Media Markers
Multi-Threading
Templating Model
Isolated Storage
Data Binding
Features Silverlight 1.0 Silverlight 2 Silverlight 3
XMLReader/Writer
WPF Compatibility
Accessibility
Localization
Out of Browser
Bitmap API
Theming at runtime
Bitmap caching
Perspective 3D
Text Animation
H.264 Support
Features Silverlight 1.0 Silverlight 2 Silverlight 3
Local Fonts
Local Connection
Binary XML
From a .NET perspective, a collection could be defined as an object that implements one
or more of the System.Collections.ICollection, System.Collections.IDictionary, and
System.Collections.IList interfaces. This definition leads to my classification of the "built-
in" collections found in the System.Collections namespace into three broad categories:
As you can see, the functionality of a given collection is very much controlled by the
specific interface or interfaces it implements. If you don't have much exposure to object-
oriented programming, that may seem awfully confusing, if not entirely pointless. You
should know, however, that building an object's functionality in this manner not only
gives families of similar objects similar sets of method signatures, but it also allows them
to be treated as essentially the same class when necessary—a technique known as
polymorphism among OOP initiates.
ArrayList
The System.Collections.ArrayList class, which implements only IList, could best be
described as a hybrid of a normal array and a collection. ArrayLists hold items in the
order they were added. Items are assigned an index identifier and can be retrieved in any
order via their associated index number. The ArrayList grows as new items are added to
it, which makes it more flexible than a normal array. However, an ArrayList has more
overhead than a traditional array and is not strongly typed, accepting anything that can be
cast to System.Object (in other words, everything).
SortedList
System.Collections.SortedList, which implements both the IDictionary and ICollection
interfaces, is your basic sorted collection, with the most similarity to VB6's Collection
object. SortedLists store objects and sort them based on an associated key. They also are
the only built-in .NET collection to support retrieval of objects by both index number and
key.
HashTable
The powerful System.Collections.HashTable collection implements both IDictionary and
ICollection and can be used to store multiple items of type Object, along with an
associated unique string key. Items in a HashTable are sorted in an order determined by a
hash code derived from their key. While each object's key value in the collection must be
unique, its hash code need not be.
What's a hash code?
A hash code is essentially the result of removing all redundant parts from a piece of data,
and it serves as an aid to categorizing or sorting the data.
When an item is added to the collection, HashTable calls the key's GetHashCode method,
which all classes inherit from System.Object, to determine its hash code and place in the
sort order. You can force the use of a custom hash function either by overriding the
GetHashCode method of a class or by passing an object implementing the
System.Collections.IHashcodeProvider interface to the HashTable constructor, in which
case that object will be used to generate hash codes for all keys added to the collection.
From a performance standpoint, HashTables can retrieve an arbitrary element from the
collection very quickly because key searches are limited only to keys with the same hash
code, which reduces the number of keys that must be checked to find a match. However,
because a hash code must be generated for each object and key pair that's inserted into the
collection, item insertions are somewhat expensive. Therefore, HashTables are ideal for
situations where a large amount of relatively static data will be repeatedly searched for
arbitrary keys.
NameValueCollection
System.Collections.Specialized.NameValueCollection is interesting in that it can contain
multiple items associated with the same key value, which distinguishes it from all the
other built-in collections. Aside from this, it functions similarly to a HashTable, sorting
items based on a hash code derived from each item's key and thus has essentially the
same advantages and disadvantage
Difference between Silverlight Version 1.0 and Silverlight Version 1.1
A lot of my friends who want to get started with Silverlight development keep asking me what's the
difference between Silverlight 1.0 and Silverlight 1.1? Which version should they use? Which version
supports what?
The primary difference between the two versions is: you can only use JavaScript to create Silverlight
applications in version 1.0, however you can use your favorite language, be it C#, VB, IronRuby or
IronPython to create Silverlight applications in version 1.1.
For detailed information on the features of Silverlight versions 1.0 and 1.1, click here.
FEATURES MATRIX
The Features Matrix below provides an overview of the new capabilities in Silverlight 3. Silverlight 3
is able to run Silverlight 2 and Silverlight 1.0 applications without change.
2D Vector Animation/Graphics
AJAX Support
HTTP Networking
JavaScript Support
Media Markers
Multi-Threading
Templating Model
Isolated Storage
Services
Data Binding
XMLReader/Writer
WPF Compatibility
Accessibility
Localization
Out of Browser
Bitmap API
Features Silverlight 1.0 Silverlight 2 Silverlight 3
Theming at runtime
Bitmap caching
Perspective 3D
Text Animation
H.264 Support
Local Fonts
Local Connection
Binary XML
Component Description
Core Components and services oriented toward the UI and user interaction, including
presentation user input, lightweight UI controls for use in Web applications, media playback,
framework 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 A subset of the .NET Framework that contains components and libraries, including
Framework for data integration, extensible Windows controls, networking, base class libraries,
Silverlight 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 An installation and update control that simplifies the process of installing the
updater application for first-time users, and subsequently provides low-impact, automatic
updates.
Silverlight architecture
There is a particular value in the combined set of tools, technologies,
and services included in the Silverlight platform: They make it easier
for developers to create rich, interactive, and networked applications.
Although it is certainly possible to build such applications using today's
Web tools and technologies, developers are hindered by many
technical difficulties, including incompatible platforms, disparate file
formats and protocols, and various Web browsers that render pages
and handle scripts differently. A rich Web application that runs
perfectly on one system and browser may work very differently on
another system or browser, or may fail altogether. Using today's large
array of tools, protocols, and technologies, it is a massive and often
cost-prohibitive effort to build an application that can simultaneously
provide the following advantages:
Feature Description
Input Handles inputs from hardware devices such as the keyboard and mouse, drawing, or
other input devices.
Media Features playback and management of various types of audio and video files, such
as .WMP and .MP3 files.
Deep Zoom Enables you to zoom in on and pan around high resolution images.
Controls Supports extensible controls that are customizable through styling and templating.
The following table describes a partial list of the .NET Framework for
Silverlight features shown in the previous illustration.
Feature Description
Base class library A set of .NET Framework libraries that provide essential programming
functions, such as string handling, regular expressions, input and output,
reflection, collections, and globalization.
Window Provides features to simplify access to remote services and data. This
Communication includes a browser object, HTTP request and response object, support for
Foundation (WCF) cross-domain HTTP requests, support for RSS/Atom syndication feeds, and
support for JSON, POX, and SOAP services.
CLR (common Provides memory management, garbage collection, type safety checking,
language runtime) and exception handling.
WPF (Windows Provides a rich set of controls, including Button, Calendar, CheckBox,
Presentation DataGrid, DatePicker, HyperlinkButton, ListBox, RadioButton, and
Foundation) controls ScrollViewer.
DLR (dynamic Supports the dynamic compilation and execution of scripting languages such
language runtime) as JavaScript and IronPython to program Silverlight-based applications.
Includes a pluggable model for adding support for other languages for use
with Silverlight.
Developers can interact with the .NET Framework for Silverlight layer
by writing managed code using C# and Visual Basic. .NET Framework
developers can also access the presentation layer by authoring in
Visual Studio 2008 or Microsoft Expression Blend.
Feature Description
Isolated storage Provides safe access from the Silverlight client to the local computer's file
system. Enables local storage and caching of data isolated to a particular user.
Asynchronous A background worker thread carries out programming tasks while the application
programming is freed up for user interaction.
File management Provides a safe File Open dialog box, to ease the process of creating safe file
uploads.
Serialization Provides support for serialization of CLR types to JSON and XML.
Packaging Provides the Application class and build tools to create .xap packages. The .xap
package contains the application and entry point for the Silverlight plug-in
control to run.
XML libraries XmlReader and XmlWriter classes simplify working with XML data from Web
services. The XLinq feature enables developers to query XML data directly within
.NET Framework programming languages.