Pages

Monday, 13 August 2012

Creating a WinRT component using C++/CX: DeForm, a Direct2D effect toolkit


Creating a WinRT component using C++/CX: DeForm, a Direct2D effect toolkitBack to my first love, I’m thrilled to present you DeForm which is a WinRT component that uses Direct2D to apply bitmap effect to a source image.
The library and a sample C# client can be found there:


The goal of this article is to describe how I proceeded to write DeForm component.

Note : You can create WinRT components using C++ or a .NET language. Details can be found here

Read full article here

Storage Helper for Windows 8


One of the biggest helpers back in the good old land of Windows Phone was a little helper class to help with the messy work of saving game data and loading it back again, you always ended up writing several bits of code for each thing you wanted to save and it took a bit of effort.
Then along came the “Isolated Storage Helper” (apologies, could not find the original source for it), a nifty little class that through the power of generics worked for just about any type of class and did all the grunt work for you, it looked like this:
Read full article here
Code can be downloaded from here

Creating a WinRT application step by step: From idea to publishing


Creating a WinRT application step by step: From idea to publishing I would like to welcome you to a code-along series, as I create a WinRT application step by step. The code will be downloadable and I invite you to provide comments and suggestions as we make this application together. This guide is aimed at developers at all levels, so I will keep it simple – but still realistic as the aim is to publish this application. We will first create the application using XAML and C#, and when we are done we will re-create the application using Html and JS.


Some of the things we will be covering during the app development:
  • How to plan the application
  • Working with data, input and output
  • Saving data locally
  • Displaying data
  • Refactoring code
  • How to implement the Metro guidelines
  • User Experience, significance and problem solving
  • Design, creating a ‘pretty’ app with little effort
  • Using performance tools
  • Using the WACK tool
  • Submitting the application


Read full article here

Synchronous to Asynchronous Explained


I've posted several articles about the new async and await keywords that are available in Visual Studio 2012, but I still see some people struggle with the concept. How do you make a task asynchronous? When and where do you use the async keyword?

The answer is not simple because the need to process asynchronously depends on a variety of factors. There is overhead when you create a thread. It allocates memory and creates a new synchronization context. Having a thread communicate with other threads is even more expensive and adds complexity to your code. Fortunately, the teams at Microsoft introduced the Task Parallel Library to help simplify how you work with threads. I strongly recommend learning as much as you can about the Task object if you wish to master asynchronous programming.

Read full article here

Windows 8–Data binding Part 2

In my previous blog post I introduced data binding.  It worked, but there was no mechanism for updating.  Updating comes in two flavors, and these are often confused by folks new to databinding:
  1. Someone else updates the underlying data; we’d like the display to be updated
  2. The user updates the data on the display, we’d like the underlying data to be updated
The first case arises because most of the time you are not the only user of your program – other users may be connected to the same data and while you are looking at your data someone else may change it.  You want to see that change immediately.  The canonical example is this: you work at a bookstore and someone calls and asks whether you have a particular book in stock.  You check and say yes, you have one left.  While they are deciding whether to purchase it, another employee has sold that book.  The quantity-on-hand just dropped from one (plenty of books for your customer) to zero (oops).  You really would like to see that change reflected in the UI. 
Read full article here

Windows 8 Primer–Data Binding (Part 1)


Data-binding is often thought of as an advanced topic, but there really is no reason for that. data-binding is


  • Critical to writing XAML applications
  • Not very difficult to learn
  • A very powerful technique

Note to Silverlight, WPF and Windows Phone Programmers: Nothing Here Is New.  Data-binding in 
Windows 8 works exactly as you expect.

The basic idea behind data-binding couldn’t be simpler: we are going to provide values to UIElements based on the values of objects or of other UIElements.  In this first tutorial, we’ll keep it simple and bind the value of POCO (Plain Old CLR Objects) to UI elements.

Read full article here

Adding Location, Geocoding, and Bing Maps to Windows 8 Apps

Adding Location, Geocoding, and Bing Maps to Windows 8 AppsDid you know that the Windows 8 Location service does not require a GPS? It’s totally true. So many applications have to use location and so many applications should. With Windows 8, sensors and location isn’t a “what if” it’s a standard service that “just works”.
 

MSDN: Computers today are more mobile than ever. From small laptops to Tablet PCs, many computers can go wherever the user wants to go. Programs that take advantage of the computer's mobility can add significant value to people's lives. For example, a program that can find nearby restaurants and provide driving directions would seem to be a natural fit for a portable computer. But while the technology to determine the user's current location is common and affordable, building solutions on this technology can be a daunting task.

Read full article here
Get the real code here.

Windows 8 Notifications: Periodic Notifications


My loose description of periodic (and push) notifications as ‘external’ or ‘decoupled’ is rooted in the observation that content delivered via periodic and push notifications is not typically initiated or provided by the Windows 8 application itself.
With periodic notifications, the Windows 8 application is a subscriber to content hosted at a URI that specifies the XML template for the tile or badge notification (toast is not supported for periodic notifications). Whatever content is at that URI at the regularly recurring time (from 30 minutes to daily) is what the Windows 8 application will use. It’s up to some 3rd party service or application to update that URI’s content at the appropriate interval - providing information on the daily special at a given restaurant, for example.
Read full article here

Windows 8 XAML Tips - Settings Demo



In my previous blog post I explained how you can use the PaneThemeTransition from the Animation Library to show a task pane. In this blog post I want to use this technique to open my Settings and About task panes from the Settings Charm. I will try to make it easier by introducing a TaskPanePopup helper class.

TaskPanePopup


You construct an instance of the TaskPanePopup class using a task pane, in most cases this will be a user control. In the constructor a Popup control is created and initialized with the Child (the task pane) and the ChildTransitions (PaneThemeTransition coming from the right). The Width of the task pane must be set to calculate the position of the Popup. The task pane will be shown in a Popup using the animation when you call the Show() method on the instance.

Read full article here

Windows 8 XAML Tips - Show a task pane


You can integrate the look and feel introduced in Windows 8 Release Preview into your Metro style app by using the Animation Library suite of Windows-provided animations. Use of the Animation Library animations provides these benefits:
  • Motions that align to Metro style animation principles
  • Fast, fluid transitions between UI states that inform but do not distract the user
  • Clearer visuals to show the user transitions within an app
Read full article here

Exporting SQL Server Compact to SQLite


The current available local relational database storage options on WinRT (Windows 8) are limited to SQLite (and maybe some others). Also on Windows Phone 8, both SQL Server Compact and SQLite will be available. So a natural path solutions currently based on SQL Server Compact will be to migrate to SQLite, and the first step would be to move the schema and data to a SQLite database.
I have therefore “bitten the bullet”, and the next version of the SQL Server Compact Toolbox,currently available for download in an alpha version, includes a feature to “dump” a SQL Server Compact database in SQLite .dump format.
Exporting SQL Server Compact to SQLite
Read full article here

Share Text in between Windows 8 Metro Application using Share Contract


Two Metro applications can shared the content between them using Share Charm. Content can be as simple as text or may be image or a file. In content sharing, the application that shares content is called as Source Application and the application that receives content is called as Target Application. Source Application and Target Application need to declare the type of content; they are intent to share in a Declaration.
Declaration can be configured in the package.appmanifest file. Click onpackage.appmanifest file and then select Declaration tab. From the Available Declarations drop down select Share target and check SupportedAnyFile Type in Supported File Types. See the image below.
Share Text in between Windows 8 Metro Application using Share Contract

Read full article here

A WinRT behavior to turn a FlipView into a kind of Windows 8 Panorama

A WinRT behavior to turn a FlipView into a kind of Windows 8 Panorama One of the most beautiful controls of Windows Phone is the Panorama. It’s ideal for showing a lot related content on a small screen and enable the user to easily pan trough it. A visual cue for ‘there is more’ is provided by showing a little part of the next panel to the very right of the current data. A typical example is showed right.  

It’s also one of the most abused controls (guilty as charged Your Honor), but still I wanted to port Catch’em Birds to Windows 8 – and I found out there was no ready-to-use control. After fighting with ScrollViewers and GridViewers and whatnot I came to this very simple behavior, which basically takes a FlipView and hammers it into a kind of Panorama.

Read full article here

Download WinRtBehaviors CodePlex project
Web Informer Button