private void FromDomaintoSettingsCompleted(object sender, EventArgs e) { DomainInfoGrid.Visibility = Visibility.Hidden; SettingsGrid.Visibility = Visibility.Visible; var Animation = new DoubleAnimation(); Animation.From = 0.2; Animation.To = 1; Animation.Duration = TimeSpan.FromSeconds(2.5); SettingsGrid.BeginAnimation(OpacityProperty, Animation); Params.CurrentPage = "Settings"; }
private void ScanFileImg_MouseLeftButtonDown(object sender, MouseButtonEventArgs e) { if (Params.CurrentPage != "") { switch (Params.CurrentPage) { case "ScanFile": break; case "ScanURL": var Animation1 = new DoubleAnimation(); Animation1.From = 1; Animation1.To = 0.2; Animation1.Duration = TimeSpan.FromSeconds(2.5); Animation1.Completed += new EventHandler(FromURLtoFileCompleted); ScanURLGrid.BeginAnimation(OpacityProperty, Animation1); break; case "IPInfo": var Animation2 = new DoubleAnimation(); Animation2.From = 1; Animation2.To = 0.2; Animation2.Duration = TimeSpan.FromSeconds(2.5); Animation2.Completed += new EventHandler(FromIPtoFileCompleted); IPInfoGrid.BeginAnimation(OpacityProperty, Animation2); break; case "DomainInfo": var Animation3 = new DoubleAnimation(); Animation3.From = 1; Animation3.To = 0.2; Animation3.Duration = TimeSpan.FromSeconds(2.5); Animation3.Completed += new EventHandler(FromDomaintoFileCompleted); DomainInfoGrid.BeginAnimation(OpacityProperty, Animation3); break; case "Settings": var Animation4 = new DoubleAnimation(); Animation4.From = 1; Animation4.To = 0.2; Animation4.Duration = TimeSpan.FromSeconds(2.5); Animation4.Completed += new EventHandler(FromSettingstoFileCompleted); SettingsGrid.BeginAnimation(OpacityProperty, Animation4); break; } } else { var Animation = new ThicknessAnimation(); Animation.From = new Thickness(0, 0, 0, 0); Animation.To = new Thickness(0, -400, 0, 31); Animation.Duration = TimeSpan.FromSeconds(0.7); MainImageGrid.BeginAnimation(MarginProperty, Animation); var Animation1 = new DoubleAnimation(); Animation1.From = 1; Animation1.To = 0.1; Animation1.Duration = TimeSpan.FromSeconds(0.7); Animation1.Completed += new EventHandler(FromMainImageToScanFile); MainImageGrid.BeginAnimation(OpacityProperty, Animation1); var Animation4 = new DoubleAnimation(); Animation4.From = 0.1; Animation4.To = 1; Animation4.Duration = TimeSpan.FromSeconds(2.5); ScanFileGrid.BeginAnimation(OpacityProperty, Animation4); var Animation3 = new ThicknessAnimation(); Animation3.From = new Thickness(0, 264, 0, 0); Animation3.To = new Thickness(0, 303, 0, 0); Animation3.Duration = TimeSpan.FromSeconds(0.4); ControlPanelGrid.BeginAnimation(MarginProperty, Animation3); Params.CurrentPage = "ScanFile"; } }