private void HideErrorUI() { DoubleAnimation d = (DoubleAnimation)this.FindResource("HideErrorOverlay"); if (d != null) { ErrorOverlay.BeginAnimation(OpacityProperty, d); } }
private void HideErrorUI() { DoubleAnimation d = (DoubleAnimation)this.FindResource("HideErrorOverlay"); d.Completed += new EventHandler(d_Completed); if (d != null) { ErrorOverlay.BeginAnimation(OpacityProperty, d); } }
private void ShowErrorUI() { ImageSource src = null; if (_IsInitializing) { src = XamlDocument.PreviewImage; } else { // update the error image ColorOverlayImage.Source = RenderHelper.HwndToBitmap(ContentArea.Handle); this.XamlDocument.PreviewImage = RenderHelper.HwndToGrayscaleBitmap(ContentArea.Handle); src = XamlDocument.PreviewImage; } Color c = Color.FromArgb(255, 216, 216, 216); if (src is BitmapSource) { CroppedBitmap croppedSrc = new CroppedBitmap((BitmapSource)src, new Int32Rect(0, 0, 1, 1)); byte[] pixels = new byte[4]; croppedSrc.CopyPixels(pixels, 4, 0); c = Color.FromArgb(255, pixels[0], pixels[1], pixels[2]); } ErrorOverlayImage.Source = src; ErrorOverlay.Background = new SolidColorBrush(c); ColorOverlayImage.Visibility = Visibility.Visible; ContentArea.Visibility = Visibility.Collapsed; DoubleAnimation d = (DoubleAnimation)this.FindResource("ShowErrorOverlay"); //d.Completed += new EventHandler(ErrorOverlayAnimationCompleted); if (d != null) { ErrorOverlay.BeginAnimation(OpacityProperty, d); } }