ReactiveUI some easy but nice.
23 November 2014
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 )
{ CODEHERE; }
} );
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. The 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!
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!
WPF, is MVVM worth the pain?
23 May 2012
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?
Kenny
MVVM and WPF/Silverlight
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> } }
WCF and Windows 7/Vista
7 March 2009
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.
Kenny