thomasgalliker / ValueConverters.NET

A collection of commonly used IValueConverters for .NET applications
MIT License
148 stars 25 forks source link

Feature/add subtract converters #16

Closed sa-he closed 5 years ago

sa-he commented 5 years ago

Please check if that meets your requirements - I tried to adapt to your approaches and base classes.

I can only compile full netframework stuff, not xamarin and uwp parts...

https://github.com/thomasgalliker/ValueConverters.NET/issues/15

thomasgalliker commented 5 years ago

Ah ok, I thought the 'IsInverted' was already part of StringIsNullOrEmptyConverter.... cool thanks. I just had a quick look: It looks good. I'll check it out and merge it asap.

sa-he commented 5 years ago

Any progress on this one? I'd have ideas for more converters, but I'd need you to merge PR's and publish nuget packages. Otherwise I contribute but still have to maintain my local copy of the converter...

thomasgalliker commented 5 years ago

Ups... yes 💯 sorry for the delay. I'm recently a bit under fire (like everyone I guess). I'm coming back to this.

thomasgalliker commented 5 years ago

I'm not 100% sure if these two converters (AddConverter, SubtractConverter) are such a great value. Don't get me wrong. I think such logic does a better job in a view model. Don't you think so too? On the otherhand side you can argue, that you don't want to bloat your view models, agree. But what if someone wants to add/subtract (or multiply) decimals, floats, etc. Of course, we could make the converters generic, but this would lead to more/unnecessarily complex code.

What is your use case for these converters?

sa-he commented 5 years ago

I see your concerns. Thank you for merging the PR though. I use the converter in a MVVM app that draws little rectangles on a canvas. Canvas.Left/Top are bound to model.X/Y which define the center of a rectangle. As the size of the rectangle is a matter of the view, I decided to use a converter. It's an exotic use case - I admit.