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 – working with designers – will it work?

By Charlotte

One of the main advantages of WPF is that you can write all the backend code and then shunt the design work to a professional designer – you know – one of those guys who thinks that Cyan and Magenta just don’t go together. I’ve been knocking up a couple of WPF apps in the…

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…

WPF Image Rendering on Headers

By Charlotte

I’ve been having a little bit of trouble lately with WPF, in particular the rendering of an image on the header of the TabItem or GroupBox headers (for example), I have the following code: … <GroupBox> <GroupBox.Header> <Image Source=”./Images/MyImage.png”/> </GroupBox.Header> </GroupBox> … Which renders fine in Visual Studio, but the minute I run the app…