Managed Application Framework – Part 1 – The Beginnings!

By Charlotte

Last week I was tasked with developing a new App for the guys I work with, (not a developers app you understand, but for actual normal users!!! Luckily it puts me smack bang where I work best – developing functional, extendable (and most importantly) Windows based apps. I’m now officially in my comfort zone! The…

Ternary operators don’t work with nullable value types?

By Charlotte

I’ve got the following situation: DateTime? myDt = (DateTime) row[“Column”]; This fails when retrieving a DBNull value, so we check for that: DateTime? myDT = (row[“Column”] == DBNull.Value) ? null : (DateTime) row[“Column”]; This won’t compile, however doing: DateTime? myDT; if(row[“Column”] == DBNull.Value) myDT = null; else myDT = row[“Column”]; works fine, now, I realise…

Missing format specifier.

By Charlotte

I’ve been practicing my F# recently – I took a gap for a little bit, and just got back into it. I’ve been working through my ‘Foundations of F#’ book, and have hit a slight snag. There is one line of code I can’t get to compile, I get the ‘Missing format specifier.’ error for…

Invoking UI Changes in WPF

By Charlotte

Again another reminder, in WinForms I would have done: private delegate void UpdateUiTextDelegate(Control control, string text); private void UpdateUiText(Control control, string text) { if(InvokeRequired) { Invoke(new UpdateUiTextDelegate(UpdateUiText), new object[] {control, text}); return; } control.Text = text; } Using the same delegate we need to use the Dispatcher.Invoke method – this is (as far as I’m…

Enabling / Disabling buttons in WPF

By Charlotte

I’m really only putting this in to remind myself — having come from a WinForms background, I’m used to: _btnOK.Enabled = false; but in WPF this is: _btnOK.IsEnabled = false; For some reason I (without fail) forget this!

WPF Resources from other DLL’s

By Charlotte

I spent a little bit of time trying to figure this out, to be honest – it’s available in quite a few locations on google, but I thought I’d add it here as well. The basic problem is, you have your template / theme etc for your control in a separate project; MyThemes : DateTimeThemes/Theme1.xaml…

Production LINQ!

By Charlotte

I’m happy today as I’ve written my first bit of Production LINQ code in the form of LINQ-to-XML. It’s not the most complicated bit of code – only a grabbing of data from a file, but it does do what it says on the tin – uses C# 3.0 and (unfortunately) causes Resharper to complain…