Thursday, June 14, 2018

Revisiting the takeaways from WWDC 2018

I was reviewing the announcements from WWDC and thought that as my takeaways are likely to be different from those of other developers (and that I've seen them share) I'd thought I'd call out what I think is important.

  • Support the devices that the people using your apps have. What people use is more important than supporting the latest devices.
  • Shared experiences are important for people (group facetime) and the adoption of new technologies. (AR games)
  • Integration with the platform/OS (such as SIRI Shortcuts) helps people integrate the services and functionalities your app provides with the how people use their devices.
  • Platforms change, evolve and may not be around as long as your app. (end of OpenGL)  While using no 3rd party tools isn't an option, it's important to be aware of the wider ecosystems and changes around the tools and utilities you use so that if they go away or become deprecated in favor of a new alternative you won't be caught by surprise.
  • People are mobile, not just devices. People even move more than some (phone) devices. Your app experiences may be more useful if they exist on more than a single device type. That may mean using the same app (or an emulated version) or a customized version of it. 
  • Watch what is new and popular in competing apps/platforms and, if appropriate, replicate that functionality. (In Windows Dark Mode has been VERY popular with some people. It only makes sense for that to come to MacOS too.)

Thursday, May 10, 2018

Rapid XAML Toolkit - some questions answered

As I write this, Build has just finished. It's been a great three days but today has been the best. That's in most part due to the reception that my new project has received.

I made the repository for the Rapid XAML Toolkit public this morning.
I wrote a bit about it earlier, but here are the answers to some more questions I've repeatedly been answering today.

  • What is it? - It's the ability to generate a XAML UI from a data (or view) model based on some configurable rules. It can produce everything from the whole view, all the way down to the UI for a single property which you put where you want in an existing file. There are also some helpers for wiring up the data context (on the view or code-behind) as necessary.
  • Is it an app builder? - No, it is a developer tool. The aim is to give developers something to build upon or modify, rather than having to do everything themselves.
  • Why build it? - Lots of apps are created from the data up. They are forms on top of databases or web service requests. In these scenarios, a data model exists, and a corresponding UI is required. By removing some of the effort involved in creating the UI, hopefully, this will free more developer time to work on innovative features or fixing bugs. It's an indirect way to help more developers create better software.
  • Is it Windows/UWP only? - No, it's XAML focused and platform agnostic.
  • What does that mean? - UWP, WPF, and Xamarin.Forms!
  • It works with Xamarin? - Yes, but Xamarin.Forms only.
  • Does it work with Xamarin Native? - No, but the underlying generation engine could probably output some useful stuff. I just don't have the time to investigate how at the moment.
  • What about code-first UIs? - Again, the focus is on XAML, but it could probably generate something
  • Can it be used now? - Well, it's all open source, go for it. In reality, it's still in an Alpha stage.
  • How long until a proper release? - When it's ready. If you want to help, it'll be sooner. Hopefully not more than a couple of months though. There will be a proper beta first.
  • What about F# support? - No. It uses Roslyn CodeAnalysis to analyze the source, and this doesn't support F#. There may be some way around this, but there are other, more important things to do first. It is in the backlog, just don't hold your breath. It does work with VB though.
  • Why VB? - Because Windows.   As a tool that has a background in helping developers migrating older Windows apps to UWP, I recognize that a large number of them use VB and so I don't want to exclude them.
  • Will it work with Visual Studio for Mac? - No, just VS for Windows. This is because that's what supports development for all XAML platforms?
  • How to use it with WPF? - You'll need to create a profile first. I'll add some soon.
  • Is this a Microsoft thing? - Yes, and no. I don't work for Microsoft, but it is an open source project released under their GitHub organization. That means their name on the copyright, but it's also MIT licensed. Yes, this is unusual--it's the result of exceptional circumstances.
  • But you had a staff badge at Build? - Yes, I was working on the Windows Template Studio booth because I'm a significant contributor to that project. This is also why the development and configuration were done to support UWP first. RXT is a sister project to WTS.
  • Have there been any official announcements about this yet? - Not yet, but expect something in the next couple of weeks.
  • Are there any video, tutorials, etc.? - Not yet, but they will be coming.

Other points to note:
  • This is just the start. The name deliberately claims to be a toolkit. There are lots of other things planned, but the underlying engine opens a lot of opportunities and possibilities to build upon.
  • Yes, it would be cool to put some ML/AI in it ;) 

Go check it out now at
Then ask me questions on twitter @mrlacey

Wednesday, May 09, 2018

I just "gave" a load of code to Microsoft

TLDR: Announcing a new open source project for making XAML development easier.

What's this about giving away code?

I had an idea for something, built a proof-of-concept that impressed and excited some people, and we decided that the best way to get it to lots of people quickly was for Microsoft to release it as an Open Source project. So, that means I've "given" the code to Microsoft on the basis that they'd make it open source and thereby giving it away to everyone. In practice, it means it's in a Microsoft owned repository but I'm an admin and main contributor.

What is this thing then?

Introducing the Rapid XAML Toolkit.

It's a Visual Studio extension that provides functionality to accelerate XAML development.
It's rare for developers to build the XAML UI for an app before having some sort of data model that the UI will represent and allow interaction with. It might be from a database, web service, or somewhere else but if you've got some code that describes what should be there, why not let the tool create it for you?

Of course, it's more than just a file. It contains suitable XAML that represents the ViewModel, wires up the bindings, and sets the data context. It's not going to be the final XAML you need but it's going to do in two clicks what could otherwise take a few minutes. Given the choice, would you rather have a blank page or something that works and you can just tweak to your needs?

As an example, given a class that looks like this:

    public class OrderDetailsViewModel : ViewModelBase
        public int OrderId { get; private set; }
        public Guid CustomerId{ get; set; }
        public DateTimeOffset OrderDate { get; set; }
        public string OrderNotes { get; set; }
        public decimal OrderTotal { get; }
        public ObservableCollection<OrderLineItem> Items { get; set; }

It could produce this:

        <TextBlock Text="{x:Bind ViewModel.OrderId}" />
        <TextBlock Text="{x:Bind ViewModel.CustomerId}" />
        <DatePicker Date="{x:Bind ViewModel.OrderDate, Mode=TwoWay}" />
        <TextBox Text="{x:Bind ViewModel.OrderNotes, Mode=TwoWay}" />
        <TextBlock Text="{x:Bind ViewModel.OrderTotal}" />
        <ListView ItemsSource="{x:Bind ViewModel.Items}">
                <DataTemplate x:DataType="OrderLineItem">
                        <TextBlock Text="{x:Bind OrderLineId}" />
                        <TextBlock Text="{x:Bind ItemId}" />
                        <TextBlock Text="{x:Bind ItemDescription}" />
                        <TextBlock Text="{x:Bind Quantity}" />
                        <TextBlock Text="{x:Bind UnitPrice}" />
                        <TextBlock Text="{x:Bind LineTotal}" />

How does it know what XAML to create?

The generated XAML is based on the type and name of the property and whether it is read-only. There are some carefully chosen options provided by default but everything is configurable. In the future, it may also be powered by AI too ;)

How does it know where to put the created file?

It's based on conventions but is fully configurable. It even supports having the View and ViewModel in different projects if that's what you prefer.

That all sounds like one feature. Why call it a toolkit?

Because there are plans for much more. XAML generation is just the start, but it enables lots of scenarios and opportunities.

Even today, it doesn't just provide the ability to produce whole files. It also provides the ability to generate XAML without having to create the file. You can generate the XAML for an entire class, an individual property, or a selection of properties. This raises the question of where the XAML will go. We leave that up to you. The generated XAML can either be copied to the clipboard (so you can paste it wherever you wish) or sent to the clipboard (so you can drag it where you want it.)

The final part of setting up the basic association between VM and View is to ensure that the data context for the page is correctly set. If it's not, then it provides the option to do this for you.

Does it do X?

Probably not...yet! There are lots of features planned but if you've got a suggestion, please raise an issue in the GitHub repository.

How does this compare to Windows Template Studio?

Windows Template Studio will help you to scaffold a UWP app. The Rapid XAML Toolkit is a sister project and can help you once you've created the stub of your app, or if you have an existing app. It doesn't have to be a UWP app either. We hope this will be helpful to Xamarin developers too.

Wait, what's this about Xamarin? I thought it was a UWP thing.

Nope, it's a XAML thing!
While there may end up being some elements or features that are UWP only, the intention is that it will be beneficial to any developer who is working with XAML. This means Xamarin.Forms and WPF. (It will work with Silverlight too, but I'm just not providing any default configuration for it.)

Really, WPF?

Yes, WPF too.

Anything else?

Yes, it works with both C# AND VB.Net.

Really, VB.Net?

Yes, because all developers deserve nice things. Plus, we think this will be particularly beneficial to developers converting WinForms and WPF apps to UWP, and we know a lot of them use VB. If they're learning UWP, they shouldn't have to learn C# as well.

Where can people find out more?

GitHub is the place. Go to and check out the current features.

p.s. As you'd expect, I'll be sharing more details soon, but, if you're at //build, I can show you more. You'll find me at the Windows Template Studio & Community Toolkit booth.

Thursday, May 03, 2018

Personal mission statement

I've been thinking about creating a personal mission statement. Something that simply and clearly sets a guide for what I (want to) work on.
I've come up with this.

Help people create better software.

I think there are two aspects to this: Education and Tooling.

People can't make better software if they don't know what makes better software or how to create it.
I'll do this by providing resources in the form of books, articles, etc.

Creating/providing tooling that can help create better software will make it easier and faster for people to do so.

What do I mean by "better"?

- Easier to learn
- Easier to use
- Easier to support
- Usable by more people
- Fast
- Reliable
- Robust
- Secure
- more ...

Some practicalities
- I can't help everyone.
- I'll focus (at least initially) on areas where I have specific knowledge and opportunities.

Wednesday, April 25, 2018

WinAppDriver a base for testing

I've been doing some automated UI testing using WinAppDriver.

Here's a simple base class I've been using for my tests that takes care of ensuring that the service app is running when the tests start.

If you're writing tests using WinAppDriver and are fed up with tests not running or false negatives when the exe isn't running and listening for requests, then check it out.

The check for it being installed is also useful when you first run on a new machine.

You may need to allow for untrusted PowerShell scripts or have VS running as an admin for everything to work.

Friday, March 23, 2018

UWP vs Web development

I recently heard someone try and make this argument. (They were sucking up to Microsoft at the time.)
If I do web dev I have to learn at least 4 things, but for Windows, I can just learn UWP
Their thinking was that for web development they need to learn:

  • HTML
  • CSS
  • Javascript
  • Some framework (e.g. Angular)
  • Possibly more...

They argued that they could just learn "UWP".
But I think that means several things too:

  • XAML
  • C# (or VB, or C++)
  • An MVVM framework (MVVM Light, Caliburn.Micro, Prism, etc.)
  • The UWP app model and platform-specific APIs
  • possibly more...

I don't think this argument holds up.
The development of any piece of non-trivial software requires the use of multiple complementary technologies, skills, and techniques. If you ever think you can just learn one thing and then you'll be done, you're setting yourself up for disappointment and failure.

There's a similar thing I've heard from other developers and that's:
I don't need to learn Android (or iOS) I can just learn Xamarin.
That's equally flawed and in similar ways.

Friday, March 16, 2018

Did someone really design this ATM experience?

As I put my card in the ATM machine today I noticed a message on the screen that said
Receipts currently unavailable
I've seen it many times before. It means the roll of paper the receipts are printed on has run out. Not a problem, I just want cash.

After inserting my card and entering my PIN number, among the many options were two related to what I wanted:

- Cash with receipt
- Cash with no receipt

Yes, that first option makes no sense based on the message shown at the start. But wait.
I selected the second option and was then asked:
Do you want a receipt for your transaction?
- Yes
- No

I selected "No". I didn't want one and, based on what the machine had said moments ago, I knew it couldn't provide one even if I did want it.

I then selected the amount I wanted to withdraw.

All should have been good but then I was asked, again:
Do you want a receipt for your transaction?
- Yes
- No

Again I selected "No" and finally my money was dispensed.

Part of me was glad to finally get my money.
Part of me was tempted to try that again and see if what would happen if I chose some of the impossible options.
And another part of me was saddened by the process.

Here are my issues with what happened:

  • The software repeatedly provided options for things it had said were unavailable.
  • The software asked the same question multiple times, seemingly disregarding my past answers.
  • The software made the process longer and more complicated than was necessary.

Someone was paid to make this software.
Someone tested and approved this software.
Someone thinks this is a good experience to give to their customers.
Someone thinks that we should trust them with our money inside complex financial systems when they make what should be a simple piece of software unnecessarily complex.

You wouldn't build software that provided an experience like this.
Would you?

Tuesday, February 06, 2018

Create UWP apps with VB.Net and Windows Template Studio

The majority of my open source software contributions over the last few months have focused on adding VB.Net support to Windows Template Studio (WTS).

WTS is a Visual Studio extension that provides a better File>New experience when creating UWP apps.

The aim is to help new developers start in a structured, conventional way that will help in the future but they may not even know to consider.
It also aims to help all developers by removing some of the plumbing and code that is needed by every app.

Using the wizard is a simple, three-step process.

File>New Project dialog

Start by selecting the project type and the framework you want to use.

Then, add any of the predefined pages

Finally, add code to handle any extra features.

It can't do everything for you and there will be some things you need to do with the generated code before everything will work as you need. To address this, the code includes comments that explain what you need to do. You'll find them in the TaskList window.

Its usefulness doesn't just end once the project is first generated. It will also help you add to a project you've already created. Just right-click on the project in solution explorer and you can add a page or a feature.

That's still not the end. WTS already supports five frameworks when working with C# and there's much more planned for the future, including: Xamarin.Forms support; more pages; more features; and other exciting new functionality too.

To get started using Windows Template Studio, download and install the VSIX from

Or, learn more about the project on GitHub at