Can Of Code

Tag Archives: Windows Phone

Increasing the touch area of a Rectangle in XAML

I have been recently working on a Windows Phone project that required a small item to be dragged across the screen.

It was soon discovered that while it worked nicely on the emulator using the precise mouse it wasn’t so easy to use when using my chubby fingers on a REAL device.

The element i was working with was a Rectangle, so after some playing i discovered that creating a large “invisible” stroke around the rectangle would fit the task.

To achieve this i created the rectangle as shown:

 <Rectangle Fill="#FFF4F4F5" Height="270" Width="270"  Stroke="#00FF0000"   StrokeThickness="120" />


This XAML creates an invisible hit area of 120 each side of the rectangle using the stroke property therefore creating a rectangle of 30 x 30. The stroke is invisible by using a color with 0% alpha.



Posted in Windows Phone, WPF | Tagged , , , | 1 Comment

Windows Phone Emulator Locations Map Issue

The last few days I have been getting a blank screen when trying to create mock locations in the Windows Phone emulator. After searching I found I wasn’t the only one with various forum threads dedicated to the issue.

Windows Phone emulator showing a blank screen instead of the map.


If anyone else is suffering with this problem, a temp fix has been posted by Microsoft which worked for me.

To work around the problem by adding a Browser Emulation mode entry for XDETools.exe in the registry.
caution: The side-effects of this work-around are unknown.  (… I have only done ad-hoc tests to verify it works.)

On 64 bit Windows use:

Windows Registry Editor Version 5.00

on 32 bit Windows use:

Windows Registry Editor Version 5.00

You can either enter the values manually using the registry editor (regedit.exe) or save the content to a text file with the extension “.reg” and import the file into your registry.  ex: by double clicking on the file in the file explorer or choosing File -> Import… from the menu inside regedit.exe.

And of course, the standard cautions regarding use or the registry editor apply:
Before you edit the registry, make sure you understand how to restore it if a problem occurs. For information about how to do this, view the “Restoring the Registry” Help topic in Regedit.exe.

WARNING: Using Registry Editor incorrectly can cause serious problems that may require you to reinstall your operating system. Microsoft cannot guarantee that problems resulting from the incorrect use of Registry Editor can be solved. UseRegistry Editor at your own risk. For information about how to edit the registry, view the “Changing Keys and Values” Help topic in Registry Editor (Regedit.exe) or the “Add and Delete Information in the Registry”.

Posted in Software | Tagged , , | Leave a comment