public TimeTablePageTimeTableNote(string Subject, string Teacher) { InitializeComponent(); this.Subject.Text = Subject; this.Teacher.Text = Teacher; logic = new NotesPageVM(new SQLiteDataService(), App.currentUser); NotesOfSubject = ((List <Note>)logic.GetNotes()).Where(x => x.SubjectID == Subject).ToList(); FillNotes(); buttonOk.Click += EndWorkWithNotes; check.Click += MarkAll; buttonCheckedDone.Click += DeleteMarked; toSortByTime.Click += SortByTime; toSortByTitle.Click += SortByTitle; }
/// <summary> /// Method for filling notes /// </summary> /// <remarks> /// Notes are preserved in stack /// </remarks> private void fillNotes() { this.content.stack.Children.Clear(); int cnt = 0; foreach (var note in logic.GetNotes()) { NotesPageNoteBlock temp = new NotesPageNoteBlock(note); temp.MouseDown += NotesPageBlock_MouseDown; if (cnt++ % 2 == 1) { temp.grid.Background = new SolidColorBrush(Colors.LightGray); } this.content.stack.Children.Add(temp); } }
public NotesPage() { this.logic = new NotesPageVM(new SQLiteDataService(), App.currentUser); logic.GetNotes(); InitializeComponent(); navbar.button_Profile.Click += Navbar_Button_Profile_Click; navbar.button_FAQ.Click += Navbar_Button_FAQ_Click; navbar.button_Notes.Click += Navbar_Button_Notes_Click; navbar.button_TimeTable.Click += Navbar_Button_TimeTable_Click; navbar.button_Notes.Style = Application.Current.Resources["MenuButtonActive"] as Style; content.button_delete.Click += Content_Button_delete_Click; content.button_add.MouseDown += Content_Button_add_MouseDown; content.button_sortCreated.Click += Content_Button_sortCreated_Click; content.button_sortDeadline.Click += Content_Button_sortDeadline_Click; content.button_sortSubject.Click += Content_Button_sortCreated_Click; content.button_sortName.Click += Content_Button_sortDeadline_Click; SortNotes(sorted); searchBar.textSearch.KeyDown += SearchBar_TextSearch_Search_On_KeyDown; }