-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsettings_window.xaml.cs
More file actions
35 lines (30 loc) · 1.19 KB
/
settings_window.xaml.cs
File metadata and controls
35 lines (30 loc) · 1.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
using System.Configuration;
using System.Windows;
namespace WpfApp1
{
/// <summary>
/// Interaction logic for Window1.xaml
/// </summary>
public partial class settings_window : Window
{
public MainWindow.UpdateTimerDelegate UpdateTimer { get;set; }
public MainWindow.UpdateTotalSessionDelegate UpdateTotalSession { get; set; }
public settings_window()
{
InitializeComponent();
PomodoroTextBox.Text = Properties.Settings.Default.Pomodoro.ToString();
ShortBreakTextBox.Text = Properties.Settings.Default.ShortBreak.ToString();
SessionNumber.Text = Properties.Settings.Default.Sessions.ToString();
}
private void SaveButton_Click(object sender, RoutedEventArgs e)
{
Properties.Settings.Default.Pomodoro = int.Parse(PomodoroTextBox.Text);
Properties.Settings.Default.ShortBreak = int.Parse(ShortBreakTextBox.Text);
Properties.Settings.Default.Sessions = int.Parse(SessionNumber.Text);
Properties.Settings.Default.Save();
UpdateTotalSession.Invoke();
UpdateTimer?.Invoke();
this.Close();
}
}
}