WPF XAML Visibility binding with property value comparison

WPF XAML Visibility binding with property value comparison

Following on from my previous articles about 'Passing multiple parameters to an ICommand in WPF' and 'Speeding up large WPF ComboBoxes' the application stack I am currently working on has provided another article on a WPF subject!The ability to show or hide UI elements based on criteria related to other elements is nothing new; only showing an 'Other Details' text box when a drop-down value of 'Other' is selected is the bread and butter of many end-user applications. There are a number of ways of doing this in the WPF/XAML/MVVM world, the default is often the use…

Read More

Passing multiple parameters to an ICommand in WPF

Passing multiple parameters to an ICommand in WPF

The project I am currently working on is a sizable line-of-business desktop program written using the WPF framework; a framework I particularly like working with due to its extensibility and ease of design (via XAML).One of the powerful parts of WPF is the ICommand system for binding buttons to ViewModel methods; I won't go into the details of it here as it deserves an article of its own. However one of its basic functions is the ability to pass a parameter from the UI back to the ViewModel's ICommand property, such as the selected item in a data table.…

Read More

Passing Enumerables to a SQL Stored Procedure

Passing Enumerables to a SQL Stored Procedure

I have been asked the question "Can you pass an enumerable to a procedure?" or "How do you pass a table to a stored procedure" several times in the past. The simple answer is "yes", the slightly more complex answer is "yes, and this is how"!How to pass an Enumerable to a SQL Stored Procedure in .NETAlthough my example code here is in C# the same process applies to other .NET languages.You can indeed pass an enumerable object to your Stored Procedure by using a special type of SQL object called a "User Defined Table Type". UDTTs can…

Read More