Setting Control Focus… The MVVM Way…

I needed to be able to set the Focus of a control, using MVVM. This means of course, that we can’t interact directly with the View, but instead must rely on Binding. I found a very helpful post by Khalid Rafique which allows exactly this; http://codenicely.blogspot.co.uk/2012/01/how-to-set-textbox-focus-in-silverlight.html By making use of attached Interactivity Behaviours, we can [...]

By |2017-07-24T08:33:18+01:00January 1st, 2013|.Net Framework, MVVM, Tips, VB.net, Visual Studio, WPF|0 Comments

Enabling MVVM INotifiyPropertyChanged in EF 5 POCO Entities created using the EF 5.x DbContext Generator

While combining EF5 with WPF MVVM, I noticed that changes to individual properties within my bound DataContext weren’t updating the UI. This was of course because the the actual DataContext itself isn’t changing, but only the POCO Properties housed within in. However, each of the POCO Properties don’t individually raise an INotifyPropertyChanged event. In order [...]

By |2012-12-05T00:28:00+00:00December 5th, 2012|.Net Framework, Entity Framework, MVVM, VB.net, WPF|0 Comments

Using Reflection to retrieve Entity Framework Data using a Column Name String

If you ever need to retrieve data from EF using the name of a column, rather than the built in Intellisense, then the following vb.net code snippet may help. GetType(TypeOfEntity).GetProperty(NameOfColumn).GetValue(ActualEntity, Nothing)TypeOfEntity is the name of the Entity from which you wish to retrieve data. NameOfColumn is obviously the Name of the Column from which you [...]

By |2017-07-24T08:33:19+01:00November 20th, 2012|.Net Framework, C#, Data, Entity Framework, VB.net, Visual Studio|0 Comments

Windows Forms App with Splash Screen Throws–“Invoke or BeginInvoke cannot be called on a control until the window handle has been created.” Exception

I’ve come across a bug in the .Net Framework when developing a Windows Forms app, which has a Splash Screen. On some users machines, the application threw a “Invoke or BeginInvoke cannot be called on a control until the window handle has been created.” exception at startup. This is seemingly to do with code executing [...]

By |2012-10-17T11:36:00+01:00October 17th, 2012|.Net Framework, Bugs, VB.net, Visual Studio|0 Comments