-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMainWindow.xaml.cs
44 lines (38 loc) · 1015 Bytes
/
MainWindow.xaml.cs
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
36
37
38
39
40
41
42
43
44
using System.Collections.Generic;
using System.Windows;
using System.Data.SQLite;
using System.ComponentModel;
using System;
using System.Windows.Input;
namespace HelloWPF
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
}
protected void btnAddTask_Click(object sender, RoutedEventArgs e)
{
TodoItem task = new TodoItem() {Title = taskBox.Text};
icTodoList.Items.Add(task);
taskBox.Clear();
}
private void btnDelTask_Click(object sender, RoutedEventArgs e)
{
Console.WriteLine("Delete clicked");
icTodoList.Items.Remove(icTodoList.SelectedItem);
}
}
public class TodoItem
{
public string Title { get; set; }
public override string ToString()
{
return this.Title;
}
}
}