Category Archives: WPF

WPF Double to Fraction Converter

While on a project creating a WPF application for some real heavy Excel users, I’ve received a lot of requests to make it more like Excel.  One of the requirements that came in was to allow the users to type … Continue reading

Posted in C#, WPF | Tagged , , | Leave a comment

Filtering Items in a WPF ComboBox

I was building a WPF application for a client which had a few ComboBoxes with large amounts of items as options in them.  The client asked for the users to have the ability to filter the items in the drop … Continue reading

Posted in C#, WPF, XAML | 6 Comments

WPF DataGrid, Read-Only Row

A common requirement for a DataGrid is to have entire rows that are read-only.  You may have a list of records in your DataGrid and some need to be locked for various reasons.  Unfortunately, in the XAML definition of a … Continue reading

Posted in WPF, XAML | Tagged | 4 Comments

WPF Textbox Select All on Focus

In WPF, the default behavior of the TextBox on focus is to put the cursor where it was the last time the TextBox had lost focus or if it hasn’t had focus yet, at the beginning. The users of the application wanted this to be changed so that when the TextBox got focus, all current text was selected. I found various ways to do this, but am putting this blog post together to get everything I ended up doing all in one place for easy access. Continue reading

Posted in C#, WPF | Tagged | 8 Comments

WPF MarkupExtension Class

This week I was going through StackOverflow, looking for anything I could help with and cam across someone asking about how to bind to an attribute of a class member in XAML.  I wrote a small example IValueConverter class they … Continue reading

Posted in C#, WPF, XAML | Tagged | Leave a comment

Using Style Triggers to Give ToolTips to DataGrid Columns

Working with a DataGrid on a recent project, I had to get ToolTips on all of the DataGrid column headers.  At first go around, I had used the first thing that came to my head which was to insert a … Continue reading

Posted in WPF, XAML | Tagged , , | 2 Comments

Choosing foreground using Luminosity Contrast Ratio

When a background is chosen by the user, you can use a converter that calculates luminosity contrast ratio for a black or white foreground to choose the best foreground color. Continue reading

Posted in C#, WPF | Tagged , | 5 Comments

WPF Minimal Button Styling

With all of the blog posts about Button styling in WPF since its release, it amazes me that there is very little out there about totally removing the Button default styling.  I needed an image to be my button, but … Continue reading

Posted in WPF | Tagged , | 5 Comments

WPF Date Range Double Slider Control (Part 3–Dependency Properties)

This is part 3 in a series I’m writing about a WPF User Control I’ve created and posted up on CodePlex.  In this installment, I’m going to be talking about creating dependency properties, in the DateRangeSlider, I used them to … Continue reading

Posted in C#, WPF | Tagged , | 3 Comments

WPF Date Range Double Slider Control (Part 2)

As I mentioned in my introduction to this series, I’m going over various aspects of how I implemented a control that allows a user to choose a DateTime range using a double slider control.  In Part One, I covered the … Continue reading

Posted in C#, WPF | Tagged , , | 2 Comments