there is another way of doing this, with a marklin modell train. You can use one of the .net microfamework harware boards to use the CAN bus signal, followed by some minor electronics for buffering (isolator and optocoupler). Have to dig up the schematics, pretty simple stuff. I did it on a breadboard. Then connect it to the second train controller box coming pretty much with every digital started pack and can be bought seperately as well.
Use some software in .net to write the CAN bus messages. And off you go, I succeeded in doing this even with an LCD touch connected to the NetMF HW and control the trains speed, extras, the train's track switches, pretty much anything connected and using the rails as means of communication. The CAN protocoll from Marklin can be found on the Marklin web site.
One can even think of connecting a BLE or Wifi receiver unit to the .net board and be able to control your train from your mobile device. If you extend the controlling software with some nice UDP stuff UPNP is even in the game .... so your trainset will even be noticable on the network ....