MVVM pattern in Xamarin login form
No, it's not correct.


View-model shouldn't contain anything related to view. It means LoginViewModel shouldn't contain references on progress bar and label. ProgressBar and Label properties inside a view-model violate MVVM.
Any changes in UI elements should be done via bindings specified in XAML. Those bindings have to be linked to properties of a view-model. Changing these properties, UI get updated.
To make bindings work you should notify them about changes in view-model. For that purpose you need to implement INotifyPropertyChanged interface on the view-model and raise PropertyChanged event every time a property changed.


Let's see example of how you can remove ProgressBar from the LoginViewModel.

First of all, view -model should implement INotifyPropertyChanged interface which contains PropertyChanged event:

public class LoginViewModel : INotifyPropertyChanged
{
    public event PropertyChangedEventHandler PropertyChanged;
}


Then remove ProgressBar property and add LoginInProgress:

private bool _loginInProgress;

public bool LoginInProgress
{
    get =&gt; _loginInProgress;
    set
    {
        if (value == _loginInProgress)
            return;

        _loginInProgress = value;
        PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(LoginInProgress)));
    }
}


Now in the LoginCommand body instead of


ProgressBar.IsVisible = true;



write

LoginInProgress = true;


And instead of


ProgressBar.IsVisible = false;



write

LoginInProgress = false;


Then in XAML bind Visibility of the progressBar to this property:

&lt;ProgressBar x:Name="progressBar"
             Visibility="{Binding Path=LoginInProgress, Mode=OneWay, Converter="{StaticResource BooleanToVisibilityConverter}"}"
             .../&gt;


Somewhere in resources you should define BooleanToVisibilityConverter:

&lt;BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"/&gt;


And that's all. You need to eliminate all the view related stuff from the view model in such way. It is how MVVM have to be implemented.