title: Enabled View after login my application
body: <p>I am a beginner in WPF /MVVM and I have a lot of problems.. 
  One of theses, it that I've an application with a LoginView on the left and a content view on the left.
  Theses 2 views are in the MainView like this :
  First View "MainWindow"</p>
  
  <pre><code>&lt;Window x:Class="MainWindow"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
      xmlns:local="clr-namespace:iut1"
      xmlns:ctrls="clr-namespace:iut1.Views"
      mc:Ignorable="d"
      Title="Outil de pilotage SCR" Height="650" Width="950"
      WindowStartupLocation="CenterScreen"
      DataContext="{Binding Path=MainWindowViewModel, Mode=OneWay, Source={StaticResource Locator}}"&gt;
  &lt;Grid&gt;
      &lt;Viewbox Name="vbxConnexion" HorizontalAlignment="Left" Height="623" VerticalAlignment="Top" Width="224"&gt;
          &lt;ctrls:ConnexionView&gt;&lt;/ctrls:ConnexionView&gt;
      &lt;/Viewbox&gt;
      &lt;Viewbox Name="vbxContenu" HorizontalAlignment="Left" Margin="233,0,0,0" Width="682" VerticalAlignment="Top"  RenderTransformOrigin="0.5,0.5" Height="620" Stretch="None"&gt;
          &lt;ctrls:MigrationModeleView IsEnabled="{Binding EnabledView}" Height="623" Width="653" &gt;&lt;/ctrls:MigrationModeleView&gt;
      &lt;/Viewbox&gt;
  
  
  &lt;/Grid&gt;
  </code></pre>
  
  <p></p>
  
  <p>Seconde View : "ConnexionView"</p>
  
  <pre><code>&lt;UserControl x:Class="iut1.Views.ConnexionView"
           xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
           xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
           xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
           xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
           xmlns:local="clr-namespace:iut1.Views"
           xmlns:w="clr-namespace:iut1.Classes"
           mc:Ignorable="d" 
           d:DesignHeight="720" d:DesignWidth="240"
            DataContext="{Binding Path=MainWindowViewModel, Mode=OneWay, Source={StaticResource Locator}}"&gt;
  &lt;UserControl.Resources&gt;
      &lt;w:EnumMatchToBooleanConverter x:Key="enumConverter" /&gt;
  &lt;/UserControl.Resources&gt;
  &lt;Grid Margin="10,30,-13,-18"&gt;
  
      &lt;GroupBox x:Name="gpbSource" HorizontalAlignment="Left" Margin="6,10,0,386" Width="220" Header="Environnement source" Background="{DynamicResource {x:Static SystemColors.ScrollBarBrushKey}}" &gt;
          &lt;Grid Margin="0,0,0,20"&gt;
              &lt;!--&lt;Rectangle Fill="#FFF4F4F5" HorizontalAlignment="Left" Height="317" VerticalAlignment="Top" Width="220" RadiusY="5" RadiusX="5" Stroke="Black" Opacity="0.1" Margin="0,5,0,0"/&gt;--&gt;
              &lt;Label x:Name="lblIdentifiant" Content="Identifiant de l'utilisateur :" HorizontalAlignment="Left" Margin="4,24,0,0" VerticalAlignment="Top" Width="200"/&gt;
  
              &lt;TextBox x:Name="txtNomUsager" Text="{Binding IdUtilisateur}" HorizontalAlignment="Left" Height="23" Margin="4,48,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="200" AutomationProperties.IsRequiredForForm="True" BorderThickness="2"&gt;
              &lt;/TextBox&gt;
  
              &lt;Label x:Name="Password" Content="Mot de passe :" HorizontalAlignment="Left" Margin="4,80,0,0" VerticalAlignment="Top" Width="200"/&gt;
              &lt;PasswordBox x:Name="txtMotDePasse" w:PasswordHelper.Attach="True" w:PasswordHelper.Password="{Binding PasswordUtilisateur, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" HorizontalAlignment="Left" Height="23" Margin="4,103,0,0" VerticalAlignment="Top" Width="200"/&gt;
              &lt;RadioButton x:Name="rdbUnit" IsChecked="{Binding Path=EnvironnementSource, Mode=TwoWay,Converter={StaticResource enumConverter}, ConverterParameter=Unitaire}" GroupName="envSource" Width="79" Content="Unitaire" HorizontalAlignment="Left" Margin="4,160,0,0" VerticalAlignment="Top"/&gt;
              &lt;RadioButton x:Name="rdbFonctionnel" IsChecked="{Binding Path=EnvironnementSource, Mode=TwoWay,Converter={StaticResource enumConverter}, ConverterParameter=Fonctionnel}" Content="Fonctionnel" GroupName="envSource" Width="79" HorizontalAlignment="Left" Margin="4,183,0,0" VerticalAlignment="Top"/&gt;
              &lt;RadioButton x:Name="rdbIntegre" IsChecked="{Binding Path=EnvironnementSource, Mode=TwoWay,Converter={StaticResource enumConverter}, ConverterParameter=Integre}" GroupName="envSource" Width="79" Content="Intégré" HorizontalAlignment="Left" Margin="4,206,0,0" VerticalAlignment="Top"/&gt;
              &lt;RadioButton x:Name="rdbAcceptation" IsChecked="{Binding Path=EnvironnementSource, Mode=TwoWay,Converter={StaticResource enumConverter}, ConverterParameter=Acceptation}" GroupName="envSource" Width="90" Content="Acceptation" HorizontalAlignment="Left" Margin="114,162,0,0" VerticalAlignment="Top"/&gt;
              &lt;RadioButton x:Name="rdbFormation" IsChecked="{Binding Path=EnvironnementSource, Mode=TwoWay,Converter={StaticResource enumConverter}, ConverterParameter=Formation}" GroupName="envSource" Width="90" Content="Formation" HorizontalAlignment="Left" Margin="114,183,0,0" VerticalAlignment="Top"/&gt;
              &lt;RadioButton x:Name="rdbProduction" IsChecked="{Binding Path=EnvironnementSource, Mode=TwoWay,Converter={StaticResource enumConverter}, ConverterParameter=Production}" GroupName="envSource" Width="90" Content="Production" HorizontalAlignment="Left" Margin="114,206,0,0" VerticalAlignment="Top"/&gt;
              &lt;Button x:Name="Login" Content="Connexion" HorizontalAlignment="Left" Margin="4,252,0,0" VerticalAlignment="Top" Width="200" Command="{Binding ButtonCommand}"/&gt;
          &lt;/Grid&gt;
      &lt;/GroupBox&gt;
  
      &lt;!--&lt;Rectangle Fill="#FFF4F4F5" HorizontalAlignment="Left" Height="317" VerticalAlignment="Top" Width="220" RadiusY="5" RadiusX="5" Stroke="Black" Opacity="0.1" Margin="0,350,0,-179"/&gt;--&gt;
      &lt;GroupBox Width="220"  Header="Environnement source" Margin="6,338,17,57" IsEnabled="False" Background="{DynamicResource {x:Static SystemColors.ScrollBarBrushKey}}"&gt;
          &lt;Grid Margin="0,0,0,20"&gt;
              &lt;Label x:Name="lblIdentifiantCopie" Content="Identifiant de l'utilisateur :" HorizontalAlignment="Left" Margin="4,24,0,0" VerticalAlignment="Top" Width="200"/&gt;
              &lt;TextBox x:Name="txtNomUsagerCopie" HorizontalAlignment="Left" Height="23" Margin="4,47,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="200"/&gt;
              &lt;Label x:Name="lblMotDePasseCopie" Content="Mot de passe :" HorizontalAlignment="Left" Margin="4,80,0,0" VerticalAlignment="Top" Width="200"/&gt;
              &lt;PasswordBox x:Name="txtMotDePasseCopie" HorizontalAlignment="Left" Height="23" Margin="4,103,0,0" VerticalAlignment="Top" Width="200"/&gt;
              &lt;RadioButton x:Name="rdbUnitCopie"  Width="79" Content="Unitaire" HorizontalAlignment="Left" Margin="4,160,0,0" VerticalAlignment="Top"/&gt;
              &lt;RadioButton x:Name="rdbFonctionnelCopie"  Width="79" Content="Fonctionnel" HorizontalAlignment="Left" Margin="4,183,0,0" VerticalAlignment="Top"/&gt;
              &lt;RadioButton x:Name="rdbIntegreCopie"  Width="79" Content="Intégré" HorizontalAlignment="Left" Margin="4,206,0,0" VerticalAlignment="Top"/&gt;
              &lt;RadioButton x:Name="rdbAcceptationCopie" Width="90" Content="Acceptation" HorizontalAlignment="Left" Margin="114,162,0,0" VerticalAlignment="Top"/&gt;
              &lt;RadioButton x:Name="rdbFormationCopie"  Width="90" Content="Formation" HorizontalAlignment="Left" Margin="114,183,0,0" VerticalAlignment="Top"/&gt;
              &lt;RadioButton x:Name="rdbProductionCopie"   Width="90" Content="Production" HorizontalAlignment="Left" Margin="114,206,0,0" VerticalAlignment="Top"/&gt;
              &lt;Button x:Name="btnAjout" Content="Ajouter dans l'environnement" HorizontalAlignment="Left" Margin="4,252,0,0" VerticalAlignment="Top" Width="200"/&gt;
          &lt;/Grid&gt;
      &lt;/GroupBox&gt;
  
  
  &lt;/Grid&gt;
  </code></pre>
  
  <p></p>
  
  <p>MigrationModelView</p>
  
  <pre><code>&lt;UserControl x:Class="iut1.Views.MigrationModeleView"
           xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
           xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
           xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
           xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
           xmlns:local="clr-namespace:iut1.Views"
           mc:Ignorable="d" d:DesignWidth="630" Height="587"
           xmlns:w="clr-namespace:iut1.Classes"
           DataContext="{Binding Path=MainWindowViewModel, Source={StaticResource Locator}}"&gt;
  
  &lt;Grid Margin="15,22,0,0"&gt;
      &lt;GroupBox Header="Migration de modèle de lettre" Margin="6,10,0,32"&gt;
          &lt;Grid Margin="0,0,0,4"&gt;
              &lt;Label x:Name="lblChoixPPP" Content="PPP :" HorizontalAlignment="Left" Margin="19,13,0,0" VerticalAlignment="Top"/&gt;
              &lt;ComboBox x:Name="cbxChoixPPP" HorizontalAlignment="Left" Margin="67,13,0,0" VerticalAlignment="Top" Width="120"/&gt;
              &lt;DataGrid x:Name="dgModeles" HorizontalAlignment="Left" Margin="19,61,0,0" VerticalAlignment="Top" Height="162" Width="565"&gt;
                  &lt;DataGrid.Columns&gt;
                      &lt;DataGridCheckBoxColumn Header=""/&gt;
                      &lt;DataGridTextColumn Header="Numéro de référence" Width="150" /&gt;
                      &lt;!--Binding="{Binding Nom}"--&gt;
                      &lt;DataGridTextColumn Header="Titre du modèle de lettre" /&gt;
                      &lt;!--Binding="{Binding Prenom}"--&gt;
                  &lt;/DataGrid.Columns&gt;
              &lt;/DataGrid&gt;
              &lt;Label x:Name="lblRechercher" Content="Rechercher :" HorizontalAlignment="Left" Margin="19,239,0,0" VerticalAlignment="Top"/&gt;
              &lt;TextBox x:Name="textBox" HorizontalAlignment="Left" Height="23" Margin="91,241,0,0" TextWrapping="Wrap" Text="TextBox" VerticalAlignment="Top" Width="291"/&gt;
              &lt;Button x:Name="btnAfficherTout" Content="Afficher tout" HorizontalAlignment="Left" Margin="387,244,0,0" VerticalAlignment="Top" Width="96"/&gt;
              &lt;Button x:Name="btnAfficherSelection" IsEnabled="False" Content="Afficher sélection" HorizontalAlignment="Left" Margin="488,244,0,0" VerticalAlignment="Top" Width="96"/&gt;
              &lt;DataGrid x:Name="dataGrid" HorizontalAlignment="Left" Margin="19,319,0,0" VerticalAlignment="Top" Height="162" Width="565"&gt;
                  &lt;DataGrid.Columns&gt;
                      &lt;DataGridTextColumn Header="Résultat de la copie" Width="150" /&gt;
                      &lt;DataGridTextColumn Header="" /&gt;
                  &lt;/DataGrid.Columns&gt;
              &lt;/DataGrid&gt;
              &lt;ProgressBar HorizontalAlignment="Left" Height="20" Margin="22,509,0,-26" VerticalAlignment="Top" Width="464"/&gt;
              &lt;Button x:Name="btnDetails" Height="20" IsEnabled="False" Content="Détails" HorizontalAlignment="Left" Margin="491,509,0,-26" VerticalAlignment="Top" Width="96"/&gt;
          &lt;/Grid&gt;
      &lt;/GroupBox&gt;
  &lt;/Grid&gt;
  </code></pre>
  
  <p></p>
  
  <p>I would like to enable=true my view after click on the Login button on my ConnexionView.
  I tryed a lot of thing and nothing works.</p>
  
  <p>MY VM Code :</p>
  
  <pre><code>using GalaSoft.MvvmLight.CommandWpf;
  using iut1.Classes;
  using iut1.Interfaces;
  using System;
  using System.Collections.Generic;
  using System.ComponentModel;
  using System.Linq;
  using System.Security;
  using System.Text;
  using System.Threading.Tasks;
  using System.Windows;
  using System.Windows.Input;
  
  namespace iut1.ViewModels
  {
  /// &lt;summary&gt;
  /// 
  /// &lt;/summary&gt;
  public class MainWindowViewModel : BaseViewModel, INotifyPropertyChanged
  {
      #region Proprietes privées
      private readonly DelegateCommand&lt;string&gt; _clickCommand;
  
  
  
      private string _idUtilisateur;
      private string _passwordUtilisateur;
      private string _environnementSource;
      #endregion Proprietes privées
  
      #region proprietes publiques
      public string IdUtilisateur
      {
          get { return _idUtilisateur; }
          set
          {
              _idUtilisateur = value;
              RaisePropertyChanged(nameof(IdUtilisateur));
          }
      }
      public string PasswordUtilisateur
      {
          get { return _passwordUtilisateur; }
          set
          {
              _passwordUtilisateur = value;
              RaisePropertyChanged(nameof(PasswordUtilisateur));
          }
      }
      public string EnvironnementSource
      {
          get { return _environnementSource; }
          set
          {
              _environnementSource = value;
              RaisePropertyChanged(nameof(EnvironnementSource));
          }
      }
      #endregion proprietes publiques
  
      private bool _enabledView;
      public bool EnabledView
      {
          get { return _enabledView; }
          set
          {
              if (_enabledView == value)
              {
                  return;
              }
  
                  _enabledView = value;
              RaisePropertyChanged(nameof(EnabledView));
              OnPropertyChanged(nameof(EnabledView));
          }
      }
  
  
      public MainWindowViewModel()
      {
  
  
          //ButtonCommand = new Classes.RelayCommand(new Action&lt;object&gt; (ConnectionBase));
          ButtonCommand = new Classes.RelayCommand(o =&gt; { ConnectionBase(); }, o =&gt; true);
  
  
          //_clickCommand = new DelegateCommand&lt;string&gt;(
          //    (s) =&gt; { ConnectionBase(); /* perform some action */ }
          //    );
  
          EnabledView =false;
      }
  
  
      public DelegateCommand&lt;string&gt; ButtonClickCommand
      {
          get { return _clickCommand; }
      }
  
  
  
      public event PropertyChangedEventHandler PropertyChanged;
  
      private void OnPropertyChanged(string propertyName)
      {
          if (PropertyChanged != null)
          {
              PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
          }
      }
  
  
      private void ConnectionBase()
      {
          if (Validation.ValidationConnection(IdUtilisateur, PasswordUtilisateur, EnvironnementSource))
          {
              EnabledView = true;
              OnPropertyChanged(nameof(EnabledView));
  
          }
          else
          {
              string msgErreur = "KO";
          }
      }
  
  
  
      private void Login(object parameter)
      {
  
  
          //return Validation.ValidationConnection(IdUtilisateur,     password, "ENV");
  
      }
  
  
      private ICommand _buttonCommand;
      public ICommand ButtonCommand
      {
          get
          {
              return _buttonCommand;
          }
          set
          {
              _buttonCommand = value;
          }
      }
  
  
  }
  }
  </code></pre>
  
  <p>The problem is that my view nerver become enable and I'm becoming crazy about that.</p>
  
  <p>Thank you in advance for the help.</p>