Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return errors as ObservableCollection<object> #362

Open
xperiandri opened this issue Mar 6, 2021 · 9 comments
Open

Return errors as ObservableCollection<object> #362

xperiandri opened this issue Mar 6, 2021 · 9 comments

Comments

@xperiandri
Copy link

When doing validation with https://github.com/lfr/FSharp.Domain.Validation or https://github.com/JamesRandall/AccidentalFish.FSharp.Validation you can have mo than one error per property.
UWP does not have native support of INotifayDataErrorInfo so that we created our control that displays errors via ItemsControl which prefers ObservableCollection as ItemsSource

I think that validation errors must be returned similar to Binding.oneWaySeq where you can set comparers and merge new errors seq into old errors and update UI (ItemsControl) accordingly.

@xperiandri
Copy link
Author

xperiandri commented Mar 6, 2021

I will show the proposed changes the next week

@TysonMN
Copy link
Member

TysonMN commented Mar 6, 2021

That makes sense. I am open other ways to handle validation errors.

I am interested to see the proposed change.

@TysonMN
Copy link
Member

TysonMN commented Mar 8, 2021

The user is free to expose "errors" (just like any other data) via a OneWaySeq or SubModelSeq binding. I have not thought very hard about the tradeoffs between the current/INotifayDataErrorInfo approach and this alternative approach.

@xperiandri
Copy link
Author

#379

@TysonMN
Copy link
Member

TysonMN commented Jun 30, 2021

In the suggested / proposed change is, would Elmish.WPF continue to use INotifyDataErrorInfo or stop using it?

@xperiandri
Copy link
Author

Continue

@TysonMN
Copy link
Member

TysonMN commented Sep 8, 2021

@xperiandri, the animation I saw in UWP with addition/removal from an ObservableCollection<> looked great. I assume that this requires the more complicated keyed merge (aka a merge that uses IDs).

What would the animation look like if the unkeyed (aka merge that doesn't use IDs) were used? Can you record that animation would look like and share it here in a comment as an animated GIF?

@xperiandri
Copy link
Author

Do you want me to record it with your merge algorithm?

@TysonMN
Copy link
Member

TysonMN commented Sep 8, 2021

Yes, that would be preferred. Maybe you could record the animation for both algorithms so that the difference is clear to us.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants