Quantcast
Channel: patterns & practices: Prism
Viewing all articles
Browse latest Browse all 1878

Created Unassigned: Implementing INotifyDataErrorInfo example in documentation isn't working [10660]

$
0
0
I tried to implement the INotifyDataErrorInfo based on this example in the documentation.

[Implementing INotifyDataErrorInfo](http://msdn.microsoft.com/en-us/library/gg405484(v=pandp.40).aspx#sec16)

The problem is in this line
```
private ErrorsContainer<ValidationResult> errorsContainer =
new ErrorsContainer<ValidationResult>(
pn => this.RaiseErrorsChanged( pn ) );
```

"Cannot access non static method "RaiseErrorsChanged" in static context"

This line hast to be replaced with this code

```
private ErrorsContainer<ValidationResult> _errorsContainer;

private ErrorsContainer<ValidationResult> ErrorsContainer
{
get
{
return _errorsContainer ??
(_errorsContainer = new ErrorsContainer<ValidationResult>(RaiseErrorsChanged));
}
}
```

I think someone has done this already, but forget to update the complete example.
Because if you look on the other lines of the example, you will find several calls to the "ErrorsContainer" property instead of the "errorsContainer" field.

For example:
```
public bool HasErrors
{
get { return this.ErrorsContainer.HasErrors; }
}
```

It would be nice if this could be fixed, so that the next one doesn't waste another half an hour on google, before solves it by him self ;-)

Viewing all articles
Browse latest Browse all 1878

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>