punker76 / MahApps.Metro.SimpleChildWindow

A simple child window for MahApps.Metro
MIT License
374 stars 55 forks source link

when use validate in simplechildwindow, not display as expect #116

Closed lwqwag closed 1 year ago

lwqwag commented 4 years ago

i use validate property binding to xaml with validate, childwindow loaded first time validate errors not displayed as expect .when error has been cleared,i triggered an error,then the childwindow could display the validate error as expect just like the demo in https://github.com/lwqwag/TestMahApp Thx for your help.

timunie commented 4 years ago

Hi @lwqwag

would it be an option for you to switch to INotifyDataErrorInfo? in my experience it is better than the old way validation worked. I can provide a sample if you wish.

Happy coding Tim

lwqwag commented 4 years ago

Hi @timunie Thanks for your reply. INotifyDataErrorInfo validation method will be a option for me. Your help is greatly appreciated.

timunie commented 4 years ago

@lwqwag I am sorry, but my Idea doesn't work either. It seems to be a bug, that it does not get the Validation when loaded. By the way: Many thanks for the great example. 👍

Happy coding Tim

timunie commented 4 years ago

I investigated this issue a bit further and it turned out that the validation works correct if I wrap the Content of the ChildWindowinside an AdornerDekorator.

Here is my test branch. Maybe it helps for a solution: https://github.com/timunie/MahApps.Metro.SimpleChildWindow/tree/ValidationTest

Have a great weekend Tim

lwqwag commented 4 years ago

@timunie I tested the branch you provided,and it worked well. It's a great job! Thanks a lot again.

timunie commented 4 years ago

Good morning @lwqwag please reopen this issue. I think it is a bug anyway, because my solution was just a workaround.

Thanks, Tim

punker76 commented 1 year ago

I think it is a bug anyway,

Yeah, it's a WPF thing :-(