Esempio n. 1
0
        public MainWindow()
        {
            InitializeComponent();

            // タイマーの間隔(ミリ秒)
            // 10秒定期
            // UI処理なのでDispatcherTimerである必要がある
            var timer = new DispatcherTimer
            {
                Interval = TimeSpan.FromMilliseconds(10000)
            };

            // タイマーの処理
            timer.Tick += (sender, e) =>
            {
                var cw = new AutoCloseWindow();
                cw.Show("10秒定期に作成されるwindowです。\n15秒後消えます", 15);
            };

            // タイマーを開始する
            timer.Start();
        }
Esempio n. 2
0
        private void bottom_Click(object sender, RoutedEventArgs e)
        {
            var cw = new AutoCloseWindow();

            cw.Show(this.bottom.Content.ToString(), 5);
        }