private void btnCancel_Click(object sender, RoutedEventArgs e)
{
this.IsEnabled = false;
LoginGrid.OpacityMask = this.Resources["ClosedBrush"] as LinearGradientBrush;
Storyboard std = this.Resources["ClosedStoryboard"] as Storyboard;
std.Completed += delegate { this.Close(); };
std.Begin();
}