Speaking numbers app: current incarnation

I spent most of yesterday’s coding time on the UI. This is how it currently looks in various states:

wp_ss_20141030_0002 wp_ss_20141030_0003 wp_ss_20141030_0004

The major irritant right now for a user is that the focus doesn’t go to the textbox after pressing Go. It is bound, and it does the part of the bound code that deletes the current entry, so I hope something simple that I have simply missed.

Later… the options I looked at for some time just didn’t work for me. Found a much simpler approach, thanks to this person. That’s not to say this approach is discredited, but I just struggled to see how it could achieve what I needed.

This is how the UI is now looking:

wp_ss_20141031_0006 wp_ss_20141031_0005 wp_ss_20141031_0004  wp_ss_20141031_0001




Windows Phone: Numeric keypad

There are doubtless better ways to do this, but given a requirement of a) just integers, b) big buttons, then this is my current thinking:


This achieves that reasonably, where the Height 1* is the Click… and the 5* is the numbers…


and then the numbers…


codeForkp02You may well be looking at the repeating Border elements, and asking why that isn’t in a template / style. Well, it will be in a bit, but I had been taking to using Blend to these kinds of templating. But it let me down on this one. We’ll check this in, and give it a shot after that.


Ha, I’ve been wasting my time. Take a look

Basic Windows Phone 8.1 template

For days when I just want to bang in my own basic template, this is to remind me, including spacing and the point about not specifying specific pixel sizes.

    Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
            <RowDefinition Height="1*"/>
            <RowDefinition Height="5*"/>
        <Grid Row="0">
            <StackPanel Grid.Row="0" Margin="19,0,0,0">
                <TextBlock x:Uid="Header" Text="MY APPLICATION" Style="{ThemeResource TitleTextBlockStyle}" Margin="12,0,12,0"/>
                <TextBlock Text="The bit underneath" Style="{ThemeResource ControlHeaderTextBlockStyle}" Margin="12,0,12,0"
               CharacterSpacing="{ThemeResource PivotHeaderItemCharacterSpacing}" />
        <Grid Row="1">
                <RowDefinition Height="1*"/>
                <RowDefinition Height="2*"/>
                <RowDefinition Height="3*"/>

<Rectangle Fill=”Red” Grid.Row=”0″/>
<Rectangle Fill=”Blue” Grid.Row=”1″/>
<Rectangle Fill=”Green” Grid.Row=”2″/>


The reason for this playing is that in my “real” app, I am struggling to get the controls to fill, dynamically, the available width.. As ever, reducing things to a simpler example helps to focus the mind. My next play is to get proportional sizing with 1 of the rows. Thus:



Notice the absence of StackPanel usage: I tried these, which are normally my goto grid thing, but for whatever reason they were not displaying as I expected.






<Grid Row="1">
                <RowDefinition Height="1*"/>
                <RowDefinition Height="2*"/>
                <RowDefinition Height="3*"/>
            <Grid Grid.Row="0">
                        <ColumnDefinition Width="5*"/>
                        <ColumnDefinition Width="1*"/>
                    <Rectangle Fill="DeepPink" Grid.Column="0" />
                    <Rectangle Fill="Chartreuse" Grid.Column="1"/>
            <Rectangle Fill="Blue" Grid.Row="1"/>
            <Rectangle Fill="Green" Grid.Row="2"/>


I’ve moved to a new icon (WordArt in Google Docs). I’m not yet sure if it will get through the Windows Store validation, but this is it:


That means the entry in the App list on the phone now looks like this:


Subversion, not Git

I decided it was in fact mad to go down the Git route: we have Subversion in work, so I really ought to be following that. And it’s actually pretty darned simple to hook up a remote server… assuming you have that good old MSDN subscription.

The steps are:

  • on an Azure VM, set up a VisualSVN endpoint on a given port;
  • on that same VM, download and install the VisualSVN server;
  • point the VisualSVN at your endpoint;
  • create an empty repository;
  • Now on your dev machine (ie wherever you will be doing your coding), install TortoiseSVN;

And installing the VisualSVN client on my local machine integrates itself nicely with Visual Studio and TortoiseSVN – at work I use Ankhsvn, but on a first experience, I just like this:



And a vsvn01 vsvn02 vsvn03 vsvn04

vsvn05 vsvn06

Having successfully checked in stuff, I now wanted to backup my repository. You have

svdadmin dump [repo-location] > [single-file-backup]

Like this:



Windows Phone 8.1: getting there

A fairly productive 24 hours, including the “good-for-the-soul” digging in the garden. The Buddha was gently moved, the covering stones now all washed, and sitting in piles on a tarpaulin, ready for a fresh weed-mat.

In terms of the more enjoyable productive bit (this being a week off ostensibly for half-term), I’ve learned a lot on the Phone 8.1 front. This should really have been called Windows 9 – it’s such a big change, well from the developer angle anyway. And no surprise that the next version the public will see is Windows 10.

Anyway, at least I have something in place now:


wp_ss_20141027_0001 wp_ss_20141027_0002


Running some token unit tests against my Phone app, I got this:

------ Run test started ------
Target platform x86 is incompatible with the selected device type. Make sure that they are compatible with each other and try again. Example: - X86 or Win32 platform is compatible with emulator and not compatible with arm device. Similarly arm platform is compatible with arm device and not compatible with emulator.
Unit tests in source D:\data\Git\Development\C#\NumberSpeaker\Build\NumberSpeaker\NumberSpeaker.UnitTest\bin\x86\Debug\NumberSpeaker.UnitTest.dll cannot be run. Please create a Windows Store or Windows Phone Unit Test project.
========== Run test finished: 0 run (0:00:00.2086909) ==========

This is such a nonsense, can the compiler really not sort this out? This person has documented how to work around it, and I’ve got it working, but I couldn’t get it work through the device/phone, only through the emulator.


Also  something of a struggle are behaviors in XAML in 8.1 Phone. Basically I want to shift focus to a textbox triggered by the clicking of a button, but I want to do it in an MVVM way. This person documents that side nicely, but it needed this person, and their Nuget package WpWinNl to get it working in Phone 8.1.

Behavior Behavior02

Oh yeah, here was another wierd error have you have debugging exceptions on, which someone on StackOverflow says “just ignore”, but it just feels so wrong you have to do that:



I’m not terribly sure why, but I’m now using Git on Azure to save my source code to.  Well, I do: a) I want it free (covered by my trial, so I will have to think again) and b) I want it private.

git01 git02

I find Team Explorer in Visual Studio a pain to use, not very well thought out as an interface.


git03 git04


Whenever I copy code across to a new project, I keep forgetting to enable speech:

NoAuth01 NoAuth02