I've inherited a Silverlight project with dubious code quality overall, and there is one construct that I'm not sure whether I should touch it:
public SomeClass Self
{
get
{
return this;
}
}
It is used in XAML Bindings, with parameters, sometimes complex like this:
Visibility="{Binding Self, ConverterParameter=!, Converter={StaticResource SmartAssConverter}}"
And it is used in a PropertyChanged notification (MVVM Light):
RaisePropertyChanged("Self");
So, is there something preventing me from just doing this:
Visibility="{Binding ConverterParameter=!, Converter={StaticResource SmartAssConverter}}"
which, I've tested, still shows just fine?
Rephrasing my question, is the necessity to 'raise property changed' forcing this kind of (IMHO ugly) construct?
Edit: rephrasing again, is there a more elegant solution to notify binded controls that their target has changed, or should I look into reworking the Converters?