private void loadOperation_Completed(LoadOperation <DocumentManager.Web.Model.filetype> sender)
 {
     FileTypeList.Clear();
     fileTypeSource.Source = sender.Entities;
     foreach (DocumentManager.Web.Model.filetype filetype in sender.Entities)
     {
         FileTypeEntity fileTypeEntity = new FileTypeEntity();
         fileTypeEntity.FileType = filetype;
         fileTypeEntity.Update();
         FileTypeList.Add(fileTypeEntity);
     }
     UpdateChanged("FileTypeList");
     IsBusy = false;
 }
        private void loadOperationFileType_Completed(object sender, EventArgs e)
        {
            FileTypeList.Clear();
            FileTypeDictionary.Clear();
            LoadOperation loadOperation = sender as LoadOperation;

            foreach (Web.Model.filetype filetype in loadOperation.Entities)
            {
                FileTypeEntity lFileTypeEntity = new FileTypeEntity();
                lFileTypeEntity.FileType = filetype;
                lFileTypeEntity.Update();
                FileTypeList.Add(lFileTypeEntity);
                FileTypeDictionary.Add(lFileTypeEntity.FileTypeId, lFileTypeEntity);
            }

            DocumentViewModel.FileTypeEntityDictionary = FileTypeDictionary;
            DocumentViewModel.FileTypeEntityList       = FileTypeList;

            LoadOperation <DocumentManager.Web.Model.user> loadOperationUser =
                documentManagerContext.Load <DocumentManager.Web.Model.user>(documentManagerContext.GetUserQuery());

            loadOperationUser.Completed += loadOperationUser_Completed;
        }