Knockout 2.0.0 released
Knockout is an MVVM library for JavaScript – it makes rich dynamic web UIs easier and cleaner to build. The best place to start learning is with the interactive tutorials.
- The finished 2.0.0 build is now on GitHub
- All of the documentation and live examples are updated to reflect the new version
- All of the interactive tutorials are updated too.
- A 20-minute demo video
Building Offline Experiences with HTML5 AppCache and IndexedDB
Users expect their Web sites and apps to work well even when the network isn’t available. With data increasingly stored in the cloud, developers want to enable fluid experiences that allow access to data when there is no connectivity; when devices are disconnected from the network or when they encounter dead spots in coverage.
In this post, we show how to create well-behaved offline sites and apps using the following HTML5 features:
- AppCache to store file resources locally and access them offline as URLs
- IndexedDB to store structured data locally so you can access and query it
- DOM Storage to store small amounts of text information locally
- Offline events to detect if you’re connected to the network
For more goto –> http://blogs.msdn.com/b/ie/archive/2011/09/27/building-offline-experiences-with-html5-appcache-and-indexeddb.aspx
Also, BUILD presentation Building offline access in Metro style apps and Web sites using HTML5
Html JavaScript Development using MVVM
Shawn Wildermuth talks about using KnockoutJS framework to develop a MVVM application:
KnockoutJS is a framework that allows me to use HTML-based data binding markup to describe my UI, CSS to describe what the design looks like and JavaScript to tie the data to the data binding. The is chiefly accomplished through the concept of observable objects. For example, I created a new JavaScript ‘class’ called gameModel in my view.js by creating members using the observable method on the knockout (e.g. ko) object:
$(document).ready(function () {
function gameModel() {
this.name = ko.observable();
this.id = ko.observable();
this.genre = ko.observable(); this.releaseDate = ko.observable();
this.price = ko.observable();
this.imageUrl = ko.observable();
};
…
});
// Define Main ViewModel var theViewModel = { games: ko.observableArray([]), ... };
The games property of the view models ‘class’ will hold the current list of games that are shown in the UI. The observableArray object is like the observable object but it notifies the data binding stack when a collection changes. The goal here is to have the view model load the games from the REST service and as the collection changes, the HTML should change to react to that. No more manually creating/destroying parts of the markup.
In order to make this work, we must use the data binding syntax in the HTML code:
<div data-bind="foreach: games"> <div class="game-block"> <div> <img data-bind="attr: { src: imageUrl, alt: name }" /></div> <div class="game-name" data-bind="text: name"> </div> </div> </div>
For more: http://wildermuth.com/2011/11/20/Using_MVVM_on_the_Web_with_KnockoutJS
Silverlight Async Programming – Best Practices
Silverlight client runtime does not allow synchronous operations and requires network-based operations to be asynchronous. While asynchronous and event-based programming models have been a part of the .NET Framework since the earliest versions, orchestrating sequential and parallel asynchronous workflows can be problematic.
Kinect for Windows SDK Beta
The Kinect for Windows SDK beta includes drivers, rich APIs for raw sensor streams and human motion tracking, installation documents, and resource materials. It provides Kinect capabilities to developers who build applications with C++, C#, or Visual Basic by using Microsoft Visual Studio 2010.
This SDK includes the following features:
-
Raw sensor streams
Access to raw data streams from the depth sensor, color camera sensor, and four-element microphone array enables developers to build upon the low-level streams that are generated by the Kinect sensor. -
Skeletal tracking
The capability to track the skeleton image of one or two people moving within the Kinect field of view make it easy to create gesture-driven applications. -
Advanced audio capabilities
Audio processing capabilities include sophisticated acoustic noise suppression and echo cancellation, beam formation to identify the current sound source, and integration with the Windows speech recognition API. -
Sample code and documentation
The SDK includes more than 100 pages of technical documentation. In addition to built-in help files, the documentation includes detailed walkthroughs for most samples provided with the SDK. -
Easy installation
The SDK installs quickly, requires no complex configuration, and the complete installer size is less than 100 MB. Developers can get up and running in just a few minutes with a standard standalone Kinect sensor unit (widely available at retail outlets).
Home page here.
The SDK is documented and code walkthroughs are provided here. Enjoy!
Developer’s Guide to Microsoft Prism 4.0
The documentation for Prism 4 has been completely rewritten and includes the architectural overview, design, and technical concepts for composite applications, applied patterns, two chapters covering Model-View-ViewModel (MVVM), application navigation, Stock Trader Reference Implementation (Stock Trader RI) and MVVM Reference Implementation (MVVM RI) overview, QuickStart overviews, and deployment topics. Much of this guidance is applicable even if you are not using the Prism Library, but you want to know best practices for creating composite applications
The guide contains the following topics:
- Readme
- What’s New in Prism 4.0
- Chapter 1: Introduction
- Chapter 2: Initializing Prism Applications
- Chapter 3: Managing Dependencies Between Components
- Chapter 4: Modular Application Development
- Chapter 5: Implementing the MVVM Pattern
- Chapter 6: Advanced MVVM Scenarios
- Chapter 7: Composing the User Interface
- Chapter 8: Navigation
- Chapter 9: Communicating Between Loosely Coupled Components
- Chapter 10: Sharing Code Between Silverlight and WPF
- Chapter 11: Deploying Prism Applications
More:
- Patterns in the Prism Library – an overview on common patterns used in “Composite Application” & Prisim Library.
- Prism Library – the organization of the Prism Library into 4 different assemblies. (WP7 has only 2 assemblies)
- Extending Prism e.g. custom logging.
- Reference Implementations
- QuickStarts
- Appendix H: Prism Hands-On Labs
Class Library References:
MVVM-Friendly DomainDataSource: DomainCollectionView
Yes, that’s right… we now have a component that is a big step toward addressing the request for an MVVM-Friendly DomainDataSource. As of this posting, that feature was the #2 requested item on the RIA Services wish list, and we’ve been pondering its design for a long time. Kyle McClellan has delivered on this and he is posting details to his blog. This feature is completely separate from the DomainDataSource, and it’s built from the ground up with ViewModel usage in mind.
Here are some specific links from Kyle’s blog:
- Collection Binding Options in WCF RIA Services SP1
- Introducing An MVVM-Friendly DomainDataSource: The DomainCollectionView
Here are the links you need to get up and running:
- Install WCF RIA Services SP1 for Silverlight 4
- Install WCF RIA Services SP1 for Silverlight 4 and Visual Studio 2010
- Install the WCF RIA Services December 2010 Toolkit for WCF RIA Services SP1
Native Extensions COM automation Library for Microsoft Silverlight
While Silverlight 4 supports accessing COM automation components from elevated trust OOB applications, many Windows platform features are currently not available through COM automation. This makes them inaccessible to such Silverlight OOB apps. Native Extensions for Microsoft Silverlight(NESL) is an effort to incrementally build a library of components that expose select Windows 7 features through COM automation, making them easily available to Silverlight 4 OOB applications running with elevated trust. The current version of NESL provides access to Windows 7 features like Sensors, Portable Devices, Speech, Taskbar and more. NESL is made up of a set of COM automation based runtime libraries, Silverlight wrapper libraries usable from Silverlight 4 OOB applications, sample applications with source, API documentation, and a developer’s guide.
A NESL is a set of libraries for Silverlight developers that allow them to access some really cool features of Windows 7 from their Silverlight applications.
- Take advantage of sensors like accelerometers, light sensors, compasses, GPS etc.
- Access content from connected portable devices like music players and digital cameras.
- Capture and create video from webcams and screen output
- Use speech recognition and text to speech capabilities.
- Integrate with the Windows 7 taskbar (Jump Lists, Icon Overlays, Taskbar Progress etc.)
Head over to http://code.msdn.microsoft.com/nesl to start developing with it.
How to set up an Authenticated Web Service for Windows Phone
Setting up an authenticated web service is recommended, as communication occurs over an HTTPS interface for better security. Authenticated web services do not have a daily limit on the number of push notifications they can send. Unauthenticated web services, on the other hand, are throttled at a rate of 500 push notifications per subscription per day. Additionally, authenticated web services are able to register a callback request, as described in How to: Set up a Callback Registration Request for Windows Phone. more here.
Learn more about Push Notification:
Using the ASP.NET Membership Provider and Authentication Service from Windows Phone 7
Those of you who have been building ASP.NET applications for a while now are no doubt familiar with the provider model, which includes provider abstractions for membership (authentication), roles (authorization), profiles (user data), and session state. These providers make it incredibly easy to provide a secure framework for your application. In fact, with an ASP.NET application template right out of the box, you can have a fully functioning authenticated, secure website in minutes.
What a lot of people have less familiarity with is the notion of provider services. You can actually create a WCF service head that sits on top of the ASP.NET membership system. This allows client applications (WP7) to authenticate against your ASP.NET website using exactly the same authentication scheme that your users use. This means that a user who has access to your website should also be able to have access to the client application seamlessly.
If you already have an ASP.NET application that is using the membership provider, role provider, and profile provider you can quickly, easily, and securely expose services to a mobile (WP7) client that allow that client to have secured, remote access to services exposed by that site. In short, any user of your existing web application can use their existing credentials to log in from their WP7 device and access any services you decide to make available.
ASP.NET provider services, coupled with WP7 and the fact that Silverlight has access to WCF client proxy generation, means you can very easily prep your site for a rich WP7 experience.
To read more…
