wpf-converters

How can WPF Converters be used in an MVVM pattern?

Let's say I have a View that is bound to ViewModel A which has an observable collection Customers. An advantage of this MVVM pattern is that I can also bind the View to ViewModel B which fills it with different data. But what if in my View converter Converters to display my customers, e.g. I have a "ContractToCustomerConverter" that ac...

WPF Converter problem

So I have an object that implements INotifyPropertyChanged, and I have a property that when it changes, it call the PropertyChanged event all right, but when I use a converter like this: <Image Grid.Column="0"> <Image.Source> <Binding Path="IsInstrumentStatusOk" UpdateSourceTrigger="PropertyChanged"> <Bindin...

How to pass an empty string as a ConverterPararmeter?

Hello I have a Binding that I am using along with a converter, I want the parameter that is transferred to the converter should be an empty string. Is there a way I can pass it via an inline binding? ...

Declare converters in the application.xaml or in individual files?

What should be the best practice to declare the converters: Declare ALL my converters in the app.xaml (i.e. in <Application.Resources/>) so it's available in the entire application. Declare on each Page/Window/ResourceDictionary/DataTemplate etc. at its Resources section, the converters I need on this page. You tell me... That's for ...

Passing more than 1 argument to a converter

Question: How can you pass an instance of an object from the view model to a converter along with the value to be converted to a converter? Info: I'm working on an inventory program for people on our factory floor who receive incoming shipments. While receiving a shipment they will mark down who the shipping company was and who the dr...

When will the ValueConverter's Convert method be called in wpf

I have an ObservableCollection bound to a list box and a boolean property bound to a button. I then defined two converters, one that operates on the collection and the other operates on the boolean property. Whenever I modify the boolean property, the converter's Convert method is called, where as the same is not called if I modify the o...

WPF Trigger Binding: What's the best way to bind an enum value to visiblity?

I have a user control (NameField). Within it I have a stackpanel containing 3 Grids: StandardView, FluidView, OtherView. Within the code-behind I have a DependencyProperty called View of type NameFieldView (enum). The enum contains STANDARD, FLUID, OTHER. I think I have to create a converter, but I'm not sure if that's necessary. I basi...

WPF: Converter on HeaderTemplate calling for each item

Hello, I have implemented grouping on a list box, where I need to show a summary row for each group. For summary row, I called a converter to give count variables to show. Code is working fine with a issue. Converter is calling for each item instead of one time for each group. Is there any way to call the converter only once for each g...