https://github.com/distantcam/wpfconverters
https://github.com/distantcam/wpfconverters
Last synced: 9 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/distantcam/wpfconverters
- Owner: distantcam
- License: mit
- Created: 2016-01-14T12:06:43.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2016-03-11T14:59:16.000Z (over 10 years ago)
- Last Synced: 2025-01-05T05:45:55.754Z (over 1 year ago)
- Language: C#
- Size: 13.7 KB
- Stars: 3
- Watchers: 5
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: readme.md
- License: license.txt
Awesome Lists containing this project
README
# WPFConverters
- [](https://ci.appveyor.com/project/distantcam/wpfconverters)
- [](https://www.nuget.org/packages/WPFConverters/)
WPF Converters is a collection of common converters for WPF.
The namespace for the converters is `xmlns:con="http://schemas.macfar.land/wpfconverters"`
- [BaseConverter](#baseconverter) - A base class for implementing your own converter.
- [BitmapImageConverter](#bitmapimageconverter) - Converts a `Url` (or `string`) to a `BitmapImage`.
- [BoolToBrushConverter](#booltobrushconverter) - Converts a `bool` to a `Brush`.
- [BoolToVisibilityConverter](#booltovisibilityconverter) - Converts a `bool` to `Visibility`.
- [ColorToBrushConverter](#colortobrushconverter) - Converts a `Color` to a `Brush`.
- [NullToVisibilityConverter](#nulltovisibilityconverter) - Converts `null` to `Visibility`.
- [StringEmptyOrNullToVisibilityConverter](#stringemptyornulltovisibilityconverter) - Convert an empty or `null` `string` to `Visibility`.
---
## BaseConverter
A helper class for implementing converters.
Instead of throwing an exception if your converter fails, return `DependencyProperty.UnsetValue` instead.
---
## BitmapImageConverter
Converts a `Url` (or `string`) to a `BitmapImage`.
```
```
---
## BoolToBrushConverter
Converts a `bool` to a `Brush`.
- `FalseBrush` - The `Brush` to use for false.
- `TrueBrush` - The `Brush` to use for true.
```
```
---
## BoolToVisibilityConverter
Converts a bool to Visibility. Defaults to `Visibility.Collapsed`.
- `Invert` - Reverses the converter (true is collapsed, false is visible).
- `IsHidden` - Use `Visibility.Hidden` for false values (or true values if `Invert` is also true).
```
```
---
## ColorToBrushConverter
Converts a `Color` to a `Brush`.
```
```
---
## NullToVisibilityConverter
Converts `null` to `Visibility`
- `Invert` - Reverses the converter (true is collapsed, false is visible).
- `IsHidden` - Use `Visibility.Hidden` for false values (or true values if `Invert` is also true).
```
```
---
## StringEmptyOrNullToVisibilityConverter
Convert an empty or `null` `string` to `Visibility`.
- `Invert` - Reverses the converter (true is collapsed, false is visible).
- `IsHidden` - Use `Visibility.Hidden` for false values (or true values if `Invert` is also true).
```
```