Archive for Software

Fin, A New Windows Phone App

Just a small post to announce the release of an app i have been working on for a little while.

An important part of my job requires me to record how much time I spend on tasks. I used to store this information in a Word document which wasn’t practical especially if I was out of the office.

May I introduce Fin. Fin is a time-sheet application that allows you to record the time spent on a task. All the information is stored in the cloud so you can access your data no matter what device you’re on.

Large-Tile

You can download Fin here

I hope to update Fin frequently as well as develop a Windows 8 client. If you have any suggestions just leave a review on the Windows Store or leave a comment here.

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.

 

 

Windows 8 – Adding a Share Contract to your App in C#

I’ve finally started playing around with Windows 8 after spending ages getting it to work in VirtualBox. I struggled to find any sample code / tutorials on adding a share contract in C# so here is my guide.

 

First things first we need to add a import statement:

Using Windows.ApplicationModel.DataTransfer;

 

Next up we need to fetch a DataTransferManager and then associate a method with the DataRequested event. I placed this code in the constructor of the MainPage.xaml.cs.

DataTransferManager manager = DataTransferManager.GetForCurrentView();
manager.DataRequested += new TypedEventHandler(share_DataRequested);

 

Now we need to create the share_DataRequested Method that’s called when a share request is made.

private void share_DataRequested(object sender, DataRequestedEventArgs e)
{
    DataRequest request = e.Request;
    request.Data.Properties.Title = "Sharing something";
    request.Data.Properties.Describtion = "Sharing something with someone";
    request.Data.setText("I'm sharing!");

}

 

The method above is where you tell Windows what data your app wants to share. The example above shows the sharing of a simple string saying “I’m sharing”. The picture below shows how the message will apear once the user select a Share compatible App to share with. On the Enterprise Edition you can only share using Mail by default so you may need to download some other Apps to test the sharing.

 

Your App now makes use of a share contract! If you want to manually launch the Share Contract UI for the user you can use the following code:

DataTransferManager.ShowShareUI();

 

Which will bring up the below UI.