Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

Issue with auto closing fad-able message box

$
0
0

Hi,

I have a Notify Message Box which will notify and fade in 2 seconds.

This is called when the tree node selection changes.

But after calling this message box with this.Close() in animationcompleted() or timer_tick() the focus moved to parent of newly selected tree item automatically.

This is my class

 public partial class NotificationWindow : Window
    {
        public NotificationWindow(string msg)
        {
            InitializeComponent();
            this.msg.Text = msg;
            this.Left = 100;
            this.Top = 100;
            this.Topmost=true;
        }
        public static void Show(string msg)
        {
            new NotificationWindow(msg).Show();
        }
        private void DoubleAnimationUsingKeyFrames_Completed(object sender, EventArgs e)
        {
            this.Close();
        }
    }

I am calling this as 

NotificationWindow.Show("Changes has been saved");

Please help me to resolve this issue.

Regards,

Sasikala




Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>