NDepend v6 available

Version 6 of NDepend is now available for download from the official site.

New features include:

  • enhanced Visual Studio integration;
  • support for Visual Studio 2015;
  • rule files shareable amongst projects;
  • default rules description and HowToFix;
  • default rules less false positives;
  • colored code metric view;
  • intuitive display of code coverage percentage;
  • compiler generated code removal;
  • async support;
  • analysis enhancements;
  • support for Visual Studio Blue, Dark, Light themes;
  • support for high DPI resolution;
  • integration with TFS, SonarQube and TeamCity.

A detailed description of the new capabilities is available here.

Windows 10 UWP: Using PlayReady content protection with live DASH

I’ve recently blogged about using PlayReady content protection with Smooth Streaming on Windows 10 UWP by initialising a MediaProtectionManager object in the player element.

Since PlayReady is a technology for handling protected media content, it is possible to use it with different stream formats like Dynamic Adaptive Streaming over HTTP (DASH).

In the previous days, I have been exploring the live DASH sample available in the Universal Windows Platform repository on GitHub: the example enables playback of streams containing the profile “urn:mpeg:dash:profile:isoff-live:2011“.

It is possible to just add PlayReady content protection to this live player by initialising the MediaExtensionManager and then handling the MediaProtectionManager setup / ServiceRequested event:

The updated Visual Studio solution is available here on GitHub.

Smooth Streaming PlayReady samples for Windows 10 UWP available on GitHub

Lately I have been investigating PlayReady support available in the new Windows 10 Universal Windows Platform and found that the additional SDK necessary for Windows 8.1 Universal apps is not required for UWP since PlayReady Client is now part of the platform as described in this MSDN documentation.

When migrating Windows 8.1 apps to UWP, the key is to change the namespace from Microsoft.Media.PlayReadyClient to Windows.Media.Protection.PlayReady:

I have just pushed two samples on GitHub (C# and JavaScript) which also require the Universal Smooth Streaming SDK.

Multi-Touch Behaviors project moved to GitHub

I’ve just pushed to GitHub a first version of the Multi-Touch Behaviors containing a new sample targeting Windows 10 UWP (work in progress…) and some refactoring using shared projects in order to simplify the code and reusing it across different platforms.

For new contributions just send pull requests here!

Multi-Touch Behaviors sample: Main Page

Windows 10 UWP and Project Westminster: giving new life to your web sites with Hosted Web Apps

One of the most interesting features available in the new Windows 10 Universal Windows Platform (UWP) is the concept of Hosted Web Apps: an existing web site can be easily published to the Windows Store by creating a package pointing to it and, in this case, enabling access to the underlying UWP platform.

This feature enables the developer to easily enrich existing sites with Windows 10 specific functionalities and services like Cortana, Voice recognition, Xbox Live, just to name a few.

The steps required for creating an hosted web app using Visual Studio 2015 are quite simple:

1 – Create a new JavaScript Windows Universal project:

HostedWebAppVs2015_1

2 – Remove all unneeded source files from the project

Since the app will be pointing to an existing web site, the folders js / css / WinJS and the default.html file can all be removed from the project

HostedWebAppVs2015_2

3 – Modify the app manifest to provide the target URL and content rules

The package.appxmanifest file must contain the details of the Start Page and also the content rules specifying if the web site will have access or not to the Windows Runtime:

 

4 – Access desired Windows Runtime functionalities in the website code

I’ve created a very simple web page which will be accessing the UWP platform if the code is executed within an hosted web app. In this case we are only verifying the internet connection, but it could be modified to access Cortana APIs!

 

Here we go. These are the steps required for creating an hosted web app in Windows 10 UWP.

If you want to play with the code, I’ve published the sample on GitHub.

Player Framework Beta 3.0 and Universal Smooth Streaming Client SDK for Windows 10 UWP available

A new version of the Player Framework targeting Windows 10 UWP is now available for download from Codeplex. Smooth Streaming support is provided via the Universal Smooth Streaming Client SDK available in the Visual Studio gallery.

PlayReady is now part of the UWP platform (read the original discussion here), so there is no additional SDK required.

Player Framework 3.0 can also be used on Windows 8.1 Store apps and supports both XAML and WinJS 4.

TypedMVVM and WinJS: Binding event handlers in a ListView ItemTemplate

I have recently received a request in the TypedMVVM forums about binding event handlers to a specific WinJS ListView item template.

I’ve then decided to improve the current samples available in the repository by adding some basic commands, using the RelayCommand<T> class, that can be fired by pressing a button associated to each item of the ListView:

The key here is to add the “win-interactive” class to the specific button element contained in the template (otherwise the click event will not be triggered) and then use WinJS.Utilities.markSupportedForProcessing() in the model to allow the declarative binding to be correctly applied:

Specific instances of the ListView model can be created by the sample service responsible for initialising the ViewModel data:

As usual, the sample code is available for download here.

Cordova Windows Store apps and certificate expired error

I was updating TypedMVVM to the latest Visual Studio 2013 Update 4 and Cordova tools (using the new free Community Edition) and trying to deploy the sample to the Windows 8 emulator when I received the following

error APPX0108: The certificate specified has expired

As pointed here by Microsoft Open Technologies, the certificate available in the Visual Studio template has just expired and is not possible to deploy Windows Store apps using the old one.

To solve this problem I’ve then downloaded from here the updated certificate and copied to the following location inside the Visual Studio project:

res/native/windows/CordovaApp_TemporaryKey.pfx

The updated code is available for download on CodePlex.

TypedMVVM: Samples updated for Apache Cordova

I’ve recently installed the Multi-Device Hybrid Apps template on Visual Studio in order to try out the development of native mobile applications (targeting Android, iOS, Windows Store and Windows Phone) using HTML, CSS and JavaScript using the Apache Cordova framework.

As a first example, I decided to reuse all the TypeScript code available in my library TypedMVVM available on CodePlex.

The process was very simple and didn’t take long: I was able to quickly create a basic “Hello World” application successfully deployed on the Ripple – Nexus 7 Android emulator

TypedMVVM_Cordova

As usual, the updated code is available for download on Codeplex.

WinJS and TypeScript: binding a ListView itemDataSource to a ViewModel property

I’ve recently been asked on the TypedMVVM forums how to properly bind a ListView data source to a list of items available as a property in the ViewModel.

Just create new getters and setters in the ViewModel and initialise the property by creating a new instance of WinJS.Binding.List:

Then reference from HTML the new itemsSource property in the ListView control using data-win-bind:

As usual, the sample code is available for download on Codeplex.