Created login and error handling to get auth token. Refreshing not handled.

This commit is contained in:
Patrick Fic
2020-01-16 18:43:50 -08:00
parent 0daf17a3f0
commit cfec5327dd
17 changed files with 625 additions and 47 deletions

View File

@@ -5,6 +5,7 @@ using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Controls.Primitives;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
@@ -23,5 +24,43 @@ namespace BodyshopUploader.Views
{
InitializeComponent();
}
private void PasswordBox_PasswordChanged(object sender, RoutedEventArgs e)
{
if (this.DataContext != null)
{ ((dynamic)this.DataContext).UserPassword = ((PasswordBox)sender).SecurePassword; }
}
private void PasswordBox_KeyDown(object sender, System.Windows.Input.KeyEventArgs e)
{
var pb = sender as PasswordBox;
if ((Keyboard.GetKeyStates(Key.CapsLock) & KeyStates.Toggled) == KeyStates.Toggled)
{
if (pb.ToolTip == null)
{
ToolTip tt = new ToolTip();
tt.Content = "Warning: CapsLock is on";
tt.PlacementTarget = sender as UIElement;
tt.Placement = PlacementMode.Right;
pb.ToolTip = tt;
tt.IsOpen = true;
}
}
else
{
var currentToolTip = pb.ToolTip as ToolTip;
if (currentToolTip != null)
{
currentToolTip.IsOpen = false;
}
pb.ToolTip = null;
}
}
private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
{
Application.Current.Shutdown(0);
}
}
}