private void ButtonLog_Click(object sender, RoutedEventArgs e)
 {
     if (CurrentUser == null)
     {
         AuthorizationWindow window = new AuthorizationWindow(this)
         {
             Owner = this
         };
         if (window.ShowDialog() == true)
         {
             ButtonLog.Content           = "Log Out";
             ButtonAddFavorite.IsEnabled = true;
             ButtonFavorites.IsEnabled   = true;
         }
     }
     else
     {
         CurrentUser                 = null;
         ButtonLog.Content           = "Log In";
         ButtonAddFavorite.IsEnabled = false;
         ButtonFavorites.IsEnabled   = false;
         Db.SaveAll();
     }
 }
Beispiel #2
0
 public RegisterWindow(AuthorizationWindow owner)
 {
     InitializeComponent();
     this.owner = owner;
 }