Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/nkristek/wpf.converters

A collection of often used converters to write a WPF based application
https://github.com/nkristek/wpf.converters

converter csharp dotnet dotnet-framework hacktoberfest imultivalueconverter ivalueconverter nuget nuget-package wpf xaml

Last synced: 23 days ago
JSON representation

A collection of often used converters to write a WPF based application

Awesome Lists containing this project

README

        

# Wpf.Converters

[![CI Status](https://github.com/nkristek/Wpf.Converters/workflows/CI/badge.svg)](https://github.com/nkristek/Wpf.Converters/actions)
[![NuGet version](https://img.shields.io/nuget/v/NKristek.Wpf.Converters.svg)](https://www.nuget.org/packages/NKristek.Wpf.Converters/)

This library contains a collection of often used converters to write a WPF based application.

## Installation

The recommended way to use this library is via [Nuget](https://www.nuget.org/packages/nkristek.Wpf.Converters/).

Currently supported frameworks:
- .NET Framework 3.5 or higher
- .NET Core 3.0 or higher

## Getting started

Import it via:
```xaml
xmlns:c="clr-namespace:NKristek.Wpf.Converters;assembly=NKristek.Wpf.Converters"
```

You can use a converter from this library either by using the MarkupExtension*:
```xaml

```
or static instance:
```xaml

```
or of course create instances in the views:
```xaml

```

You can also use the ```ValueConverterChain``` converter*, which executes the given converters in succession. Please note, that the TargetType is only correctly set, when the ```ValueConversionAttribute``` is set on the ```IValueConverter```.

```xaml


```
The above use of the ```ValueConverterChain``` would be equivalent to the ```ValueNullToInverseBoolConverter```.

*: Only available if target framework is >= .NET 4.0.

## Overview

Bool:
- BoolToInverseBoolConverter
- ValueNullToBoolConverter
- ValueNullToInverseBoolConverter
- StringNullOrEmptyToBoolConverter
- StringNullOrEmptyToInverseBoolConverter
- ICollectionNullOrEmptyToBoolConverter
- ICollectionNullOrEmptyToInverseBoolConverter
- AllBoolToBoolConverter
- AllBoolToInverseBoolConverter
- AnyBoolToBoolConverter
- AnyBoolToInverseBoolConverter
- ObjectToStringEqualsParameterToBoolConverter
- ObjectToStringEqualsParameterToInverseBoolConverter

Visibility:
- VisibilityToInverseVisibilityConverter
- BoolToVisibilityConverter
- BoolToInverseVisibilityConverter
- ValueNullToVisibilityConverter
- ValueNullToInverseVisibilityConverter
- StringNullOrEmptyToVisibilityConverter
- StringNullOrEmptyToInverseVisibilityConverter
- ICollectionNullOrEmptyToVisibilityConverter
- ICollectionNullOrEmptyToInverseVisibilityConverter
- AllBoolToVisibilityConverter
- AllBoolToInverseVisibilityConverter
- AnyBoolToVisibilityConverter
- AnyBoolToInverseVisibilityConverter
- ObjectToStringEqualsParameterToVisibilityConverter
- ObjectToStringEqualsParameterToInverseVisibilityConverter

Other:
- DateTimeToStringConverter
- ValueConverterChain

## Contribution

If you find a bug feel free to open an issue. Contributions are also appreciated.