reactiveui / ReactiveUI.Validation

Validation helpers for ReactiveUI-based apps.
https://reactiveui.net/docs/handbook/user-input-validation
MIT License
236 stars 24 forks source link

WPF ValidationRule is not working when call ShowDialog #236

Open leeveel opened 3 years ago

leeveel commented 3 years ago

platform: .net wpf version: ReactiveUI.WPF 13.2.2, Validation 2.1.1

Describe the bug xxxWindow win = new xxxxWindow(); -----> inherit from ReactiveValidationObject win.ShowDialog(); ---->ValidationRule is not working win.Show(); ------> It's ok

BekAllaev commented 3 years ago

Looks like that INotifyDataErrorInfo Support does not work even if show dialog by calling Show method.

Additional info: Two-way binding via XAML also does not work in that case.

ScarletKuro commented 2 years ago

Any repro code or details? Everything is working for me. This is implemented via ReactiveValidationObject and using INotifyDataErrorInfo for WPF and calls ShowDialog(). Make sure you using it via xaml binding, not the BindValidation. Also try to use base(Scheduler.Immediate)

xxxWindow win = new xxxxWindow(); -----> inherit from ReactiveValidationObject

This ReactiveValidationObject kinda should be in the ViewModel not the View.

img ReactiveUI.Validation: 2.1.1 ReactiveUI: 14.1.1

phamviethuy commented 2 months ago

@leeveel I encounter the same problem. do you have any solutions?