consolidate all repos to one for archive
This commit is contained in:
53
semester_3/uporabniski_vmesniki/MyApp/SettingsWindow.xaml.cs
Normal file
53
semester_3/uporabniski_vmesniki/MyApp/SettingsWindow.xaml.cs
Normal file
@@ -0,0 +1,53 @@
|
||||
using System;
|
||||
using System.Windows;
|
||||
|
||||
namespace MyApp
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaction logic for Settings.xaml
|
||||
/// </summary>
|
||||
public partial class SettingsWindow : Window
|
||||
{
|
||||
ProgramData data;
|
||||
internal SettingsWindow(ProgramData pD)
|
||||
{
|
||||
InitializeComponent();
|
||||
data = pD;
|
||||
GenreListView.ItemsSource = data.GenreList;
|
||||
}
|
||||
|
||||
private void Add_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (InputTextBox.Text != "")
|
||||
data.GenreList.Add(InputTextBox.Text);
|
||||
}
|
||||
|
||||
private void Remove_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (GenreListView.SelectedItem is String s)
|
||||
{
|
||||
data.GenreList.Remove(s);
|
||||
}
|
||||
}
|
||||
|
||||
private void CheckBox_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (CheckAutoSave.IsChecked is bool check)
|
||||
{
|
||||
if (Owner is MainWindow my)
|
||||
{
|
||||
if (check)
|
||||
{
|
||||
my.timer.Start();
|
||||
data.AutoSave = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
my.timer.Stop();
|
||||
data.AutoSave = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user