Ok, it was a nice surprise (after writing it several times) to find that there already is a BooleanToVisibilityConverter in System.Windows.Controls namespace.
Probably there are more such hidden time-savers.
Anyone got some?
A Value Converter functions as a bridge between a target and a source and it is necessary when a target is bound with one source, for instance you have a text box and a button control. You want to enable or disable the button control when the text of the text box is filled or null.
Introduction. Value converters are used in Data binding. When source object type and target object type are different at that time value converts are used to manipulate data between source and target. Converter class must implement IValueConverter interface.
WPF, stands for Windows Presentation Foundation is a development framework and a sub-system of . NET Framework. WPF is used to build Windows client applications that run on Windows operating system. WPF uses XAML as its frontend language and C# as its backend languages.
I did a quick trawl using the Object Browser and this is what I have.
Derived from IValueConverter:
System.Windows.Controls.AlternationConverterSystem.Windows.Controls.BooleanToVisibilityConverterSystem.Windows.Documents.ZoomPercentageConverterSystem.Windows.Navigation.JournalEntryListConverter
Xceed.Wpf.DataGrid.Converters.CurrencyConverterXceed.Wpf.DataGrid.Converters.DateTimeToStringConverterXceed.Wpf.DataGrid.Converters.GreaterThanZeroConverterXceed.Wpf.DataGrid.Converters.IndexToOddConverterXceed.Wpf.DataGrid.Converters.IntAdditionConverterXceed.Wpf.DataGrid.Converters.InverseBooleanConverterXceed.Wpf.DataGrid.Converters.LevelToOpacityConverterXceed.Wpf.DataGrid.Converters.MultimodalResultConverterXceed.Wpf.DataGrid.Converters.NegativeDoubleConverterXceed.Wpf.DataGrid.Converters.NullToBooleanConverterXceed.Wpf.DataGrid.Converters.SourceDataConverterXceed.Wpf.DataGrid.Converters.StringFormatConverterXceed.Wpf.DataGrid.Converters.ThicknessConverterXceed.Wpf.DataGrid.Converters.TypeToBooleanConverterXceed.Wpf.DataGrid.Converters.TypeToVisibilityConverterXceed.Wpf.DataGrid.Converters.ValueToMaskedTextConverter
Derived from IMultiValueConverter:
System.Windows.Controls.BorderGapMaskConverterSystem.Windows.Navigation.JournalEntryUnifiedViewConverterSystem.Windows.Controls.MenuScrollingVisibilityConverter
Microsoft.Windows.Themes.ProgressBarBrushConverterMicrosoft.Windows.Themes.ProgressBarHighlightConverter
Note the Xceed ones (no connection) are available free with their DataGrid. As well as those there's some clever stuff around like the debugging converter. I've also used the last IValueConverter and I'm sure there's some further lambda function goodness to be found, too.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With