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
1
vote
1 answer

Using MultiBinding to calculate sum of multiple textboxes

Based on this previously answered question, I'm trying to create an IMultiValueConverter that will allow the Text property of a TextBox in WPF to be bound to the sum of several other TextBox values. I've mirrored the answer to the referenced…
Keven M
  • 972
  • 17
  • 47
1
vote
1 answer

IMultiValueConverter Binding from MainWindow through UserControl onto UIElement

Project Type: .NET 4.0 WPF Desktop Application Greetings. I'm currently working on a solution to utilize IMultiValueConverters in a WPF application to bind the SelectedItem properties of two ComboBoxes to the IsEnabled property of a button. The…
1
vote
2 answers

How can you pass a second bound value into a ValueConverter that is used for both Convert and ConvertBack?

We have a unique case where we need to display a custom-typed value in a DataGrid column. The custom type can be one of three values: Digital, Analog and Serial. Digitals represent either '0' or '1' in the model Analogs are integers between '0'…
Mark A. Donohoe
  • 28,442
  • 25
  • 137
  • 286
1
vote
1 answer

How to bind Start, End and Duration with Multibinding?

I have two properties in my ViewModel: public double Start { get; set; } public double Duration { get; set; } I have three textboxes in my View:
Tim Pohlmann
  • 4,140
  • 3
  • 32
  • 61
1
vote
2 answers

Passing multiple parameters including Type to ViewModel in WPF

How to pass two parameters from XAML, one Type object and one Model {Binding}, to ViewModel as CommandParameter. I came across different posts on SO but all are using control bindings. Is there any way to pass Type instead. I want something like…
Furqan Safdar
  • 16,260
  • 13
  • 59
  • 93
1
vote
3 answers

Specify target type for IValueConverter

I have a situation where I am using a multi-value converter. The values passed to it are themselves being converted.
denver
  • 2,863
  • 2
  • 31
  • 45
1
vote
1 answer

WPF Converter with Property vs MultiConverter?

What is the difference between using a Converter (IValueConverter) and passing in other values as parameters (ConverterParameter) vs using a MultiConverter (IMultiValueConverter) and just passing in multiple converter values?
myermian
  • 31,823
  • 24
  • 123
  • 215
1
vote
3 answers

How can I create a WPF TextBox that conditionally converts user input?

I want to create a TextBox that can take measurement and convert it to different units if necessary (the end result being of type double). The conversion will be controlled by a value IsMetric. If IsMetric == true then "36.5 in" would turn into…
Ben Zuill-Smith
  • 3,504
  • 3
  • 25
  • 44
1
vote
1 answer

MultiBinding with Multiple output

Lets consider an animal Model as following: public class Animal { public string name { set; get; } public int age { set; get; } } and a collection of Animal object as following: Dictionary
Dr. Strangelove
  • 2,725
  • 3
  • 34
  • 61
1
vote
2 answers

Setting background of a list of rows and columns in WPF

The problem I'm filling up a datagrid using an xmlprovider for the data. After the loading I'm trying to color "locked" columns and rows based on a list of "locked" rows & columns. "Locking" here is just a visual feedback for a certain row or column…
Jeankes
  • 159
  • 2
  • 4
  • 12
1
vote
1 answer

Need additional help with binding multiple CommandParameters using MultiBinding

I need to have a command handler for a ToggleButton that can take multiple parameters, namely the IsChecked property of said ToggleButton, along with a constant value, which could be a string, byte, int... doesn't matter. I found this great question…
Dave
  • 14,618
  • 13
  • 91
  • 145
1
vote
1 answer

MultiBinding Converter Binding

Problem with MultiBinding Converter I know it does not make sense to send the same value twice I do that to isolate on that single binding In the converter I get an error on cast to bool The value is {DependencyProperty.UnsetValue} But…
paparazzo
  • 44,497
  • 23
  • 105
  • 176
1
vote
1 answer

Converter getting value from DataGrid instead of bound object?

I'm utilizing a DataGridTextColumn bound to a data object to display various measurements in an application. I'm trying to implement a feature that allows the measurements to be displayed in different units, and thought that a Converter in the…
1
vote
1 answer

Bind Polygon.Points using a IMultiValueConverter?

I have successfully bound a Polygon's Points using a IValueConverter. Now I need to use a IMultiValueConverter. Let me outline what I am trying to accomplish first, if anyone sees a better way, tell me! I can use .NET 4.5 fyi. I have a data store…
jpiccolo
  • 768
  • 1
  • 6
  • 19
1
vote
1 answer

Sort Column of DataGrid using a MultiValueConverter

I have a datagrid with a textcolum using a MultiValueConverter. The converter got 2 values. The first depend of the current Item and the second of a TextBlock. The value displayed is what I want.
Alexandre Veya
  • 95
  • 2
  • 13
1 2 3
8 9