private static void LoadSavedObject(object selectedObject, ObjectEntryViewModel loadIntoForm) { var formObject = loadIntoForm.GetObject(); loadIntoForm.ApplicationController.LogEvent("Load Request Loaded", new Dictionary <string, string> { { "Type", formObject.GetType().Name } }); var mapper = new ClassSelfMapper(); mapper.Map(selectedObject, formObject); if (formObject is ServiceRequestBase) { ((ServiceRequestBase)formObject).DisplaySavedSettingFields = false; } loadIntoForm.LoadingViewModel.IsLoading = true; loadIntoForm.LoadingViewModel.LoadingMessage = "Please Wait While Loading"; //allow loading to display Thread.Sleep(1000); //reload the parent parent form fo4r the updated object loadIntoForm.Reload(); foreach (var grid in loadIntoForm.SubGrids) { grid.DynamicGridViewModel.ReloadGrid(); } loadIntoForm.ApplicationController.LogEvent("Load Request Completed", new Dictionary <string, string> { { "Type", formObject.GetType().Name }, { "Is Completed Event", true.ToString() } }); }
private static void LoadSavedObject(object selectedObject, ObjectEntryViewModel loadIntoForm) { var formObject = loadIntoForm.GetObject(); var mapper = new ClassSelfMapper(); mapper.Map(selectedObject, formObject); if (formObject is ServiceRequestBase) { ((ServiceRequestBase)formObject).DisplaySavedSettingFields = false; } loadIntoForm.LoadingViewModel.IsLoading = true; //allow loading to display Thread.Sleep(1000); //reload the parent parent form fo4r the updated object loadIntoForm.Reload(); foreach (var grid in loadIntoForm.SubGrids) { grid.DynamicGridViewModel.ReloadGrid(); } }