protected override void OnInitialized(EventArgs e) { try { NoteControls = new List <NoteFragment>(); List_Notes.ItemsSource = NoteControls; List <NoteDto> notes = NotesApi.GetData(NotesApi.Execute <List <NoteDto> >("Dashboard/Notes", RestSharp.Method.GET)); if (notes.Count() > 0) { foreach (NoteDto note in notes) { NoteFragment noteControl = new NoteFragment(note); noteControl.DataContext = noteControl; //noteControl.ToggleEdit(true); NoteControls.Add(noteControl); } List_Notes.Items.Refresh(); } } catch (Exception x) { ; } base.OnInitialized(e); }
protected override void OnInitialized(EventArgs e) { try { List <NoteDto> notes = NotesApi.GetData(NotesApi.Execute <List <NoteDto> >("Dashboard/Notes", RestSharp.Method.GET)); if (notes.Count() > 0) { foreach (NoteDto note in notes) { NoteFragment noteControl = new NoteFragment(note); noteControl.DataContext = noteControl; //noteControl.ToggleEdit(true); NoteControls.Add(noteControl); } List_Notes.ItemsSource = NoteControls; List_Organizations.ItemsSource = NoteControls; List_Projects.ItemsSource = NoteControls; } //List<OrganizationDto> organizations = NotesApi.GetData(NotesApi.Execute<List<OrganizationDto>>("Dashboard/Organizations", RestSharp.Method.GET)); //if (organizations.Count() > 0) //{ // foreach (OrganizationDto organization in organizations) // { // OrganizationFragment organizationControl = new OrganizationFragment(organization); // organizationControl.DataContext = organizationControl; // //organizationControl.ToggleEdit(true); // OrganizationControls.Add(organizationControl); // } // List_Organizations.ItemsSource = OrganizationControls; // List_Organizations.ItemsSource = OrganizationControls; // List_Projects.ItemsSource = OrganizationControls; //} //List<ProjectDto> projects = NotesApi.GetData(NotesApi.Execute<List<ProjectDto>>("Dashboard/Projects", RestSharp.Method.GET)); //if (projects.Count() > 0) //{ // foreach (ProjectDto project in projects) // { // ProjectFragment projectControl = new ProjectFragment(project); // projectControl.DataContext = projectControl; // //projectControl.ToggleEdit(true); // ProjectControls.Add(projectControl); // } // List_Projects.ItemsSource = ProjectControls; // List_Organizations.ItemsSource = ProjectControls; // List_Projects.ItemsSource = ProjectControls; //} } catch (Exception x) { ; } base.OnInitialized(e); }
private void Button_AddNote_Click(object sender, RoutedEventArgs e) { try { NoteDto note = NotesApi.GetData(NotesApi.Execute <NoteDto>("Dashboard/CreateNote", RestSharp.Method.GET)); if (note != null) { NoteFragment noteControl = new NoteFragment(note); noteControl.DataContext = noteControl; noteControl.ToggleEdit(true); NoteControls.Add(noteControl); List_Notes.Items.Refresh(); } } catch (Exception x) { ; } }