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();
            }
        }
Exemple #2
0
        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();
            }
        }