A very quick code snippet for you all today. I had encountered an issue where I needed to invert the text color from the background (color was changing consistently from the user). So after some googling and playing around, I created something to do just that for me. First we […]

Continus reading  

I was recently trying to send to Telerik’s image editing control a jpeg image in a stream format. I was checking for the other types and using the appropriate format providers, but I kept getting an exception when working with JPEGs : The image cannot be decoded. The image header […]

Continus reading  

Using an ObservableCollection and need to filter its contents? A quick and easy way I found was to create and bind to a CollectionView to perform the filtering for you. Step 1 : Create the Observable Collection The first step is to create the observable collection. This will work for […]

Continus reading  

Need a quick way to save a byte array to file and read back? So did I, and thought I’d include this simple code snippet for anybody who needed it as well. Includes Code : Saving to File Note below, there are two additional options (besides the name) you can […]

Continus reading  

Have you ever assigned a value to an IEnumerable from a database, then try to access in a foreach or something similar and get the following? “ObjectDisposedException was unhandled by user code : The ObjectContext instance has been disposed and can no longer be used for operations that require a […]

Continus reading  

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 […]

Continus reading  

Formatting code not only keeps OCD programmers like me sane being organized, it also helps with the readability of your code when ever you or somebody else views it for maintenance. However sometimes formatting the code quickly in Visual Studio 2010 is not exactly straight forward so I thought I’d […]

Continus reading  

Ever need to display a word document in the same application and didn’t want to shell execute word? Ever need to display text from a rich text file or regular text file? How about quickly displaying an image file?¬†All of these could use there own controls in WPF (Document Viewer, […]

Continus reading  

There has been a few times I needed to do a like statement in LINQ, but didn’t know exactly how to go about it. Just in case there are you out there looking for the same, I thought I would post what I did. For example, say you had this […]

Continus reading  

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. […]

Continus reading  

Setting Up the ComboBox So in WPF, I wanted to filter a combobox to treat it as an autocompletebox. Note : This tutorial expects you understand how to populate the combobox to have the data to filter. I started off enabling two items on the properties tab of the combobox. […]

Continus reading  
%d bloggers like this: