I was implementing some paging functionality in a system I was building and realized that I had created the same forward, backward, first and last buttons and logic 3 times. After doing this I realized these buttons and logic were a perfect example of where I could reduce complexity and encapsulate my code better. I […]
Read More →Tags: WPF
Resize a control within a WPF window grid at runtime
It’s kind of funny, you search and you search for the answer or keyword for achieving the resizing of controls within a WPF window at runtime but just can’t seem to get there easily. However, as soon as you find the right word there is an abundant supply of information about the topic. I mean […]
Read More →Resize WPF contents controls when window is resized
I created a nice utility in WPF today which contained a treeview, textbox, button and datagrid. The logic and work flow executed as expected, I was very proud of the work. I caught all my errors and exceptions and provided the user with options on how to proceed or correct the error. But the window […]
Read More →Add Key Value Pairs to a Combobox using WPF and C#

It’s pretty easy to populate and read from a ComboBox when the selected item is the same as the selected value. I.e. just simply use: [sourcecode language=”csharp” padlinenumbers=”true”] string selection = comboBox1.SelectedValue.ToString(); [/sourcecode] However, when you need the value to be different from the item (I.e. display value). Perhaps you want to display the Month […]
Read More →Convert Silverlight to WPF and WPF DataGrid in C#

Here is an example of a conversion from a Silverlight project that reads data and loads it to a DataGrid to a WPF project. Please read my previous post which covers the creation of the Silverlight project used in this example. Difference #1 Silverlight is built as a UserControl which is converted from your XAML […]
Read More →How to change an image in WPF at runtime in C#
I was doing some code that checks the number of network round trips to the database within a single transaction. I was coding it using WPF in C#. What I wanted to do was set the image in the Status Bar to a green image if the transaction took 1 trip, a yellow image if […]
Read More →Progress Bar, Multithread in WPF using C#

I created a video a while ago that discussed how to implement a progress bar in a windows form application. It used the System.Thread class library and the the BackgroundWorker class. With the release of .NET 4, there is a new. easier way to implement this. In this example, I have added the progress bar […]
Read More →Lesson 12 – Localize WPF and ASP.NET using C# and XAML

In Lesson 12 you will learn how to: Localize a WPF application using resource files, XAML and C# Localize an ASP.NET application using resource files
Read More →Using the ListCollectionView Filter method in WPF with C#

NOTE: This solution does not implement paging and requires the retrieval of the entire result set. If your dataset is huge, I wouldn’t go this route. Other options, LIKE %text%, FULL-TEXT search, Lucene.Net…and many others… Check out another of my blogs where I defer the retrieval using a Delayed Action. Again, if you look hard […]
Read More →Using the ListCollectionView with a deferred Filter method in WPF with C#

In another blog I covered how to perform filtering using the ListCollectionView class on a datagrid. What I noticed on the implementation on a larger result set was a little lag in the response when characters were being entered into the filter textbox. The way it was implemented was for each character entered; perform a […]
Read More →