Total Blog Posts: 19

In this sixth part of my multi-part series on the WPF list box, you explore searching and filtering. If you wish to provide your user with the ability to search for data within your list box, there are a few ways to do so. Three different methods are going to be explored in this blog post; simple text searching using built-in list box functionality, build your own search method, and use the filtering on the CollectionViewSource object. The first method is easy to implement and simple for the user. The second method is ideal if you wish to allow your user to input one or many values to search upon. The third method is good if only one search field is being used.)

#wpf #listbox #pauldsheriff #development #programming

In this fifth part of a series of blog posts on the WPF list box, you are going to learn to use the CollectionViewSource class in .NET to group Product data on one of the columns. The CollectionViewSource class can be created in XAML and passed parameters in order to group the product data coming from your data source. In addition, you may instantiate a CollectionViewSource class in code and change the grouping of the data based on a user selection.)

#wpf #listbox #pauldsheriff #development #programming

In this fourth part of a series of blog posts on the WPF list box, you are going to learn to use the CollectionViewSource class in .NET to sort data. The CollectionViewSource class can be created in XAML and passed parameters in order to sort the data coming from your data source. In addition, you may instantiate a CollectionViewSource class in code and sort the data based on a user selection.)

#wpf #listbox #pauldsheriff #development #programming

This is part three of a series of blog posts on using the WPF list box. In this post you learn to use data triggers allow you to change how each row is presented based on data in your data source. You can use a single trigger or multiple triggers depending on your needs. You are also going to build a converter class to accept two or more pieces of data and the return value is used as a data trigger.)

#wpf #listbox #pauldsheriff #development #programming

This is part two of a series of blog posts on using the WPF list box. In this post you change a list box to display rows horizontally instead of vertically. You learn to change list box templates dynamically at runtime. Finally, you learn to pass multiple pieces of data from your data source to a converter class and have that class return a single piece of data to be displayed.)

#wpf #listbox #pauldsheriff #development #programming

The WPF ListBox is a very versatile control. In this multi-part series of blog posts, you will be shown a myriad of ways to coerce the ListBox to work the way you want. You will learn how to create multi-row and column items with images, how to change the information displayed in each row dynamically, and how to present the list box horizontally. You will also learn to use data triggers, sorting, grouping, and filtering. In this post, you learn to add multiple rows and columns to each row of your list box.)

#wpf #listbox #pauldsheriff #development #programming

In the last blog post you learned how to populate data into a Combo Box, a List Box and a Data Grid. In each of the previous samples, you just used the default display for those controls. In this blog post you learn to control how the data is displayed using templates. In addition, you learn to use a List View control to display tabular data.)

#wpf #pauldsheriff #development #programming

WPF has several controls that allow you to display a list of data to the user. In this blog post you are going to learn the basics of displaying product data in a Combo Box, a List Box and a Data Grid. In the next post you are going to learn to customize the look of the basic controls using templates. To use these list controls, you are going to create an Entity Framework entity class and a DbContext class to retrieve data from the AdventureWorksLT sample database that comes with SQL Server. You are going to create a view model class to interface with the WPF list controls.)

#wpf #pauldsheriff #development #programming

In most business applications, users wish to filter data that has been displayed to them. This blog post is not about how you filter, per se, but how to display the filtering options to the user. In the first scenario, an expander control where the user selects values to filter is used. In the second scenario, the filters are displayed within the column header on the data grid control. The third scenario ensures that column headers are aligned consistently across each column.)

#wpf #pauldsheriff #development #programming

If you have a WPF screen that is made up of two of more 'sections,' where each section has its own unique functionality, you might want to consider breaking each of those pieces of the screen into individual user controls and individual view model classes. This will help you build, run, and test each component. You can then aggregate the user controls into one control and inherit from one view model to the other to bring them all together. In this blog post, you are going to build upon the sample created in the post entitled 'Basics of MVVM in WPF.' Read and download that sample application to follow along with this blog post.)

#wpf #mvvm #architecture #pauldsheriff #development #programming

In this blog post, you learn how easy it is to use the Model-View-View-Model (MVVM) design pattern in WPF applications. This blog post is a step-by-step illustration of how to build a WPF application to display a list of users.)

#wpf #mvvm #architecture #pauldsheriff #development #programming

In any application, you want to keep the coupling between any two or more objects as loose as possible. Coupling happens when one class contains a property that is used in another class or uses another class in one of its methods. If you have this situation, then this is called strong or tight coupling. One popular design pattern to help with keeping objects loosely coupled is called the mediator design pattern. The basics of this pattern are very simple; avoid one object directly talking to another object, and instead use another class to mediate between the two. This class is called a message broker. The purpose of this blog post is show you a simple approach to using a message broker in your XAML applications.)

#wpf #messagebroker #architecture #pauldsheriff #development #programming

In this blog post, you learn to create a standard architecture for your WPF applications. You learn what common classes you need, what kind of library to put those classes into, and how each of the libraries are referenced from your main application.)

#wpf #architecture #pauldsheriff #development #programming

One of my most widely-read blog posts had to do with creating a Login Windows in WPF that I wrote several years ago. I thought I would revisit this login screen with an updated version in Visual Studio 2012 and with an updated look and feel.)

#wpf #login #xaml #pauldsheriff #development #programming

Some of our customers are asking us to give them a Windows 8 look and feel for their applications. This includes things like buttons, tiles, application bars, and other features. In this blog post I will describe how to create a button that looks similar to those you will find in a Windows 8 application bar.)

#wpf #button #image #ui #pauldsheriff #development #programming

Instead of a normal button with words, sometimes you want a button that is just graphical. Yes, you can put an Image control in the Content of a normal Button control, but you still have the button outline, and trying to change the style can be rather difficult. Instead I like creating a user control that simulates a button, but just accepts an image. Figure 1 shows an example of three of these custom user controls to represent minimize, maximize and close buttons for a borderless window. Notice the highlighted image button has a gray rectangle around it. You will learn how to highlight using the VisualStateManager in this blog post.)

#wpf #button #image #ui #pauldsheriff #development #programming

You go to great pains to add styles, colors, gradients, and a really cool look and feel to your WPF application only to have that ruined by the standard Windows message box as shown in Figure 1. What would be nice is if Microsoft offered a styled message box. But, they don't. So it is up to us to create a window that we can style and do whatever we want with it.)

#wpf #styles #messagebox #ui #pauldsheriff #development #programming

In Figure 1 you can see examples of the standard WPF Button controls. You can add a drop shadow and you can change the color, but you can't change much else without creating a whole new control template. For example, you are unable to modify the BorderBrush or the BorderThickness properties of the Button control. Additionally you might want to use some other animation than the default, which again requires you to change the control template. Sometimes all you want to do is to just have some simple buttons where you can modify the border brush and the thickness and have different color options via styles. I have found that instead of working with the whole control template thing, just creating a User Control is sometimes much easier.)

#wpf #usercontrol #button #ui #pauldsheriff #development #programming

Earlier this year I blogged on how to use the WPF Tree View to view multiple levels. Since then I have had many requests to do the same in WPF. Luckily, the code is almost identical. Here is a blog post on using the WPF Tree View that has multiple levels.)

#wpf #treeview #pauldsheriff #development #programming