Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6381019
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T02:20:33+00:00 2026-05-25T02:20:33+00:00

I make a Wpf-modeless-reusable window with showing animation. It’ was reused for loading performance.

  • 0

I make a Wpf-modeless-reusable window with showing animation. It’ was reused for loading performance. And then a new problem has occured.

At first, it is a MainWindow’s code behind. win1 is instance of popup window.

public partial class MainWindow : Window
{

    Window1 win1 = new Window1();

    public MainWindow() { InitializeComponent(); }

    private void button1_Click(object sender, RoutedEventArgs e) { win1.Owner = this; win1.Show(); }
    private void button2_Click(object sender, RoutedEventArgs e) { win1.Hide(); }
    private void Window_Closed(object sender, EventArgs e) { win1.Close(); }
}

And here is a popup window’s xaml…

<Window x:Class="WpfApplication4.Window1" x:Name="win"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="Window1" Height="300" Width="300" ShowActivated="False" Background="#00000000" AllowsTransparency="True" WindowStyle="None" IsVisibleChanged="Window_IsVisibleChanged">
    <Window.Resources>
        <Storyboard x:Key="aniShowing" FillBehavior="Stop">
            <ParallelTimeline BeginTime="0:0:0" Duration="0:0:2">
                <DoubleAnimation Storyboard.TargetName="win" Storyboard.TargetProperty="Opacity" From="0" To="1" Duration="0:0:2"/>
            </ParallelTimeline>
        </Storyboard>

    </Window.Resources>
    <Ellipse Fill="Red"/>
</Window>

… and finally, here is a code behind of popup window.

public partial class Window1 : Window
{

    Storyboard aniShowing;

    public Window1()
    {
        InitializeComponent();
        aniShowing = (Storyboard)this.Resources["aniShowing"];
    }

    private void Window_IsVisibleChanged(object sender, DependencyPropertyChangedEventArgs e)
    {
        if ((bool)e.NewValue == true) { this.BeginStoryboard(aniShowing); }
        else { aniShowing.Remove(this); this.Opacity = 0; }
    }
}

I want to show showing animation at Window_IsVisibleChanged. It works very well. But it’s a first time only.

In second time, win1 showed with blink at shortly, and animation was played.

third time, fourth time looks like second time, too.

how can i get rid this mysterious blink?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T02:20:34+00:00Added an answer on May 25, 2026 at 2:20 am

    I’m guessing your problem actually is that you don’t have a animation that fades out the said window, so when the button1 is clicked, it does the animation,

    Storyboard.TargetProperty="Opacity" From="0" To="1"
    

    Whatever the state it is in, it will go from 0 to 1, you see a “blink” that sets it to 0 before the animation can apply if it’s already at 1.

    To get rid of it, do the reverse animation when the window is closed (Opacity from 1 to 0 on button2 click i believe).

    PS: Hide() is the same as setting win.Visibility = Visibility.Hidden; you didn’t take into account Visibility.Collapsed.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to make a reusable WPF Window suitable for different types T. I
I want to make a WPF Window that behaves like a context menu. So,
i have a problem i make a wpf application its running well.but i want
Need to make a new WPF control and give the Caret to it. In
I would like to make a small WPF app window semi-transparent and on top
I'm trying to make a WPF UIElement that does some special rendering. The problem
I'm new to WPF and I'm trying to make a simple app, a stopwatch.
How can I make a WPF window that will never appear in the Flip3d
I want in the window of a wpf to set a treeview and make
I am trying to make a WPF Application containing a treeview, whose data will

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.