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
Web Informer Button