I have inherited a Silverlight project with dubious code quality in general, and there is one design that I'm not sure if I should touch it:
public SomeClass Self { get { return this; } }
It is used in XAML bindings with parameters that are sometimes complex:
Visibility="{Binding Self, ConverterParameter=!, Converter={StaticResource SmartAssConverter}}"
And it is used in the PropertyChanged notification (MVVM Light):
RaisePropertyChanged("Self");
So, is there something stopping me from just doing this:
Visibility="{Binding ConverterParameter=!, Converter={StaticResource SmartAssConverter}}"
which, I tested, still looks great?
To paraphrase my question, is the need to “raise the property changed”, making this construct (IMHO ugly)?
Edit: To rephrase again, is there a more elegant solution for notifying related controls that their purpose has changed, or do I need to rework Converters?
source share