Playback with the Opacity / Visibility window requires a simple DoubleAnimation .
Example:
IsVisibleChanged += new DependencyPropertyChangedEventHandler(MainWindow_IsVisibleChanged); void MainWindow_IsVisibleChanged(object sender, DependencyPropertyChangedEventArgs e) { DoubleAnimation da = new DoubleAnimation() { From = (IsVisible) ? 0 : 1, To = (IsVisible) ? 1 : 0, Duration = TimeSpan.FromSeconds(1) }; BeginAnimation(Window.OpacityProperty, da); }
Problem:
To do this, as expected, you need to set AllowsTransparency to True in your window. If you do not set this, your window with Opacity set to 0 will be Black .
The problem is for this property to be True , you need to have WindowStyle as None . This means there is no frame around your window. This means no closure, minimization, maximization, recovery, header.
You must provide a custom template (possibly inheriting the Window class) to place these buttons there.
source share