Introduction to Occasionally Connected Applications using Sync Services for ADO.NET

Thursday, April 2, 2009

Silverlight 3 support in Express Blend 3.0

You can create and modify Silverlight 3 applications in Expression Blend 3 Preview. If you open a Silverlight 2 project, Expression Blend 3 Preview will display a dialog box to ask if you want to update your project files from Silverlight 2 to Silverlight 3.

Web site support

Using sample data

When you create a new Silverlight project in Expression Blend 3 Preview, you now have an additional project type called Silverlight Application + Web Site. When you create a Silverlight application using this kind of project, you get both a Silverlight application and an associated website with a default HTML page that will load your Silverlight application.

Source file version control

TFS support

Expression Blend 3 Preview introduces support for Microsoft Visual Studio 2008 Team Foundation Server. You now have the ability to perform common source control–related tasks on solutions and projects such as checking in, checking out, merging, and more.

Animation

More properties available to animate

In a Silverlight project, you can now record keyframes for many more properties than before. To help with this, there is a new menu command, Record Current Value, on the Advanced property options menu that appears when you click the marker next to individual properties in the Properties panel.

Better support for easing in Silverlight

You can now apply predefined, named easing functions to individual keyframes by selecting a keyframe and then selecting an EasingFunction in the Properties panel.

Animating to resource values

You can now animate to/from some resources. For example, you can animate a color property from a static value to a color resource. To select the color resource, use the Advanced property options pop-up menu on the Editor tab in the Brushes category of the Properties panel.

Text

Improved embedding of fonts and subsets of fonts

With Expression Blend 3 Preview, you can easily embed and create subsets of fonts in Silverlight and WPF projects. The new Font Manager lets you select fonts installed on your computer and customize which subset of the characters to embed.

Extensibility

Extensible Asset Library

You can populate the contents of the Asset Library in Expression Blend 3 Preview by registering a directory that contains one or more assemblies. You can write your code to display custom icons and more. You can also instantiate controls stored in those known assemblies, and Expression Blend will then add the necessary assembly references to your project.

Artboard extensibility

Expression Blend 3 Preview introduces more refinements to the extensibility APIs for WPF and Silverlight. The extensibility points are compatible with the Microsoft Visual Studio designer, and you also have more flexibility to extend the artboard.

Extensible project templates

Expression Blend 3 Preview now supports extensible project templates, which provide customizable project and item stubs to improve project creation. These project templates, which are a subset of what Visual Studio supports, can be used to create complex solutions with inter-project dependencies and assembly references.

Workspace

Docking and workspace configuration

Expression Blend 3 Preview extends the workspace configuration features found in earlier releases by providing full docking support for all panels. You can customize the Expression Blend 3 Preview user interface to your liking and save this configuration as a preset.

Direct selection improvements

Expression Blend 3 Preview contains some significant changes to the selection model that will make it easier to change your selection and draw new objects on the artboard. The changes include extending the functionality of the Selection tool to behave similarly to the Direct Selection tool, and improving the creation and parenting behavior on the artboard with the help of visual indicators and gestures.

Marquee selection of points

When you use the Direct Selection tool, you can now select individual points on a path by using marquee selection. Just drag to define the area that contains the points you want to select.

Auto-scroll and zoom improvements

Now, when you move or resize an object, the Expression Blend 3 Preview artboard scrolls automatically. If you move the cursor past the artboard, the scrolling will stop. Another change is that rotating the mouse wheel now zooms the artboard by default.

Keyboard shortcuts and modifier keys

Expression Blend 3 Preview makes common tasks easier by introducing new keyboard shortcuts and modifier keys for actions such as direct selection, marquee selection, duplication of content, panning/zooming, and more.

What’s New in Expression Blend 3 Preview

With Microsoft Expression Blend 3 Preview, you can create Windows Presentation Foundation (WPF) applications for the desktop and Microsoft Silverlight 3 applications for the web. Expression Blend 3 Preview is a major new release, taking the product in a number of new, important directions, such as on-the-fly sample data generation. We also added support for several Silverlight 3 features. Expression Blend 3 Preview is a step on a long journey towards tools that are meant to empower designers to participate in the process of software creation in deep, meaningful, and creative ways. Using Expression Blend 3 Preview, you, the designers, can make computers easier and more fun to use, and can delight customers with great applications and great content.

A guide to Silverlight 3 new features

Fully supported by Visual Studio and Expression Blend, highlights of new features and functionality of Silverlight 3 include: major media enhancements, out of browser support allowing Web applications to work on the desktop; significant graphics improvements including 3D graphics support, GPU acceleration and H.264 video support; and many features to improve RIA development productivity. Also, in order to fully integrate all the .NET developer tools, Visual Studio 2010 will support a fully editable and interactive designer for Silverlight. New features in Silverlight 3 include:

* Support for Higher Quality Video & Audio. With support for native H.264/Advanced Audio Coding (AAC) Audio, live and on-demand IIS7 Smooth Streaming, full HD (720p+) playback, and an extensible decoder pipeline, Silverlight 3 brings rich, full-screen, stutter-free media experiences to the desktop. New and enhanced media features in Silverlight 3 include:
o Live and on-demand true HD (720p+) Smooth Streaming. IIS Media Services (formerly IIS Media Pack), an integrated HTTP media delivery platform, features Smooth Streaming which dynamically detects and seamlessly switches, in real time, the video quality of a media file delivered to Silverlight based on local bandwidth and CPU conditions.
o More format choice. In addition to native support for VC-1/WMA, Silverlight 3 now offers users native support for MPEG-4-based H.264/AAC Audio, enabling content distributors to deliver high-quality content to a wide variety of computers and devices.
o True HD playback in full-screen. Leveraging graphics processor unit (GPU) hardware acceleration, Silverlight experiences can now be delivered in true full-screen HD (720p+).
o Extensible media format support. With the new Raw AV pipeline, Silverlight can easily support a wide variety of third-party codecs. Audio and video can be decoded outside the runtime and rendered in Silverlight, extending format support beyond the native codecs.
o Industry leading content protection. Silverlight DRM, Powered by PlayReady Content Protection enables protected in-browser experiences using AES encryption or Windows Media DRM.
* Empowering Richer Experiences. Silverlight 3 contains new 3D graphics, animation features, hardware accelerated effects and text improvements that enable designers and developers to create next generation Web visuals. Additional features include:
o Perspective 3D Graphics. Silverlight 3 allows developers and designers to apply content to a 3D plane. Users can rotate or scale live content in space without writing any additional code. Other effects include creating a queue in 3D and transitions.
o Pixel Shader effects. These software based effects include blur and drop shadow. In addition, you can also write your own effect. Effects can be applied to any graphical content. An example would be to make a button appear depressed on rollover you could use a drop shadow effect on the pressed visual state.
o Bitmap Caching. Silverlight 3 dramatically improves the rendering performance of applications by allowing users to cache vector content, text and controls into bitmaps. This feature is useful for background content and for content which needs to scale without making changes to its internal appearance.
o New Bitmap API. With Silverlight 3, developers can now write pixels to a bitmap. Thus, they can build a photo editor to do red eye correction, perform edits on scanned documents or create specials effects for cached bitmaps from elements on the screen.
o Themed application support. Developers can now theme applications by applying styles to their Silverlight 3 applications and changing them at runtime. Additionally, developers can cascade styles by basing them on each other.
o Animation Effects. Silverlight 3 provides new effects such as spring and bounce. These make animation more natural. Developers can also now develop their own mathematical functions to describe an animation.
o Enhanced control skinning. Silverlight 3 provides easier skinning capabilities by keeping a common set of controls external from an application. This allows the sharing of styles and control skins between different applications.
o Improved text rendering & font support. Silverlight 3 allows far more efficient rendering and rapid animation of text. Applications also load faster by enabling the use of local fonts.
* Improving Rich Internet Application Productivity. New features include:
o 60+ controls with source code : Silverlight 3 is packed with over 60 high-quality, fully skinnable and customizable out-of-the-box controls such as charting and media, new layout containers such as dock and viewbox, and controls such as autocomplete, treeview and datagrid. The controls come with nine professional designed themes and the source code can be modified/recompiled or utilized as-is. Other additions include multiple selection in listbox controls, file save dialog making it easier to write files, and support for multiple page applications with navigation.
o Deep Linking. Silverlight 3 includes support for deep linking, which enables bookmarking a page within a RIA.
o Search Engine Optimization (SEO). Silverlight 3 enables users to solve the SEO-related challenges posed by RIAs. By utilizing business objects on the server, together with ASP.NET controls and site maps, users can automatically mirror database-driven RIA content into HTML that is easily indexed by the leading search engines.
o Enhanced Data Support Silverlight 3 delivers:
+ Element to Element binding : UI designers use binding between two UI properties to create compelling UI experiences. Silverlight now enables property binding to CLR objects and other UI components via XAML, for instance binding a slider value to the volume control of a media player.
+ Data Forms. The Data Form control provides support for layout of fields, validation, updating and paging through data.
+ New features for data validation which automatically catch incorrect input and warn the user with built-in validation controls.
+ Support for business objects on both client and server with n-Tier data support. Easily load, sort, filter and page data with added support for working with data. Includes a new built-in CollectionView to perform a set of complex operations against server side data. A new set of .NET RIA services supports these features on the server.
o Improved performance, through:
+ Application library caching, which reduces the size of applications by caching framework on the client in order to improve rendering performance.
+ Enhanced Deep Zoom, allows users to fluidly navigate through larger image collections by zooming.
+ Binary XML allows communication with the server to be compressed, greatly increasing the speed at which data can be exchanged.
+ Local Connection This feature allows communication between two Silverlight applications on the client-side without incurring a server roundtrip: for instance a chart in one control can communicate with a datagrid in another.
* Advanced Accessibility Features. Silverlight 3 is the first browser plug-in to provide access to all system colors, allowing partially-sighted people to make changes such as high contrast color schemes for ease of readability by using familiar operating system controls.
* Out of Browser Capabilities. The new out of browser experience in Silverlight 3 enables users to place their favorite Silverlight applications directly onto their PC and Mac, with links on the desktop and start menu—all without the need to download an additional runtime or browser plug-in. Further, the new experience enables Silverlight applications to work whether the computer is connected to the Internet or not—a radical improvement to the traditional Web experience. Features include:
o Life outside the browser. Silverlight applications can now be installed to and run from the desktop as lightweight web companions. Thus, users can take their favorite Web applications with them, regardless of whether they are connected to the Internet or not.
o Desktop shortcuts and start menu support. Silverlight applications can be stored on any PC or Mac computer’s desktop with links in the start menu and applications folder, and so are available with one-click access.
o Safe and secure. Leveraging the security features of the .NET Framework, Silverlight applications run inside a secure sandbox with persistent isolated storage. These applications have most of the same security restrictions as traditional web apps and so can be trusted without security warnings or prompts, minimizing user interruptions.
o Smooth installation. Because Silverlight applications are stored in a local cache and do not require extra privileges to run, the installation process is quick and efficient.
o Auto-update. Upon launch, Silverlight applications can check for new versions on the server, and automatically update if one is found.
o Internet connectivity detection. Silverlight applications can now detect whether they have Internet connectivity and can react intelligently including caching a users’ data until their connection is restored.

New Features in Expression Blend 3: The designer-developer workflow took another major step forward today with major innovations in Expression Blend 3 including: SketchFlow, a rapid prototyping capability that makes it easy to communicate design intent to stakeholders; design time sample data that enables the design and testing of applications without access to live data; direct import of Adobe Photoshop and Illustrator files; behaviors, extensible and reusable components that add interactivity to applications without writing code; a full code editor supporting C#, VB and XAML; and many more features that support an improved design and development experience. Features include:

* SketchFlow. SketchFlow introduces a new set of features designed to make it easier for you to experiment with dynamic user experiences and create compelling prototypes. SketchFlow also helps communicate design ideas to other stakeholders, and makes it easier to collect in-context annotated feedback. SketchFlow enables the navigation and composition of an application to be modeled in a very visual manner from a simple prototype that uses a series of sketches, to something much more evolved. A prototype can be made as real and interactive as it needs to be to communicate design intent and SketchFlow can leverage all the existing features of Expression Blend.
* Adobe Photoshop and Illustrator import. The powerful importers for both Adobe Photoshop and Adobe Illustrator enable smooth integration with workflows the designer already has in place. The designer has freedom to view and import Photoshop files layer by layer. Layers can be easily regrouped and elements retain their original formats; layers, layer positions, editable text and vectors remain available for editing within Expression Blend.
* Behaviors. Add interactivity to your application, without having to write code. Behaviors can encapsulate complex design interactions into reusable components which can be directly applied to a user interface element in the application. Developers have access to a rich API that they can use to write their own triggers, actions, and behaviors for use in their Silverlight and WPF projects.
* Sample data. Design time sample data makes it easy to build data-connected applications without access to live data. You can generate sample data or import sample data from an XML file and is available to controls on the artboard at design-time. You can extensively customize your sample data details, and you can easily switch between using sample data and using live data at run-time.
* Improved design and development experience. Expression Blend 3 includes many features that improve the overall design experience including a brand new design surface making Blend more accessible to visual designers. Team Foundation Server support allows easier integration of the Blend user into Team System. Improved animation and easing functions, 3D transforms, visual effects and an improved visual state manager enable a great tooling experience.

Resetting Password with ASP.NET 2.0 Membership Using Multiple Membership Providers

If you ever have wanted to be able to programmatically change (reset) a users password while at the same time continuing to be able to use the question and answer feature, this post is for you. The problem is that if you use code like this:

string username = "user";
string password = "pass@word";
MembershipUser mu = Membership.GetUser(username);
mu.ChangePassword(mu.ResetPassword(), password);

You will find that if you have in your web.config requiresQuestionAnswer="true", you will get an error when you try and reset the password. The elegant solution to this is to create an additional membeship tag in your web.config and reference it when you change passwords. That is, add another provider like this:




requiresQuestionAndAnswer="false"
connectionStringName="EmailEmailConnectionString" applicationName="EmailEmail"
enablePasswordRetrieval="false" enablePasswordReset="true"
requiresUniqueEmail="true" passwordFormat="Hashed"
minRequiredNonalphanumericCharacters="0" writeExceptionsToEventLog="false"
minRequiredPasswordLength="1" passwordStrengthRegularExpression=""
passwordAttemptWindow="10" maxInvalidPasswordAttempts="8"/>




Then, when you change your password, reference it as follows:

string username = "user";
string password = "pass@word";
MembershipUser mu = Membership.Providers["SqlMembershipProviderOther"].GetUser(username);
mu.ChangePassword(mu.ResetPassword(), password);


Hope this helps! At some point, I will integrate this functionality into my ObjectDataSource article that lets you display your membership information with a gridview or detailsview.

Introduction to Isolated Storage (Dotnet Framework)

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.
When using isolated storage, applications save data to a unique data compartment that is associated with some aspect of the code’s identity, such as its Web site
, publisher, or signature. The data compartment is an abstraction, not a specific storage location; it consists of one or more isolated storage files, called stores, which contain the actual directory locations where data is stored. For example, a Web application might have a data compartment associated with it, and a directory in the file system would implement the store that actually preserves the data for that application. The data saved in the store can be any kind of data, from user preference information to application state. For the developer

, the location of the data compartment is transparent; stores usually reside on the client, but a server
application could use isolated stores to store information by impersonating the user on whose behalf it is functioning. Isolated storage can also store information on a server with a user’s roaming profile so that the information will travel with the roaming user.
Administrators can limit how much isolated storage an application or a user has available, based on an appropriate trust level. In addition, administrators can remove all a user’s persisted data. To create or access isolated storage, code must be granted the appropriate IsolatedStorageFilePermission.
To access isolated storage, code must have all necessary native platform operating system rights. For example, on Windows 2000
the access control lists (ACLs) that control which users have the rights to use the file system must be satisfied. Microsoft .NET Framework applications already have operating system rights to access isolated storage unless they perform (platform-specific) impersonation. In this case, the application is responsible for ensuring that the impersonated user identity has the proper operating system rights to access isolated storage. This access provides a convenient way for code that is run or downloaded from the Web to read and write to a storage area related to a particular user.
Sometimes it is helpful to verify a change to isolated storage using the file system of the operating system. Developers might also need to know the location of isolated storage files. This location is different depending on the operating system. The following table shows the root locations where isolated storage is created on a few common operating systems. Look for Microsoft\IsolatedStorage directories under this root location. You must change folder settings to show hidden files and folders in order to see isolated storage in the file system.

The Essence of .NET Technology

.NET is the name for the Web-service-based technology from Microsoft providing software means of connecting devices, systems, people and information. Basing on the Microsoft platform, this technology enables the user to easily and quickly design, deploy, manage and use software solutions connected via Web-services with high level of security. For businesses .NET technology provides the opportunity of quick and effective integration of their systems and of really getting the information anytime, anywhere and on any device, as promised.
The Microsoft platform provides businesses with all the tools necessary to design and build a complete IT architecture connected via Web-services, it includes severs needed to host Web-services, all kinds of development tools to create these services and the applications to use them. Technical support and help is provided by more than 35 000 of Microsoft Certified Partner organizations all over the world.
Web Services: What Is It?
A developer would commonly describe a Web-service as something like “a software system designed to support interoperable Machine to Machine interaction over a network via common XML-messages that follow the SOAP standard”.
Yet a businessman who has implemented Web-service-based software solutions has a different understanding of this notion. For him Web-services are powerful tools that enable his business to interact more efficiently with customers, suppliers, partners and employees. They help to bring extended services to the customers and enable to organize the information flows in such a way that any employee can easily access the information or data he or she needs. They enable the employees to shorten the development period and reduce the expenses for new projects. Generally, a businessman has the understanding of benefits that Web-services bring to his business rather than the understanding of what they are.
The Advantages of Web-Services
What is most important about Web-services is that they provide the opportunity of cross-platform and cross-operating system information interchange. Thus there exist the following advantages that can be pointed out:
* Web-services bring new opportunities to the business by enabling to communicate with customers and partners in a more effective way
* Web-services deliver the users more personal, integrated experiences using the smart devices – including PCs
* Web-services help to reduce the development time for new projects
* The businesses’ Web-services are easily made accessible to its customers thus increasing the profits.