Tech Talk A software developer on all things tech, and then some

16Feb/123

Binding a Combobox to an Enum in C# and WPF using XAML and MVVM

I saw a lot of posts on how to bind an enum to a combobox using code behind and C#, but since I was using MVVM, I needed a different solution. I basically wanted to bind a list of the enums in a maintenance view model, and have the the xaml handle the binding of the item list. To help remember what I did and help whomever along the way with the same issue, I thought I would write about it.

12Jan/110

Replacing Names Quickly in Visual ‘s Find and Replace

Part of the perks of moving your application to MvvM, you dont have to name your controls since you are binding everything. This frees up resources when running your application. Since my application was fairly large, I decided to dabble in Visual 's regular expression to replace all the names. I ended up putting :

Name="[a-z]*[0-9]*"

 

   
%d bloggers like this: