Category: WPF

The image cannot be decoded. The image header might be corrupted

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 might be corrupted With the following code : So, I...

Filter an ObservableCollection with a CollectionView in C#

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 objects or system type lists, so feel free to use...

Open Documents and Media in WPF’s Web Browser Control in C#

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, Image control, etc..), however if you use the web browser...

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 :  

Getting the Connection String From Your App.Config In WPF and C#

I am using Active Reports and came across a problem where I needed to send the report a connection string. Before I would build the connection string based on what database was used, etc… from an INI file. Now we moved to a MvvM structure with the connection string in the App.Config. I had found a common solution : This...

%d bloggers like this: