-
Hey all, I'm currently researching porting one of our desktop applications that makes heavy use of DevExpress tooling for both controls, and speedier MVVM workflow. ReactiveUI seems very similar for the MVVM stuff, but there are some things we take for granted in DX as far as validation goes for which I haven't been able to find a good equivalent in Avalonia/Reactive, and any advice would be much appreciated. First, and example of how a ViewModel might be set up in DX:
We use a simple metadata builder to define validation rules. These can be as simple or as complex as needed. Viewmodels are instanced with the static Create() method, which takes care of automatically registering the virtual properties with change notifications and whatnot at runtime. Now, some xaml of a bound control:
With those things set up, we get a textbox like this when we run: My question is, how can I get the equivalent effect in Avalonia? I've had some success with a ViewModel like the following:
When bound to a textbox, it does appear to get a red border when validation is not met, but I don't get any icon nor tooltip indicating as much (although I've seen other Avalonia users asking about validation with such an icon and matching error tooltip). What is the preferred/correct way to do this with MVVM in the Avalonia framework? Am I on the right path? Completely off? Looking for something that isn't implemented? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
@SCLDGit does your mvvm framework implement You can see an example custom implementation here... or ReactiveUI has inbuilt validation support. However id have thought your existing framework would implement that interface and be compatible? |
Beta Was this translation helpful? Give feedback.
-
This came down to #5497 . Validation currently works as expected when using the Default theme. Only the Fluent theme has the issue where the error is not displayed as a tooltip. |
Beta Was this translation helpful? Give feedback.
This came down to #5497 . Validation currently works as expected when using the Default theme. Only the Fluent theme has the issue where the error is not displayed as a tooltip.