Category Archives: Coding

WPF MVVM Thread annoyance

In WinForms one of the annoyances is that any GUI operation requires invoking GUI thread to do it. I wrote a blog article on a quick hack to bypass it. I was really hoping this limitation was gone in WPF, but alas… Lately I’ve been refactoring my IRC client to use a MVVM-like architecture. In MVVM ViewModel should… Read More »

Refactoring IRC client with MVVM and “MDI”

A screenshot of the first working window after refactoring the IRC client. I had to create my own MDI window in WPF as it doesn’t support it. Extra fun when it doesn’t support inherited user controls, but that wasn’t too difficult to solve. Just made a class to inherit MDI window and then programmatically added a user control… Read More »

MVVM (and my IRC client)

This post is a bit of a personal rant on whether or not to use MVVM. I’m comparing MVVM with my current architecture and try to look at a few pros and cons. Clearly MVVM is not optimal, but there might be parts to borrow. At the moment I’m doing some heavy refactoring of the IRC client I’m… Read More »

C# / .Net WinForms GUI Thread Invoke solution

In .Net WinForms (and WPF for that matter) only the main GUI thread is allowed to make any change to GUI. If you attempt to do so from another thread then Visual Studio MDA will let you know that you made a mistake. This is actually an improvement from VS2003 where nobody said anything, so your application would… Read More »

Embedding YouTube in WPF WebBrowser control

Embedding YouTube into your C# WPF application can be done by wrapping embedded YouTube in a WebBrowser object (Internet Explorer). There are a couple of things you need to do to make it work. Tested on Windows 7 Ultimate 64-bit in .Net 3.5 (VS 2010). Sample code can be found at the bottom. Add Mark of the Web… Read More »

Datalagrinsdirektivet (DLD) zero-day exploit

I forbindelse med høringen om Datalagringsdirektivet så tenkte jeg å lage en liten zero-day exploit. Det vil si en exploit som er ute før sikkerhetshullet er fikset, eller i dette tilfellet allerede før sikkerhetshullet er implementert. DLD virker lite meningsfullt for alle som ikke har en post-it lapp hengende på skjermen som sier “HUSK! VG – BLÅ ikonet,… Read More »