Pages

Tuesday 23 October 2012

Ten Things You Need to Know About WebView

  1. WebView is not a general-purpose browser
  2. WebView always renders on top of XAML
  3. WebView doesn’t do Flash.  Or Silverlight.  Or PDF.  Or any other ActiveX control or plugin.
  4. How to invoke Javascript inside the displayed webpage of a Webview
  5. How to receive information from the WebView
  6. How to inject javascript into a WebView page
  7. How to clear the WebView cache
  8. How to embed a font into your app to be used by WebView
  9. Launching other apps from a link inside WebView
  10. How to get rid of those annoying JavaScript exceptions when debugging

Click here to know more

Testing in-app puchasing in Windows 8

One of the many new features with upcoming Windows 8 is the Windows Store distribution and monetization channel. Developers can now add in-app purchasing to their apps. The prizes are the same as application prizes in store, e.g. starting from 1,49 USD (1,19 EUR) and gradually growing up in 50 cent increments. Because it seems testing in-app purchasing system isn’t trivial to everybody, here’s a quick sample to get you started. This is only a basic example to get you started, so I don’t cover different in-app types.

Read More

Microsoft DevRadio: Your Top Windows Store Questions Answered


Jerry Nixon welcomes Principal Program Manager Arik Cohen to the show as they discuss the recently launched Windows Store and a wide variety of topics developers ask most.

Read More

Shortcut Key Handling in Windows Store Apps

I wanted to create a simple ALT+S shortcut in my app to jump to a TextBox in my Windows Store App (no this is not the Win+Q search charm shortcut). However, this is not that obvious to get working app-wide, so I’ll share it here:

The obvious way to do this is assign a KeyDown event to your page using the typical “this.KeyDown += MyKeyDownHandler”, or override OnKeyDown. However this has one problem: If any control that has focus currently handles key down events (like TextBox), this event won’t be raised due to how event bubbling works. However there is another way to create an event handler that overrides the bubbling: UIElement.AddHandler. In the 3rd parameter of that, you can specify that you want to be notified even if the event has been handled.

Read More

Top 10 features of the Microsoft Surface

Top 10 features of the Microsoft Surface
Microsoft Surface is the new tablet device made by Microsoft, running Windows RT and Windows 8. InformationWeek, today, released their top 10 for the coolest features of Microsoft Surface. I have listed them below with a little more information next to each.

Surface: Where work meets play. The power of Windows, the productivity of Office Home & Student 2013 RT Preview, and the joy of Xbox – not to mention apps, social media, music, and more. Surface is also cloud-connected with SkyDrive, so you can access your content from anywhere, at any time.

Read More

Preparing your Windows 8 Applications for the store

Preparing your Windows 8 Applications for the storeIf you are a student in the US, you have the ability to get access to the Windows 8 store for no cost through DreamSpark.  You will need an email account that has the EDU extension.

Once you have access to the Windows 8 Store then you can upload your app to the windows 8 store, but it can be confusing when you see all of the squares that you have to click.

First thing you need to do in the Windows Store: Click on Submit App and then Reserve a name.  Why? If you do not reserve a name then you can’t upload your package (the file with the appxupload extension).  Once you have that done, then you can upload your app.

Read More

Data Template Selector in Windows 8 Metro XAML App

Data Template Selector in Windows 8 Metro XAML App
It has been work around to have more than one data template in a list to display the data. In Windows 8 it has been eased, WinRT introduces the DataTemplateSelector class, where we could have more than one template to display in an items source control in Windows 8. In this article we would discover that.

To explore the sample, you definitely need Windows 8 Consumer Preview and Visual Studio 2012 RC.

Read More

How to Test Your Windows 8 App Before Submitting to the Store

How to Test Your Windows 8 App Before Submitting to the Store
It’s always a good idea to test your application before submitting it to the store. The Windows Application Certification Kit (WACK) tool can save you from failing the early automated tests.

The first thing you’ll want to do is uninstall any existing build of your application. This is important because the WACK tool may fail if a previous debug build is still installed on the system. To uninstall your app, find it on the Start experience, right-click and choose ‘Uninstall’.

Read More

Saturday 20 October 2012

Controlling caching of BitMapImage under WinRT

By default Bitmap Images are cached by WinRT with no intervention required by the developer.  Often times this is a good thing but there are some occasions where this is undesirable.  Although there doesn’t appear to be any obvious control in the API reference I have found that adding a dummy querystring to the BitMapImage source filename reference does the trick and also can offer precise control over the length of caching required (if any) .

Read More

Walkthrough: using Windows 8 Custom Protocol Activation

Protocol activation, what is it? Well, when you run “http:{something}” you expect a browser to launch, right? When you type “mailto:{something}” you expect a mail client to launch, right? What if you could create “custom:{something}” that launched your app? That’s custom protocol activation!

Read More

Creating your own file format to import .FBX, .OBJ and .X in your Windows 8 modern UI game (or 3D engine)


There is a lot of different file format when it comes to 3D objects. One of the most used is the FBX from Autodesk. This file format can be exported by all major DCC but the key point is that it can be complex for a game or 3D developer to open such file format.

I would like to propose here a solution that can allows you to easily offline files importation. The idea is to simulate a MSBuild execution to reuse the importation process of the XNA pipeline.

Read More

The Windows Store App Lifecycle

The Windows Store App Lifecycle
Windows 8 is changing how and when applications run, and you’ll want to understand the nuances of the new application lifecycle so you can build apps that respond as they should at every point. Apps that conform to the Microsoft lifecycle management guidelines offer a better experience for the user, especially on small devices where memory and battery conservation are warranted.

Read More

Using the MVVM Pattern in Windows 8

Expression Blend for Windows Store Apps with Design-Time Data Using the MVVM Pattern in Windows 8
Any programmer with previous experience in any of the XAML-based frameworks has probably at least heard of the Model-View-ViewModel (MVVM) pattern. Some have been using it extensively in all of their Windows Presentation Foundation (WPF), Silverlight or Windows Phone applications. Others have avoided it, either because they misunderstand what the pattern does, exactly, or because they don’t want to add what they see as a new level of complexity to their application.

Read More
Download the Code Sample

Asynchronous Programming with Async and Await (C# and Visual Basic)


You can avoid performance bottlenecks and enhance the overall responsiveness of your application by using asynchronous programming. However, traditional techniques for writing asynchronous applications can be complicated, making them difficult to write, debug, and maintain.

Visual Studio 2012 introduces a simplified approach, async programming, that leverages asynchronous support in the .NET Framework 4.5 and the Windows Runtime. The compiler does the difficult work that the developer used to do, and your application retains a logical structure that resembles synchronous code. As a result, you get all the advantages of asynchronous programming with a fraction of the effort.

Read More

Tuesday 16 October 2012

Pizza Ordering Made Easy with Telerik RadControls for Metro - HTML

We all love pizza. I know that I do and several have speculated how it will be ordered in the future. Don’t take my word for it, check out the video above.

While it may seem strange that in the year 2015 people are using Windows 98 to order pizza, it may be more realistic to say they will be using Windows 8 instead. So, let’s build a Windows 8 HTML app using several new controls that are part of Telerik’s Windows 8 UI Controls that we have not seen yet. They include: RadDropDownList, RadSlider and RadGauge.

Read More

Callisto Dialog Helpers for Caliburn.Micro WinRT

Callisto Dialog Helpers for Caliburn.Micro WinRT
Callisto is excellent open source UI Control library for the Windows 8 Store apps. Caliburn.Micro is a powerful framework for building Windows Phone, Silverlight and Windows 8 Store apps. These helpers make it easies to combine Caliburn.Micro with the Callisto's dialogs.

Content
  • Helper for displaying settings dialogs on the Settings charm
  • Helper for displaying normal dialogs all around the screen
Read More
Get Library on CodePlex

Building a custom control using XAML and C#

Building a custom control using XAML and C#You may already know that one of the most powerful features of the Windows 8 XAML platform is the flexibility the platform provides to create custom controls. XAML provides features like Dependency Properties and Control Templates that make it easy to create feature-rich and customizable controls.

Read More

Converting TimeZones in Store/WinRT apps

For anyone who’s tried to convert a DateTime/DateTimeOffset to another time zone in a Windows Store style app, I’ve put together a helper class that uses some of the Win32 APIs that are allowed in Store apps.

In the code below, I’m converting all times to be Eastern time, but it can be easily adapted more generically. I’m calling the Win32 functions that take changes in daylight time into account, so it should be accurate for any supplied date.

Read More

Monday 15 October 2012

File Manipulation in Windows 8 Store Apps


File Manipulation in Windows 8 Store Apps
The IO Subsystem in WinRT has been written ground up to be completely async.In this article, we see how we can manage (Create and Update) binary data in Files using the Windows 8 runtime.

As we know now, Windows 8 Store Apps are a new category of desktop apps that are touch-centric and run on the new WinRT runtime on Windows 8. In this article, we see how we can manage (Create and Update) binary data in Files using the Windows 8 runtime.

Read More

Windows Runtime Components in a .NET World


The new type of program known as a Windows Store app—optimized to run on Windows 8 devices—has a default view with a full-screen window and no distracting chrome, so the content is the focal point. Windows Store apps support fluid layouts that adapt and scale to a variety of screen sizes and resolutions. They provide a touch-first experience while providing full support for the traditional keyboard and mouse.

Windows Store apps run on a new set of APIs called the Windows Runtime (WinRT). The Windows Runtime exposes components that are built as part of the Windows 8 OS along with third-party components you can develop yourself. Although some core Windows Runtime Components are accessible from desktop apps, third-party Windows Runtime Components are only available from within the Windows 8 environment. WinRT types are described using WinRT metadata files that have the .winmd extension. These files are encoded using the same standard the Microsoft .NET Framework uses for providing metadata definitions and semantics for classes, ECMA-335 (see bit.ly/sLILI).

Read More

Interacting with Windows 8 Maps app using WindowsMapsHelper library


Windows 8 is shipped with preinstalled Maps application. This app provides all basic mapping features such us showing current location, searching for place or local business and calculating driving directions. Even better, Maps app implements bingmaps protocol to allow 3rd party applications to activate these features. There is just one disadvantage of the protocol: it’s basically a URL string and all numerous parameters need to be properly formatted.

WindowsMapsHelper library aims to simplify communications with Maps app. It encapsulates maps protocol into a few strongly typed classes.

Read More
Source code at GitHub
NuGet Package Here

Sunday 14 October 2012

Walkthrough: Adding Text Translation to your Windows 8 App


Walkthrough: Adding Text Translation to your Windows 8 App
The Microsoft Translator is a powerful service that developers can leverage in their Windows 8 apps. It’s core functions are to detect the language of some text. To translate text from one language to another. And, to read text to you – that’s right! The API is hosted on Azure’s Data Marketplace. It has a pricing schedule, including a free tier that developers can leverage to develop with the API.

Read More

Using User-Provided Images for Secondary Tiles


Often when you are creating a secondary tile in Windows 8, it will be based on images coming from the internet. However a requirement of secondary tile images are that they need to be stored locally. I initially had some problems getting this working right and the streams closed correctly for this to work, so here’s the code for other to use and save the hazzle.

You can download the tile utility class and sample app here.
Read More 

Officially announcing MetroTwit for Windows 8, now available in the Windows Store

Officially announcing MetroTwit for Windows 8, now available in the Windows Store
The anticipated major update to MetroTwit for Windows 8 has just been certified and is now rolling out to Windows 8 users around the world for customer download. You can see the details in the Windows Store here.

Read More on MetroTwit Blog

Saturday 13 October 2012

How to call WinRT APIs in Windows 8 from C# Desktop Applications - WinRT Diagram


How to call WinRT APIs in Windows 8 from C# Desktop Applications - WinRT Diagram
I was trying to access some of the sensors that are built into this Intel Ultrabook that runs Windows 8. However, while there's support for Location Sensors built into the .NET 4 libraries on Windows 7 and up, I want to access the complete Sensor and Location Platform that is built into Windows 8 itself. Those APIs are available via COM and I could call them via COM, but calling them via the WinRT layer is so much nicer. Plus, this is kind of why WinRT exists.

This got me thinking about WinRT and what it means. I did a podcast a few months ago that really cleared things up but I've always found all the various diagrams that attempted to explain how things fit together WAY TO COMPLEX.

Read More

TypeScript for Windows 8 Store Apps


What is TypeScript?
See http://www.typescriptlang.org

TypeScript was recently released and has become the new hot topic.  One of the questions I have asked and heard is can we use this for developing Windows Store Applications with Javascript and have the cool features that have been shown in the videos and examples.

One of the great features was the split window feature where you can code in TypeScript on the left and upon hitting save, it compiles to Javascript on the left. So I fired up a new Javascript Windows Store project in Visual Studio to give it a shot to see if it all works.  Before we get started make sure that you have the following:

  • Windows 8 & VS2012
  • Download the plugin: http://go.microsoft.com/fwlink/?LinkID=266563
  • VS 2012 Web Essentials: http://visualstudiogallery.msdn.microsoft.com/07d54d12-7133-4e15-becb-6f451ea3bea6


Read More

Secondary tiles with text


The call to pin a secondary tile looks like this:

SecondaryTile(string tileId, string shortName, string displayName, string arguments, TileOptions tileOptions, Uri logoReference);

The important part for this post is the last parameter: Uri logoReference. This is the the path to the image you want to show on the tile – but I had a problem, I didn’t want to show an image! I just had some text I wanted to show on the tile. After a lot of digging the solution was non trivial – generate an image at runtime. This was made even harder as the Render method in WPF does not exist in the XAML implementation used in WinRT.

Read More

Tips for Dealing with New and Missing Windows 8 XAML Controls


Although the Windows 8 XAML platform brings back a lot of the controls that exist in WPF and Silverlight, and adds some completely new ones, there are some controls that you might find missing and wonder what to do. In this article we cover a list of some of these controls, along with some suggested ways to cope with their loss.

Calendar
DataGrid
DatePicker
DockPanel
Flyout
GridSplitter
InkCanvas
Menu
MultiScaleImage
NumericUpDown
TabControl/Pivot/Panorama
TreeView
Viewport3D, D3DImage, DrawingSurface
WrapPanel

Read More

Walkthrough: the Windows 8 Settings and About Dialogs

Walkthrough: the Windows 8 Settings and About DialogsWindows 8 is a new user experience. One of the best parts is a uniformity and consistency across applications to handle common tasks the same. Specifically, I mean the charms. Users search consistently. Users share consistently. And, users access settings, preferences, options, personalization, and about screens consistently.

In some applications, there’s a Preferences item under the File menu. In some applications, there is an Options item under the Tools menu. In some applications, there is a Personalization item under the Edit menu. What’s a user suppose to do? Well, hunt for it – that’s the way it used to be. Do you see the problem? Of course you do. You’re smart.

Read More

Saturday 6 October 2012

Simple AES (Symmetric Key) Encryption in WinRT

Symmetric key encryption, also called secret key encryption, requires that the key used for encryption also be used for decryption. You can use a SymmetricKeyAlgorithmProvider object to specify a symmetric algorithm and create or import a key. You can use static methods on the CryptographicEngine class to encrypt and decrypt data by using the algorithm and key.

Under normal circumstances on top of the encryption key used, you would need to send vector values which is used as the initialization vector. However, for a simple scenario (e.g. you want to send a password value from the client to the server or vice-versa, and you don’t want to do a post with clear-text). You wouldn’t go through the trouble of carrying the IV buffer to the client side as well.

Read More

WinRT/XAML Colour Picker (using SharpDx)

WinRT/XAML Colour Picker (using SharpDx)
I needed a colour picker for an app I’m building and it turns out no ones built a WinRT XAML one yet. So this is my very simple colour picker! I use bitmaps to represent the swatch (in my case i have 3 different types). I use SharpDx to get the “Pixel Buffer” of the selected swatch. Where ever the mouse or pointer is i get the pixel under that position via the pixel buffer and from that i get the colours (RGBA). This is what the colour picker looks like this.

Read More

AgFx.WinRT 1.0.0-experimental

AgFx is a data caching framework that makes it easy to build data-connected Windows Phone applications.

To install AgFx.WinRT, run the following command in the Package Manager Console

PM> Install-Package AgFx.WinRT -Pre




Check On NuGet Gallary

File system change notifications in WinRT

.NET framework for Windows 8 Store apps provides a subset of features included in full .NET framework profile. Microsoft excluded many APIs considered obsolete or unsafe. One of the removed classes is FileSystemWatcher, a class that proves its usefulness in applications intensively working with Windows file system. Instead, WinRT provides an alternative mechanism for folders monitoring based on queries.

Read More

Downloading files in Windows 8 apps using Background Transfer feature

In this blog post I am going to show how to use Background Transfer feature to download files over HTTP in a Windows Store C#/XAML app. Background Transfer has several advantages over using HttpClient and is much better for long running transfers. I am going to create a simple app, that initiates download over the Internet, tracks progress of the download and supports re-attaching transfers after the app is closed.

Read More

Simulating A Tab Control in a Windows 8 Application

I was looking through the forums on MSDN today and found someone asking how to implement a Tab Strip Control in Windows 8 Store applications.  They used the Store as an example, wanting functionality that behaves like the OverView, Details, Reviews section.

Currently there are no tab controls in Windows 8 and I haven’t seen any third party libraries implement one. I though I would put together  a quick post to show how you can get similar functionality using RadioButtons and the new FlipView control. I started with a blank application and added the following code to the MainPage.xaml.

Read More

Firefox Metro Preview for Windows 8

Today’s preview marks the beginning of Mozilla community testing for the Firefox Metro browser designed from the ground up for Windows 8.

Earlier this year, we began development on a version of Firefox that runs on x86 Windows 8. This version of Firefox runs in both the Windows 8 “classic Desktop” environment, and in the new “Metro” environment. We’ve made a lot of progress since that first development update. We’re excited to share it with you and we’re looking forward to your feedback.

Read More

Bing Maps SDKs for Windows Store Apps Now Available

Today we are announcing the availability of the Bing Maps SDKs for Windows Store apps. These SDKs will allow you to bring the power of Bing Maps to your Windows Store apps with support for C#, C++, Visual Basic and JavaScript based applications.

Please be aware that this release is the only version (1.1.20120927.0) of Bing Maps which will be supported for apps submitted to the Windows Store. If you are running any prior version (or BETA) you must upgrade and rebuild your app with this build to pass the Windows app Certification Kit (WACK) process. This process is required to submit all apps to the store and checks for the latest version of all dependencies to be approved. In most cases this should be as easy as downloading the latest version of the Bing Maps for Windows Store Apps API and recompiling your app.

Read More

The HealthVault Windows 8 SDK is now available

The HealthVault Windows 8 SDK is now available
HealthVault is the single repository of your entire medical life – across doctors, clinics, and years. HealthVault is a secure repository for you and your family’s medical and fitness data. It can be, at your control, shared with health providers or anyone you trust – but only if you want to. It can be integrated into applications and technology.

The library is for both JavaScript and C# applications.

Read More

How to check if a file exists in Windows 8

Sometimes things are simple, sometimes they aren't when you think they should be. One such thing in Windows 8 development is checking if a file exists...

In a Windows 8 app (be it C# or JavaScript) you work with the StorageFolder. Since we are sandboxed and don't really have file-system access we don't have the System.IO namespace as we're use to meaning we have an entirely new set of APIs for reading a writing files (although it's nice that they are built around being asynchronous). The fun thing about StorageFolder is it has no method like FileExistsAsync. Yep, there's no API which will allow you to work out whether a file exists or not.

Read More

Thursday 4 October 2012

Creating a Direct2D game for WinRT

Creating a Direct2D game for WinRT
If you want to write a game for Windows 8 and was thinking of using XNA, think again. When creating games for Windows 8 you’ll have to go back to using DirectX. But don’t worry, with Visual Studio 2012 on Windows 8, you’ll get a lot of help doing so. Let’s have a look on how to create a Direct2D game for WinRT!

Read More

Modern UI Data Visualization Toolkit

Project Overview :
The main perpose for this is to build a set of reusable controls for Windows 8 Modern UI Development The Primary Release will contain the PieChart that I developed earlier on http://blogs.msdn.com/b/metroapps

Main Controls
- Pie Chart
- ColumnChart
- Line Chart

With support of Multi Series and Stacked Charts

Samples in Action:
http://download-codeplex.sec.s-msft.com/Download?ProjectName=modernuitoolkit&DownloadId=491376

Read More on CodePlex

Enhancing the Win8 Slider experience

Enhancing the Win8 Slider experience
This article describes a way to enhance the user friendliness of a standard slider control in a Windows 8 Store App. Problem in a touch oriented application, we often allow -or force- the user to set the value for an integer or an enumeration through a slider control. In most cases this is more comfortable and less error prone than working with the soft keyboard. Unfortunately it’s not always ideal: if the range of values becomes too huge, or the slider becomes too narrow (e.g. when in portrait or snapped mode), then it becomes too difficult for the user to position the slider at the correct value. In this scenario, a textbox is a much more appropriate input control. This article proposes a UX design –and implementation- that offers the best of both worlds, and lets the end user decide on it.

Read More

Using OAuth 2 in WinRT using C#: it has never been easier before

Using OAuth 2 in WinRT using C#: it has never been easier before
WinRT has a built-in authentication client that can be used to authenticate users through Facebook, Twitter, Flickr, Google, etc. This post covers the process of authenticating users with Google. Architecture Before I start explaining how the OAuth process work, I'd like to talk about the architecture. While it's possible to write inline OAuth code in the code-behind of your View, I personally find it a nice and clean way to create an 'OAuth2Service' class for this. In this class we can place methods to request tokens, and that kind of stuff. We can then inject this 'service' into our View or ViewModel, or any other class.

Read More

Using Live SDK in Windows 8 – C#

Live SDK provides a set of controls and APIs that enable applications to integrate single sign-on (SSO) with Microsoft accounts and access information from SkyDrive, Hotmail, and Windows Live Messenger on Windows Phone and Windows 8.

Live SDK support several platforms such as: iOS, Android and of course Windows Phone and Windows 8 applications using C# and JS.

In this demo I’ll show how to use Live SDK with Windows 8

Read More

BootMetro – Web Framework For Metro-Style Websites

BootMetro – Web Framework For Metro-Style Websites
We probably all know Twitter Bootstrap, the exciting, feature-rich framework (by Twitter) for easily/quickly building websites. BootMetro is another one, which is built on top of Twitter Bootstrap, for creating Metro/Windows 8-styled websites.

Compatibility: All Major Browsers
Website: http://aozora.github.com/bootmetro/
Demo: http://aozora.github.com/bootmetro/hub.html
Download: https://github.com/aozora/bootmetro

Thursday 27 September 2012

Metro: Creating an IndexedDbDataSource for WinJS


The goal of this blog entry is to describe how you can create custom data sources which you can use with the controls in the WinJS library. In particular, I explain how you can create an IndexedDbDataSource which you can use to store and retrieve data from an IndexedDB database.
If you want to skip ahead, and ignore all of the fascinating content in-between, I’ve included the complete code for the IndexedDbDataSource at the very bottom of this blog entry.

Read More 

Windows 8 RTM JavaScript–Change Lock Screen Image


Windows 8 RTM JavaScript–Change Lock Screen Image
In the past couple of months I’ve worked a lot with Windows 8 JavaScript and C#, I’ve also wrote plenty of posts on that subject and there is much more stuff to talk about.

In this post I’ll show two things:

  • Using File Picker using JavaScript
  • Change Windows 8 Lock Screen Image Programmatically


Read More

Using IndexedDB in your Windows 8 Game

Using IndexedDB in your Windows 8 Game
As I was pulling together my previous post on notifications in an HTML 5 game on Windows 8, I couldn’t help but think there must be a better way to handle the storage of the local leaderboard. If you’re not familiar with that sample, it’s a simple game where you see how many times you can touch a bouncing ball before it hits the boundaries of the display ten times.

Read More

Windows 8–Connecting to SkyDrive


Windows 8–Connecting to SkyDrive
I wrote my first Windows 8 code which connected to SkyDrive the other day so I thought I’d share in case it helps anyone who’s doing a similar thing. The main documentation set for Live is on the web so drop that into your favourites if you’re going to be working with this API set. Simple example – let’s say that I want to grab some pictures from my local machine and upload them to a particular folder on my SkyDrive. I’ll start with a blank project.

Read More

Location Awareness in about 2 minutes with Windows 8–HTML


Location Awareness in about 2 minutes with Windows 8–HTMLI was working on a mapping application for Windows 8 – HTML using the Bing SDK and needed to pass the latitude and longitude into it. I began searching for a straightforward way to get the location and had to read through pages of documentation before finally finding it. Here it is in case you want to use it in your own apps.

Read More

Useful Value Converters For WinRT Development


Value converters are a really useful part of the xaml binding infrastructure, they work in Windows Phone 7, Silverlight and WPF. As we work on more and more projects in this space we build up a library of useful value converters. I'd like to illustrate some of the ones I use here.

  • Bitmap Image Converter
  • Boolean To Visibility Converter
  • Colour To Brush Converter
  • Simple Type Converter
  • String Format Converter


Read More

Windows Store: Two-thousand, seventy-nine


Windows Store: Two-thousand, seventy-nine
Milestones. Every one counts. Sure, the iOS app store has considerably more apps than the Windows Store today – that’s not news.

But developers are adding to the Windows Store every day – and though some apps are removed from the store periodically, the number that grows every day. Today, the Windows Store broke the 2000 app mark and arrived at 2,079 apps available internationally.

Read More

Wednesday 26 September 2012

AdRotator for Windows 8


AdRotator for Windows 8
As battles go this was certainly one of the strangest.  Windows 8 introduces so many different ways of working, some expected and welcome, some not so.

One of the biggest unexpected challenges is that libraries and packages can not longer distribute User Controls as part of a separate dll or class library, if it’s another project in the same solution that’s fine but if you want to distribute a control such as AdRotator this presents a bit of a problem.

Read More

Tuesday 25 September 2012

How to Write a WinJS Custom Control


How to Write a WinJS Custom Control
Lately, I was involved in a few Windows 8 projects. One of the questions that I am being asked from time to time was how to write your own Windows Store app custom control with WinJS library. This post will try to give you a head start for your custom control library. During the post you will build an autocomplete control step by step and learn a few WinJS concepts on the way. So let get started.

Read More

Windows 8 Apps: Change your project to run PlayReady successfully


Today I wasted a lot of time to understand why, the code I wrote to implement PlayReady in a Windows 8 App didn’t work. I have ran the code lot of times, making changes to handle obscure hypothesis, just because my application was failing to load a DRM protected stream. When I finally found the error code issued by the MediaFailed event I went on the right way:

Read More

Windows 8: Windows Store apps - JavaScript passing data to the code containing the WebView control


Over the past few weeks, in my spare time, I've been working on building a Windows Store app that will wrap an HTML web app that I've built. To use the web app, you enter a token in a textbox on the welcome page and then click the Verify button. If the token is valid, a URI is given to the user which can then be used for the tracking of one's time using the start/stop timer view in the web app.

Read More

DESIGNING RETRO LOOKING GAMES FOR WINDOWS 8


DESIGNING RETRO LOOKING GAMES FOR WINDOWS 8
When people talk about “retro” games, they usually refer to most games made for the 1st to 4th generation of gaming consoles. The hallmark of these games are their pixelated visuals and approachable yet challenging game mechanics. I was a huge fan of these games growing up, so most of the ones I make today emulate the visual style and gameplay from this era in gaming history. I wanted to highlight some features of these games and talk about how to recreate them when making your own HTML5 games for Windows 8. Since canvas is perfect for rendering 2D graphics, making a retro-looking game is easy to accomplish and works well on almost any hardware. First, we need to talk about picking an art style.

Read More

Windows 8–Search Suggestions in Charm bar


I recently started a series of postings from my tour of presentations in Europe and the UK.  Today I’d like to return to Searching (which I started to cover here), and this time take a look at what it takes to have your application offer Search suggestions as the user types into the Search box.

To examine this, we’ll create a Windows 8 application with the suggestions hard coded, but you can just as easily obtain the suggestions from a web service, or database, etc.

Read More

Building a project skeleton, using CSS3 layout and styling WinJS controls #Win8Dev


This past week was spent turning wireframes and workflows into a moving prototype using static data. Not only does this action of sketching out the project inform architecture, but it also allows us to create the placeholders once we get the visual design.

As a bonus, a short screen cap of the prototype can be a valuable asset while the app concept is still forming in our heads.

Read More

Thursday 20 September 2012

Ways You can Leverage Share Contracts in your Windows Store Game


Ways You can Leverage Share Contracts in your Windows Store Game
One of the great new features available to developers creating Windows Store games is the Share Contract. The Share Contract, or sharing, provides an easy way for you to share data from your game to other applications the user has on their system.

Why is sharing useful? Games are, by their nature, social. Perhaps you are starting to play a game of Ultimate Zombie Battles and you want to let your friends know you are playing so they can come join you. You may want to let the world know that you just achieved a personal high score on Find the Chicken. Or better yet, you just downloaded a new game and you think it is so cool, you want to let your friend and family know about it so they can play it too.

Read More

Ways You Can Use the Search Contract in Your Windows Game


Ways You Can Use the Search Contract in Your Windows Game
The Search contract is a way you can integrate the Windows 8 search experience into your game. Windows 8 provides a Search feature that is enabled via the Charm bar (shown at right). The Charm bar is activated by a user swiping from the right edge of the screen with a finger, or by either a mouse or keyboard action (mouse to the upper right corner of the screen or Windows+C ). From the Charm bar, the user can select the Search charm and enter the default Search experience.

Read More

What is the difference between a company vs. individual account for the Windows Store?

When you register to develop apps for the Windows Store, you have the option to register for a company or an individual account.  What are the major differences between them?

Read More

Standard AppBarButton Styles Revealed For Windows 8 RTM


Standard AppBarButton Styles Revealed For Windows 8 RTM
As much for my own benefit as anyone else’s here are the icons that all exist within the “Segio UI Symbol” Font referenced in the Standard Styles XAML fragment of every new project.  (They should form the basis for any icon appearing in the Application Bar)

With thanks to Long Zheng for providing source code for easily  rendering the icons:
Read More

How to measure rendered string dimensions in #Win8Dev


While Windows 8 WinRT supports ViewBox control (its a control that allows text to auto resize depending upon available space), with my alarm clock app, I noticed substantial jittering (and resizing) as time changes between seconds. Of course you don’t want that happening.

Read More

Getting started with SQLite in Windows Store / WinRT apps


Getting started with SQLite in Windows Store / WinRT apps
In this blog post I will expand the blog post by Tim Heuer  to include information on how to include and access a pre-populated SQLite database file, maybe even a file created by migrating from a SQL Server Compact database file, as I blogged about recently.

First, download the "SQLite for Windows Runtime" Extension via Tools/Extensions and Updates/Online. Restart Visual Studio.

Then add references to the SQLite and C++ extensions as described by Tim Heuer. Remember to change the Build Configuration to either x64 or x86 in Configuration Manager.

Read More

Video Tutorial : Creating Windows 8 Metro App to work with Picture Library (WinRT, XAML and C# )


Some time back, I created a small Windows 8 Metro Application (Windows Store App) which can access the Windows Picture Library and display thumbnails of all the pictures available in it. This post should be of a little help for developers who just started exploring Metro Apps for Windows 8.

Read More

Tuesday 18 September 2012

How to draw driving route direction with Bing maps in C#/XAML Windows 8 app


How to draw driving route direction with Bing maps in C#/XAML Windows 8 app
In one of my app, I have to give feature of drawing route direction with Bing maps. I found an example in JavaScript, but I want the same in C#/XAML. So Richard Brundritt helped me by providing the Bing Maps REST Service helper class, with that I managed to do it. Here I am posting the code. All REST links URL Templates cam be found here. Thanks to Richard Brundritt :)

protected async override void OnNavigatedTo(NavigationEventArgs e)
{
    Uri geocodeRequest = new Uri("http://dev.virtualearth.net/REST/V1/Routes/Driving?o=json&wp.0=28.608280181884766,77.200813293457031&wp.1=19.072799682617188,72.882598876953125&optmz=distance&rpo=Points&key=YOUR_BING_MAP_KEY_HERE"); //Route Ahmedabad to Mumbai

    //Make a request and get the response
    BingMapsRESTService.Response r = await GetResponse(geocodeRequest);

    MapPolyline routeLine = new MapPolyline();
    routeLine.Locations = new LocationCollection();
    routeLine.Color = Colors.Blue;
    routeLine.Width = 5.0;

    int bound = ((BingMapsRESTService.Route)(r.ResourceSets[0].Resources[0])).RoutePath.Line.Coordinates.GetUpperBound(0);
    for (int i = 0; i < bound; i++)
    {
        routeLine.Locations.Add(new Location
        {
            Latitude = ((BingMapsRESTService.Route)(r.ResourceSets[0].Resources[0])).RoutePath.Line.Coordinates[i][0],
            Longitude = ((BingMapsRESTService.Route)(r.ResourceSets[0].Resources[0])).RoutePath.Line.Coordinates[i][1]
        });
    }
    MapShapeLayer shapeLayer = new MapShapeLayer();
    shapeLayer.Shapes.Add(routeLine);
    MyMap.ShapeLayers.Add(shapeLayer);
}


private async Task<Response> GetResponse(Uri uri)
{
    System.Net.Http.HttpClient client = new System.Net.Http.HttpClient();
    var response = await client.GetAsync(uri);
    using (var stream = await response.Content.ReadAsStreamAsync())
    {
        DataContractJsonSerializer ser = new DataContractJsonSerializer(typeof(Response));
        return ser.ReadObject(stream) as Response;
    }
}


Monday 17 September 2012

Data Presentation In HTML5/WinJS Metro App


Data Presentation In HTML5/WinJS Metro App
Inevitably, you’re going to have to make a choice about what control underlies this presentation of data, and eventually you’re going to have to implement it.

In this post, I’d like to do a little bit of a study into what control to choose when and why. As usual, I’ll be coming from an HTML/JS perspective, so if you’re wondering what your options are in XAML, Bing is your friend.

Read More

Creating an inline AppBar Button Style for your Win8 apps


Creating an inline AppBar Button Style for your Win8 apps
As you have probably read, the Metro Windows Store projects in Visual Studio now comes preloaded with a ton of styles for your AppBar. I love this style of button. You get the nice icon and text to indicate what the icon is supposed to mean (sometimes the icon can be confusing). Having both the icon and the text removes the need for users to hover over an icon to see what it’s suppose to be.

As awesome as the style is for buttons on the AppBar, they do have some limitations. They are big, and the text is on the bottom. This design makes it hard to put this style of icon in other parts of your app. Take a look at the Games app. Go all the way to the left and you’ll see your avatar along with ways to do more with your Xbox account. You accomplish these actions with buttons that look a lot like the AppBar buttons.

Read More

Authenticating an ASMX Web Service in SharePoint from a WinRT app


Where’s the CookieContainer?

Yes mate, I’ve had that question too.

We are creating a new application for Windows 8 and we need it to connect to our web services. Connecting to the anonymous methods was easy, but when it comes to authenticating the user the situation changes.

Read More

MetroLog - A lightweight logging system designed specifically for Windows Store and Windows Phone 8 apps


MetroLog is a lightweight logging framework designed for Windows Store and Windows Phone 8 apps. Although the API is based on NLog and log4net, the intention is that it's a very basic logging system.

The need for it to be basic comes from the fact that the Windows Store apps API surface area intentionally limited for very specific applications. This project came out of the fact that porting NLog to Windows Store apps is difficult because of it's incredibly rich feature set, most of which is not workable in Windows Store apps.

Read More

Sunday 16 September 2012

Windows 8, XAML and Displaying Multiple Sized Items

One of the common layouts that you see in Windows Store applications is one that looks a little like the one below.
Windows 8, XAML and Displaying Multiple Sized Items


Want to get like this UI for your app, read more here

Referring to Package Files

When you’re working with a Windows 8 project in VS2012, you have some number of project files in your Solution Explorer. You have HTML files, CSS files, JavaScript files, images, and perhaps some XML or JSON or TXT files - something like that.

If, in the course of executing logic in your app, you need to access these files, there are a number of ways and you should know when you might use what and why… that’s as opposed to being incapacitated or stabbing in the dark.

Read More

Parsing CSV Files in WinRT

I am proud to announce that my CSV Parser for Windows RT is now available on MSDN Code Samples. Creating a CSV parser sounds like an easy task, but it’s the developer equivalent to quick sand. CSV stands for Comma Separted Values and, despite the name, the files in this "format" are often not fields separated by commas. Often, tabs or pipe characters are used instead. Additionally, parsing a CSV file is not as straightforward as it seems. One would think that it would be as simple as splitting the raw text first by line to get the records and then by delimiter to extract the fields.

Read More

Inspecting local and roaming settings for Windows 8 Store app

Inspecting local and roaming settings for Windows 8 Store app
ApplicationDataContainer class supports saving of complex hierarchies of local and roaming settings. Sometimes there is a need to verify saved values but unfortunately Windows 8 development toolset doesn’t include any settings inspector. This post describes a method for inspecting settings manually.

Application settings are stored in C:\Users\<user_name>\AppData\Local\Packages\<package>\Settings\settings.dat. settings.dat is a Windows NT registry file (REGF) and includes local and roaming settings. This file format, REGF, also known as Registry Hive File, is supported by Registry Editor.

To open settings file, close your app and open Registry Editor. Than select HKEY_LOCAL_MACHINE or HKEY_USER and open Load Hive dialog from File menu.

Read More

NFC on the Windows 8 Platform

NFC on the Windows 8 PlatformThe Proximity APIs enable you to create NFC apps for the Windows 8 platform. Designed to be easy to use and streamlined for the most common use cases, the APIs allow integrating powerful features into your apps in a very short time.

At the NFC Congress in Hagenberg, Austria, we’ve just presented the first overview of those APIs during our Developer Workshop that was opening the conference.

Read More

WrapPanel for Windows 8 WinRT

Out of the box, there's no WrapPanel available for WinRT. There's the VariableSizedWrapGrid, which you can use. But it doesn't work well with items that have different sized. Each item in the grid gets sizes based on the dimensions of the first item. You can see this behaviour in action here:

Searching for a good WrapPanel, I found one for Silverlight 2. Silverlight 2 did not have a native WrapPanel, so an open source WrapPanel was created by "Ineir":

Read More

Saturday 15 September 2012

Windows 8: Windows Store apps and the WebView control


I recently started looking into creating a simple Windows 8, Windows Store app, that would contain a browser window and a setting somewhere to allow the URI to be modified.

The app itself is quite simple in concept so I figured it would be a breeze to implement for Windows 8.

To display a web page I needed to use a WebView control and I simply set the Source property to the desired Uri.

Read More

Friday 14 September 2012

No more SkyDrive file type restrictions

As more and more developers have been building Windows 8 apps, they've appreciated the Windows 8 file picker integration with SkyDrive and wanted us to similarly make it simple to integrate a SkyDrive file picker with their websites.

Based on this feedback, we recently released an update for the SkyDrive developer experience to
  1. Remove all API restrictions related to photo resolution and content types
  2. Provide a new, easy-to-use file picker API for websites (similar to our file picker for Windows 8 apps)

We're seeing many apps take advantage of these updates to unlock new possibilities.

Read more

Telerik Windows 8 UI Controls Release Candidate – Build Windows Store-Ready Apps at No Cost

Telerik Windows 8 UI Controls Release Candidate – Build Windows Store-Ready Apps at No Cost
Today we are pleased to announce the Release Candidate of Telerik UI Controls for Windows 8 development. One of the highlights of the release is the addition of two new controls, Pagination  and HubTile, for both HTML and XAML environments. In addition, the suite gets improvements such as Design-time support for XAML and numerous performance enhancements.

With this version of the suite (as well as with the previous Beta) you can build Windows store-ready apps at no cost. Hurry up, get your app to the store first; being first has huge advantages! There are already a number of certified apps on the Windows Store using the Telerik Windows 8 controls.

Read More

Building Office for Windows RT

Building Office for Windows RT
Editor’s note: Earlier this year, Steven Sinofsky announced Windows support for ARM processors (Windows on ARM or WOA). His post on the Building Windows 8 blog included the following news about Office:

    “WOA includes desktop versions of the new Microsoft Word, Excel, PowerPoint, and OneNote. These new Office applications, codenamed “Office 15”, have been significantly architected for both touch and minimized power/resource consumption, while also being fully-featured for consumers and providing complete document compatibility.”

In the months since that announcement, there has been a great deal of speculation about what we are delivering. David Brodsky, Partner Test Manager and Josh Pollock, Principal Development Manager join Office Next to walk you through what Office for Windows RT is and why it exists; specific optimizations we’ve made (and why most of those will benefit you on other platforms too); what wasn’t possible and the functionality differences that resulted; and finally how to get Office Home & Student 2013 RT.

Read More

Windows 8: Binding a ProgressBar to a long running Task

A really common scenario in a Windows 8 / WinRT app (or any app) is to load data from the web or do some other action that takes a while to complete. While loading our data, we also have to update the UI to show some sort of loader so the user knows a bunch of data is being loaded.

With Windows 8 and the Async / Task model it's really easy to do asynchronous task on another thread and not block the UI. But how do we show the user what's going on with the long running task?

Read More

Adding and Editing WinRT Behaviors with Blend

I am a huuuuuuge fan of Behaviors (and Actions and Triggers) for Silverlight and WPF. I have been very disappointed when WinRT turned out not to support them.

Luckily, Joost Von Schalk created WinRTBehaviors on CodePlex (also available on NuGet). But his solution still lacks any Blend support. I have not been able to reproduce the full Blend behavior editing experience, but I managed to take the first baby-step that at least saves you from creating Behaviors from code.

Read More

Windows 8 Colors (HEX code)

Windows 8 Colors (HEX code)
In my own projects I really like to have correct colors. With Windows 8 coming out, more and more of my projects are around Windows 8. I’m not much of a designer, but sometimes I like to play pretend. I was able to grab these colors from Windows 8 RTM. I’m only including the HEX code because RGB would have been a pain to copy from the programs I use. If you need RGB, there are lots of HEX to RGB color converters online. I hope you find these useful!.

Read More

Building Data and Services for Windows 8 Apps


In this post, I'm going to kick off a series in which I'll walk through the creation of a back-end service for a Windows 8 app. This first post will provide an overview of the series, and introduce a couple of potential technologies you can use to build your back-end services.

The Challenge
As an example of a scenario that might merit a nicely abstracted back-end service, I'm going to create a simple leaderboard service that can store and retrieve high scores and win/loss/tie stats for a variety of games. Since it's where I've spent the majority of my time lately, I'm going to focus on games built with HTML and Javascript, but the platform choices I'm going to describe will work just as well for games and apps build with C# or VB and XAML..

Read More

Thursday 13 September 2012

Integrating your cloud service with the file picker contracts


Integrating your cloud service with the file picker contracts
In the past, users organized, shared, and maintained their documents, photos, videos, and music on the local PC. But the cloud is quickly providing users with much richer ways to access, experience, and manage the files they care about. Windows 8 embraces these new scenarios by allowing you to deeply integrate cloud services directly into your apps to create completely new experiences that were not possible before.

You can see many of these scenarios highlighted in the SkyDrive app which uses the file picker contracts. The file picker contracts are designed to make user’s documents, photos, videos, & music stored in your app available to all other Windows 8 apps. In this post, we use the SkyDrive app (which implements all three of the file picker contracts as introduced in Connecting your apps, files, PCs and devices to the cloud with SkyDrive and Windows 8) to show you:

Read More

Searching in Windows 8 Thorough Charm Bar


Searching in Windows 8 Thorough Charm Bar
Windows 8 Store Applications can take advantage of the shared “Charms” that you see when you swipe in from the right edge of your Windows 8 device (or press Win-C).  The top charm is searching and it provides tremendous functionality at relatively little programming effort.

When you click search Windows 8 assumes you want to search the current application if that application has registered a Search “contract.”  If it has not, Windows 8 will assume you want to search the applications, as shown in the figure (click on the figure for full size).

Read More

Code Snippets for Windows Store Apps


In partnership with the Visual Studio team, we are launching Code Snippets for Windows Store apps, a collection of around 60 IntelliSense Code Snippets for common Windows Store app programming tasks. The snippets are available for Visual Basic, C#, C++, and JavaScript developers.

For example, if you don’t know how to copy a file in JavaScript or C++, just right-click, select Insert Snippet, select the code snippet, and it will automatically add the code to your Windows app as shown in the screenshots below.

Read More

How to market yourself with your windows 8 app quickly


This article was inspired by a prominent Silverlight MVP and evangelist Kunal Chowdhury who wrote a nice little post on how to market your WP app better – http://bit.ly/SDtMd0

So seeing this I couldn’t help to quickly morph his article to fit Windows 8, what becomes obvious as you compare the two is that there are so many things that are just basically easier with Windows Phone, hopefully the Windows 8 API will mature more over the coming months. (will be even more interesting when the WP8 SDK is revealed if they have stayed true to their roots or move to a more Win 8 route # shudder)

Read More

Exporting an image from a DirectX 2D Image in Windows 8 C#/XAML Using SharpDX

I’m working on a Windows 8 app which has a drawing element to it. The original WP7 app in Silverlight was fine because a simple drawing rendered in XAML was captured using WritableBitmap.Render and written to a file stream. This feature is missing from the Windows 8 API, so it’s impossible to write a pure C#/XAML app which can export a user created image. To get round this it’s possible to use DirectX/XAML/C++ to create a XAML UI which can draw DirectX images.

Read More

Wednesday 12 September 2012

5 points developers should know about WinRT/Windows 8

5 points developers should know about WinRT/Windows 8
Most of us already started developing for WinRT, so it make sense to have a better understanding of the run time. I am listing down few points with respect to WinRT, mainly from a developer’s perspective.

Read those 5 points here

Getting started with Metro Elements: Chart controls

Getting started with Metro Elements: Chart controls
Not long ago we released the beta version of Metro Elements – a suite of controls for WinRT. Currently we provide a set of powerful charting controls and a date-time picker with flexible formatting. We also have many more controls currently under development which will be released throughout the next couple of months. In this blog post I’m going to walk you though getting started with using Metro Elements. In particular, we will look at adding a couple of charts to an application and populate them with data. If you would like to follow along but don’t have the beta yet, you can download it for free from here.

Read More

Create an Appointment Tracking App with RadDatePicker & RadTimePicker

Create an Appointment Tracking App with RadDatePicker & RadTimePicker
We all have a variety of uses for collecting Date and Time information from a user. For example, tracking the time a patient arrives and departs from a hospital, to when a car was returned at a local car rental location to tracking expense reports. One of the controls that you may have found missing with Windows 8 XAML applications is the Date/Time Picker control. While the control exists for Windows 8 HTML Applications, it is very limited in its initial state. That is one of the reasons that Telerik has decided to make a more robust Date/Time Picker control and in this blog post we will explain how to use it in a simple app that keeps track of important appointments. So buckle up and let’s get started.

Read More

Using WinJS & WinRT to build a fun HTML5 Camera Application for Windows 8 (2/4)

using WinJS & WinRT to build a fun HTML5 Camera Application for Windows 8 (2/4)
Using WinJS & WinRT to build a fun HTML5 Camera Application for Windows 8 (1/4)

In this second tutorial, we’re going to add support for video recording. The first step will then to work on the UI to let the user choosing between photo & video mode. Then we will add the JavaScript code that will let you recording some videos. Finally, we will add a cool slide effect with CSS3 animations to provide a visual feedback to the user while taking some photos/videos. As a reminder, this tutorial is part of this series:

Read More
Web Informer Button