private void AppearCopiedIndicator() { _copyIndicatorVisible = true; var opacityAppear = new DoubleAnimation(1.0, new Duration(TimeSpan.FromMilliseconds(300))); opacityAppear.EasingFunction = new CubicEase() { EasingMode = EasingMode.EaseInOut }; var resize = new DoubleAnimation(56, new Duration(TimeSpan.FromMilliseconds(300))); resize.EasingFunction = new CubicEase() { EasingMode = EasingMode.EaseInOut }; ColorCopiedNotificationBorder.BeginAnimation(Border.OpacityProperty, opacityAppear); ColorCopiedNotificationBorder.BeginAnimation(Border.HeightProperty, resize); var clipboardNotification = ((Decorator)ColorCopiedNotificationBorder).Child; if (clipboardNotification == null) { return; } var peer = UIElementAutomationPeer.FromElement(clipboardNotification); if (peer == null) { peer = UIElementAutomationPeer.CreatePeerForElement(clipboardNotification); } peer.RaiseAutomationEvent(AutomationEvents.MenuOpened); }
private void HideCopiedIndicator() { _copyIndicatorVisible = false; var opacityDisappear = new DoubleAnimation(0, new Duration(TimeSpan.FromMilliseconds(300))); opacityDisappear.EasingFunction = new CubicEase() { EasingMode = EasingMode.EaseInOut }; var resize = new DoubleAnimation(0, new Duration(TimeSpan.FromMilliseconds(300))); resize.EasingFunction = new CubicEase() { EasingMode = EasingMode.EaseInOut }; ColorCopiedNotificationBorder.BeginAnimation(Border.OpacityProperty, opacityDisappear); ColorCopiedNotificationBorder.BeginAnimation(Border.HeightProperty, resize); }