Comments (12)
Sounds like a sensible option, but surely you'd change the POCO property to be IsHidden rather than IsVisible?
from umbraco-ditto.
The issue really pops up when you have multiple checkbox options and you've named them because of how the checkbox works so you end up with HideX, ShowX depending on what the default action should be. The only reason for this suggestions is so that on your viewmodel at least, you can reference them all in the same way.
from umbraco-ditto.
Sure, I see! I'd probably go for InvertedBooleanValueResolver though, personally find it more descriptive than a BooleanValueResolver with a flag inverting things.
from umbraco-ditto.
Hmm, I wonder if this should actually be an InvertBooleanTypeConverter rather than a value resolver as at this point you know it's resovled as boolean, and it's a case of converting it (ie, inverting it)
Note to self, the lines between Value Resolvers and Type Converters can get a little blury :)
from umbraco-ditto.
Yea, I'm still not up to speed yet as I've not used 0.7.0 in anger. My mind is still in the TypeConverter frame of mind.
from umbraco-ditto.
Wadda you know, this works :)
from umbraco-ditto.
badda bing, badda boom! (instant regret for typing that, leaving it there anyways)
from umbraco-ditto.
Sweet! Well I'm happy with this as a solution so gonna class it as closed. Thanks for you input @jamiepollock (I'll ignore your last comment ;))
from umbraco-ditto.
I know you've closed this, but it got me thinking about the difference between ValueResolvers and TypeConverters... my take on it here would be that you are manipulating the value, so that would come under a resolver. Whereas if you were changing the type, that would be a converter.
I dunno... apples and oranges
from umbraco-ditto.
I think this is where the lines blur. To me, you've resolved a value already, which is the boolean, then you want to convert it into another type, which in this case is an inverted boolean.
Like I say, you could do either, I just think this is less messy, ie, you don't have an attribute config setting that only applies if the value is boolean.
If we find loads of people asking for it, we can review that decision.
from umbraco-ditto.
from umbraco-ditto.
I'm kinda glad this is closed as it feels a little icky to me. Inversion like this should be blatantly obvious in the code. I like to be able to trace a models properties easily from the back office to my view.
from umbraco-ditto.
Related Issues (20)
- DittoCache examples HOT 2
- Changes to lazy properties HOT 7
- Documentation using GitHub Pages HOT 2
- How to bind my model with an action to a DitFloView PartialView HOT 22
- UmbracoPicker returns wrong IPublishedContent in Umbraco 7.5.3 HOT 7
- Base Processor - exposing Umbraco context services HOT 5
- Custom Processor Contexts only persist a single .As() HOT 18
- Ditto Factory misusing `PluginManager.ResolveTypes`? HOT 10
- Ability to Conditionally Stop Processor Chain HOT 24
- XPath Processor? HOT 6
- Decimal mapping always 0 for negative values HOT 7
- Constructor Cache is no longer used HOT 3
- Orphaned Archetype Properties Cause Null Exception During Mapping HOT 3
- Migration to UMCO HOT 1
- Ditto-centric Stack Trace HOT 4
- Ditto processor attributes require a DittoProcessorMetaData attribute to be applied to the class but none was found. HOT 36
- Support for Umbraco v8 HOT 1
- Getting EntryPointNotFoundException on ditto objects HOT 2
- Excessive memory usage HOT 9
- Casting IPublishedContent to specific Model using Ditto mixing up property values between nodes on the same level HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from umbraco-ditto.