Created login and error handling to get auth token. Refreshing not handled.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user