CommunityToolkit / CommunityToolkit/MVVM-Samples

Questions about ObservableValidator in MVVM Toolkit Sample App

Open
#108 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
No language data
Stars
1.4k
Forks
265
PR merge metrics
No merged PRs in 30d

Description

In the MVVM Toolkit Sample App there is a sample of the ObservableValidator. I have a couple questions (thank you in advance for reading through all this)
 
```
public ValidationFormWidgetViewModel(IDialogService dialogService)
{
     DialogService = dialogService;
}
```
 
I assume the IDialogService is being passed in via DI - is that correct? Is this the preferred way to invoke a dialog from the VM?
 
There is this declaration:
 
`public event EventHandler? FormSubmissionCompleted;`
 
Later, if there are no errors it is invoked with:
 
`FormSubmissionCompleted?.Invoke(this, EventArgs.Empty);`
 
Can you explain that construct? It does not show what gets called when you invoke that. The XAML on the other hand has 
 
```

       
           
               
                   
                   
               
           
       
```
 
So I'm guessing that when FormSubmissionCompleted is invoked it tiggers the display of the SuccessInfoBar??
 
Is EventTriggerBehavior documented anywhere? I can't find it.
 
Also what is with this construct: 
 
`TargetObject="{x:Bind SuccessInfoBar}"`
 
Is that the (new?) (preferred?) way of handling a binding?

Unfortunately the namespaces are not shown as far as I can tell. Is there a complete sample that has the complete contents of all the files for ObservableValidator?

Thanks!

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.