Skip to content

Commit 38c9677

Browse files
committed
Added closing time.
1 parent 9d76645 commit 38c9677

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

CutCode/Views/NotificationDialogView.xaml.cs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
using System.Windows.Media;
1414
using System.Windows.Media.Imaging;
1515
using System.Windows.Shapes;
16+
using System.Windows.Threading;
1617

1718
namespace CutCode
1819
{
@@ -38,8 +39,15 @@ public NotificationDialogView()
3839
Top = mainView.Top + mainView.Height - (Height + 10);
3940
Left = mainView.Left + mainView.Width - (Width + 10);
4041
}
42+
43+
var closeTimer = new DispatcherTimer
44+
{
45+
Interval = TimeSpan.FromSeconds(3),
46+
IsEnabled = true
47+
};
48+
closeTimer.Tick += exitBtnClick;
4149
}
4250

43-
private void exitBtnClick(object sender, RoutedEventArgs e) => Close();
51+
private void exitBtnClick(object sender, EventArgs e) => Close();
4452
}
4553
}

0 commit comments

Comments
 (0)