I like to bind to static properties whenever I can (e.g. when notification is not needed or when model anyway implement INotifyPropertyChanged
for other purposes), e.g.:
Visibility="{Binding IsAdministractor, Source={x:Static local:User.Current}, Converter={local:FalseToCollapsedConverter}}"
The problem is that such evaluation works at design-time too, making it hard to work with designer.
Normal bindings doesn't work in design-time and I can utilize FallbackValue
to specify design-time only values (I have never yet used FallbackValue
in run-time).
Is there an easy way to make binding to static properties invalid (disable them) during design-time?
I can temporarily rename property, e.g. IsAdministrator123
, but this is tedious.