private NotepadViewModel() { _svc = new NotepadServiceClient(); _svc.GetNotesCompleted += new EventHandler<GetNotesCompletedEventArgs>(_svc_GetNotesCompleted); _svc.AddNoteCompleted += new EventHandler<AddNoteCompletedEventArgs>(_svc_AddNoteCompleted); _svc.UpdateNoteCompleted += new EventHandler<AsyncCompletedEventArgs>(_svc_UpdateNoteCompleted); _svc.AddUserCompleted += new EventHandler<AddUserCompletedEventArgs>(_svc_AddUserCompleted); _svc.DeleteNoteCompleted += new EventHandler<AsyncCompletedEventArgs>(_svc_DeleteNoteCompleted); if(this.NeedUserId) { this.Notes = new ObservableCollection<NoteDto>(); } else { this.RebindData(); } }
private NotepadViewModel() { _svc = new NotepadServiceClient(); _svc.GetNotesCompleted += new EventHandler <GetNotesCompletedEventArgs>(_svc_GetNotesCompleted); _svc.AddNoteCompleted += new EventHandler <AddNoteCompletedEventArgs>(_svc_AddNoteCompleted); _svc.UpdateNoteCompleted += new EventHandler <AsyncCompletedEventArgs>(_svc_UpdateNoteCompleted); _svc.AddUserCompleted += new EventHandler <AddUserCompletedEventArgs>(_svc_AddUserCompleted); _svc.DeleteNoteCompleted += new EventHandler <AsyncCompletedEventArgs>(_svc_DeleteNoteCompleted); if (this.NeedUserId) { this.Notes = new ObservableCollection <NoteDto>(); } else { this.RebindData(); } }