private async void ShowInfoPanel(string s) { InfoWindowLabel.Text = s; InfoWindow.Visibility = Visibility.Visible; DoubleAnimation dAnim = new DoubleAnimation(0, 1, new TimeSpan(0, 0, 0, 0, 500)); InfoWindow.BeginAnimation(OpacityProperty, dAnim); await Task.Delay(2000); DoubleAnimation anim = new DoubleAnimation(1, 0, new TimeSpan(0, 0, 0, 0, 500)); InfoWindow.BeginAnimation(OpacityProperty, anim); await Task.Delay(500); InfoWindow.Visibility = Visibility.Hidden; }
/// <summary> /// Show Help window in a dialog /// </summary> internal static void InfoDialogWindow() { if (InfoWindow == null) { InfoWindow = new InfoWindow { Owner = GetMainWindow, Opacity = 0 }; } else { if (InfoWindow.Visibility == Visibility.Visible) { InfoWindow.Focus(); } } InfoWindow.Width = GetMainWindow.ActualWidth; InfoWindow.Height = GetMainWindow.ActualHeight; InfoWindow.Left = GetMainWindow.Left + (GetMainWindow.Width - InfoWindow.Width) / 2; InfoWindow.Top = GetMainWindow.Top + (GetMainWindow.Height - InfoWindow.Height) / 2; GetMainWindow.Effect = new BlurEffect { RenderingBias = RenderingBias.Quality, KernelType = KernelType.Gaussian, Radius = 9 }; InfoWindow.BeginAnimation(Window.OpacityProperty, new DoubleAnimation { From = 0, To = 1, Duration = TimeSpan.FromSeconds(.3) }); InfoWindow.ShowDialog(); #if DEBUG Trace.WriteLine("HelpWindow loaded "); #endif }
private void ErrorWindowAnimation(object obj) { string message = obj.ToString(); Action action = () => InfoWindowBorder.Background = new SolidColorBrush(Color.FromRgb(236, 131, 133)); this.Dispatcher.Invoke(action); action = () => InfoWindowText.Foreground = new SolidColorBrush(Color.FromRgb(156, 25, 27)); this.Dispatcher.Invoke(action); action = () => InfoWindowBorder.BorderBrush = new SolidColorBrush(Color.FromRgb(156, 25, 27)); this.Dispatcher.Invoke(action); action = () => InfoWindowText.Content = message; this.Dispatcher.Invoke(action); action = () => InfoWindow.BeginAnimation(MarginProperty, InAnimation()); this.Dispatcher.Invoke(action); Thread.Sleep(1500); action = () => InfoWindow.BeginAnimation(MarginProperty, OutAnimation()); this.Dispatcher.Invoke(action); }