MVVM WPF Validating multiple items together

In an application I am developing, I required that two checkboxes be validated together, when either one of them were clicked. I also needed to only show the Validation error once in my Error Message Box. To achieve this we first call the OnPropertyChanged routine, which in turn raises the PropertyChanged event, for each linked [...]

By |2017-03-25T07:46:17+01:00January 7th, 2013|.Net Framework, MVVM, Tips, Validation, VB.net, WPF, XAML|0 Comments

WPF – Restricting Text Entry to Numeric Characters, the MVVM Way

I needed to Limit several TextBoxes in my WPF MVVM application to only allow Numeric Characters. I stumbled upon a very useful post by Jermey Likeness which described a method using Attached Behaviours, which worked well for me; http://csharperimage.jeremylikness.com/2009/10/silverlight-behaviors-and-triggers_07.html I modified this code slightly to allow for Decimal point control also. The VB.net Code is [...]

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

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+01:00December 5th, 2012|.Net Framework, Entity Framework, MVVM, VB.net, WPF|0 Comments

WPF MVVM DataGrid Column Collection Binding

In my efforts to “MVVM-ify” my WPF application as much as possible, I ran into the need to Data Bind the Columns Collection of a DataGrid. After some searching on StackOverflow, I found a neat solution by David Osborn; http://stackoverflow.com/questions/3065758/wpf-mvvm-datagrid-dynamic-columns This solution was in C#, so I converted it to VB; [fusion_builder_container hundred_percent="yes" overflow="visible"][fusion_builder_row][fusion_builder_column type="1_1" [...]

By |2017-07-24T08:33:19+01:00September 24th, 2012|MVVM, VB.net, WPF|0 Comments