Questions tagged [imultivalueconverter]

IMultiValueConverter is an interface defined in Microsoft .NET WPF and used with MultiBinding data binding. Implementors of the interface have the opportunity to compose or convert items from multiple input collections into a single output collection.

The Microsoft .NET WPF MultiBinding object requires that you provide an IMultiValueConverter implementation when specifying multiple input collections in the MultiBinding object. The multivalue converter's job is to decide how to combine the elements from the multiple input collections. The IMultiValueConverter implementation can also filter elements, returning only a subset of the items found in the input collections.

For more details, see the MSDN documentation for IMultiValueConverter

133 questions
19
votes
2 answers

How to set the ValueConversion attribut for a IMultiValueConverter

I changed my converter from IValueConverter to IMultiValueConverter : Previously I converted int to string : [ValueConversion(typeof(int), typeof(string))] But now I convert an int and a double to a string. How should I specify my ValueConversion…
Nicolas
  • 6,289
  • 4
  • 36
  • 51
11
votes
2 answers

WPF: Is there a way to get original values in ConvertBack method of MultiValueConverter?

I've written a MultiValueConverter which checks if a given list contains a given value and returns true if it does. I use it for binding to custom checkbox list. Now I'd like to write ConvertBack method so that if checkbox was checked, original…
aks
  • 292
  • 1
  • 5
  • 12
7
votes
1 answer

What are the special values of WPF's Binding engine when converting values?

I already know about the Binding.DoNothing that one can return from an IValueConverter implementation to signify that no other operation should take place. However, I cannot find a reference, or documentation nicely summing out, what the other…
Jean Hominal
  • 16,518
  • 5
  • 56
  • 90
6
votes
2 answers

implementing IMultiValueConverter to convert between units

I'm working on an invoicing system, and am using a DataGrid for item entry. I want users to be able to enter the quantities in different units (e.g. inches, feet, meters) and for that entered quantity to be converted to the item's stocking units. My…
Saad Imran.
  • 4,480
  • 2
  • 23
  • 33
6
votes
1 answer

How to Pass multiple parameter in Multivalue Converter Over WPF DataTrigger

I'm having four int Property ProOne, ProTwo, ProThree and ProFour I have to Implement the Boolean Logic ((ProOne == ProTwo) || (ProThree == ProFour)) in the Multivalue Converter namely VisibilityCheckConverter. Based on the Logic the Multivalue…
B.Balamanigandan
  • 4,713
  • 11
  • 68
  • 130
6
votes
1 answer

What has happened to MultiBinding between .NET 3.5 and .NET 4.5?

We are currently in the process of converting a project from version 3.5 to version 4.5 of .NET. We set a text box IsEnabled flagged using a multi binding with a multi binding converter. Each of the bindings has their own converter. All worked…
ghnz
  • 190
  • 6
5
votes
3 answers

Is IMultiValueConverter Available for UWP

I am converting a WPF to UWP and it uses a number of IMultiValueConverters. I can't find any reference for IMultiValueConverter.  Is it available in UWP? If not, if there an alternative?
IwillMinkin
  • 107
  • 3
5
votes
1 answer

Are there any builtin IMultiValueConverts in WPF?

I'm writing a MultiBinding containing two bindings - each returning a bool. Using MultiBindings you need to specify an IMultiValueConverter. In my case this converter should take two bools and return the AND of them. This is really simple to write,…
stiank81
  • 25,418
  • 43
  • 131
  • 202
4
votes
2 answers

WPF Converter in GridViewColumn - keep values for ConvertBack-Method and have own Binding-Instance for each row

I have a GridView with some columns displaying materials. The viewmodel values are all saved in kg, for some of the the view should convert and display them as liters. Which is easily done the one way using a IMultiValueConverter. public object…
ChriPf
  • 2,700
  • 1
  • 23
  • 25
4
votes
2 answers

What is the proper way to bind to a value while showing a friendly name from a list of presets also defined on that item?

Got a tough one. Consider a ViewModel that is comprised of a list of objects, where each object defines an int value, and some of those objects also define a Presets dictionary of ints keyed on a 'friendly' string representing that value in the…
Mark A. Donohoe
  • 28,442
  • 25
  • 137
  • 286
3
votes
1 answer

How to force a WPF multi-binding to update when inside a ComboBox TemplateSelector?

As a preface, this question comes from extending this answer on how to make the selected item look different from the dropdown items in a ComboBox. I'm trying to make my custom selected item use information from the ComboBox's Tag attribute. Since I…
David
  • 4,744
  • 5
  • 33
  • 64
3
votes
1 answer

Loading images source dynamically with IValueConverter

I've problems with IValueconverter and dynamically load a row grid image: public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { string Type = (string)value; Uri uri; try …
davymartu
  • 1,393
  • 3
  • 15
  • 34
3
votes
1 answer

Wpf Data Binding using IMultiValueConverter and casting errors

As part of learning WPF I just finished working through an MS Lab Exercise called "Using Data Binding in WPF" (http://windowsclient.net/downloads/folders/hands-on-labs/entry3729.aspx). To illustrate using an IMultiValueConverter, there is a…
Berryl
  • 12,471
  • 22
  • 98
  • 182
2
votes
1 answer

Parameters for IMultiValueConverter always the same?

I have a simple converter inheriting from IMultiValueConverter that takes in 2 parameters (in the values array). public class TicketNoConverter : IMultiValueConverter { public object Convert(object[] values, Type targetType, object parameter,…
gcso
  • 2,315
  • 3
  • 28
  • 50
1
2 3
8 9