I have been using Paul Bett’s ReactiveUI which is a .NET UI API framework for WPF, Sillverlight, WinForms, Xamarin.Forms, perhaps more. It’s built on top of Microsoft’s system.reactive or Reactive Extensions. I really like how ReactiveUI works, but it can be a mind twist to get started with.

I didn’t find a similar example online, but I have a button in a app that sequences through a list of choices. I thought it would be nice to have it do something once the user has stopped changing the selection. In this example, the button is implemented by ReactiveUIs ReactiveCommand which is it’s wrapper around the stand ICommand for WPF, Silverlight, etc..

public ReactiveCommand<Object> ActionNext { get; set; }

So in this example ActionNext simply sequences through a bunch of choices. Imagine a set of colors as strings, but that list could be anything. The following { CODEHERE; }, will only execute after the user stops clicking on teh ActionNext command for 1 second.

this.WhenAnyObservable( model => model.ActionNext.IsExecuting )
.StartWith( true )
.Throttle( TimeSpan.FromMilliseconds( 1000 ) )
.Subscribe( executing =>
if ( ! executing )
} );

I think that’s pretty cool. What is happening it ‘Subscribe’s to changes of the RaectiveCommand’s IsExecuting true and back to false. Only when that stops changing aak executing for a 1 second, will the Subscribe code fire.

We’re going mobile

25 March 2014

Our first promo app, called MagikAteBall.  AppMainScreenThe app is mostly to promote  our mobile application development service. Source to Nuts is going mobile.

It’s a really clean and simple app that shows a few features of mobile platforms shake gesture, location, search, phone dial, directions, paid click ads, and more.  Get in touch if you have an app to develop!

Download it here.

WPF Splash Screen

15 June 2012

Before today, somehow I never had to develop a WPF splash screen. yeah, I’ve inherited some and most of them were quite complex and nasty with background threads and such. So what did I do when I had to start one from scratch?

Well yeah, I googled ‘WPF Splash Screen’ and found this MSDN link near/at the top of the results.

Wow, what a lot of work and code I could have saved in the past! I can’t believe how easy it is to develop a simple WPF splash screen. Just in case that link breaks, here are the simple steps:
– Create or find an image that you want to use for the splash screen. You can use any image format that is supported by the Windows Imaging Component (WIC). For example, you can use the BMP, GIF, JPEG, PNG, or TIFF format.
– Add the image file to the WPF Application project.
– In Solution Explorer, select the image and its properties.
– Select SplashScreen from the Build Action drop-down list.
– Done, F5 run. Wow, that was easy!

A friend wrote me an email basically asking if the MVVM-approach to WPF applications made sense, They thought it felt like a lot of duplication of code in the View and View Model. In response, I wrote the following email (with minor edits), maybe someone else will get something out of my 10,000 foot view of MVVM. Note: I always thought it should be 10,000 feet view, but it doesn’t’ sound right, does it?


MVVM and WPF/Silverlight

MVVM = Model – View – View Model,  which probably should be
VVMM = View – View Model – Model, but it would be a confusing acronym
Model = Data or the person class in your example.
I think of the View Model as the controller ala MVC from the Smalltalk days, but …  It can do all of the ‘glue’ of Model to View. MVVM is a nice separation of concerns and when you get the hang of the separation, it will feel better…..I think.
The ‘goal’ of MVVM is that the View is “pure XAML”, you should break that rule seldom or not at all, but when it it makes more sense to you to put code behind the View break the rule…ie don’t go nuts. I find that the WPF Commanding architecture is best hosted in the View Model and then tying the View and View Model together is pure Bindings in the View.
One design that I’ve seen work for simple apps. Is a shell of an App that you dynamically load Views into the main container and tie up the VMs. BUT until you get the hang of that, it will feel weird and disconnected. XAML binding problems can be tough, but VS is getting better at it 2010 was a *big* improvement.
If you want, one of the properties of the VM can be the Model or more than one Model say Person.
public class MyViewModel
    public Person Person { get; private set; }
    void SomePrivateCodeProbablyInResponseToACommand( object sender, EventBlah e )
        this.Person = Person.Get( dbcontext );
    public ICommand SavePerson { get; private set }
    void Init()
    {   // tie up Commands to events/lambdas</div>
You don’t need a framework, but when/if you do, MVVM Light, by Laurant, is very nice and offers a bunch of utilities that will be useful when you hit the hard problems (threading, etc..). It includes some nice VS add-ins if you like Wizards and templates.

I’ve been working with WCF in my new position at carefulproducts.com. I really like WCF and the new job. I’m reading this book about creating and using WCF RESTful implementations with .NET 3.5 SP1. I’m also new to Windows 7, skipped the Vista fun. For a while, I’ve been struggling on Windows 7 and especially its security. Why do they move everything with every release.??? Argh!!

I never really understood the uses of an application manifest file exactly, but this article really helped me get it at least for what I’m working on. Now I don’t have to keep punching holes into the firewall for my WCF hosting applications and figure out where they moved stuff in Windows 7…b**tards!

While I’m at it, I’ll put a plug in 😉 for this code project article. Anything to avoid learning IIS….again! Sorry, but I think I have Mono.

This weekend, I’m coding up what I call a RESTful Content Exchange Service (CES). What this service does, is provide access to and the ability to create remote ZIP files of content. Content being media files, software updates, etc… all balled up in zip files.


%d bloggers like this: