/// <summary> /// Executes the EditPropertiesCommand /// </summary> private void ExecuteEditPropertiesCommand() { try { //Clear old selected PropertyTypes and create new list to check //against when user finishes editing list of available/wanted Property types oldPropertyTypeValues.Clear(); foreach (SinglePropertyViewModel vm in PropertyVMs) { oldPropertyTypeValues.Add(vm, vm.PropertyType); } ////read in the currently available types var props = PropertyTypeHelper.ReadCurrentlyAvailablePropertyTypes(); propertyTypesVM.PropertyTypes.Clear(); propertyTypesVM.PropertyTypes = props; //allow user to edit list of Property Types, and write them to disk bool?result = uiVisualizerService.ShowDialog("PropertyListPopup", propertyTypesVM); if (result.HasValue && result.Value) { PropertyTypeHelper.WriteCurrentlyAvailablePropertyTypes(propertyTypesVM.PropertyTypes); } WriteOldPropertyValues(); } catch { messageBoxService.ShowError( "There was a problem obtaining the list of available property types"); } }
/// <summary> /// On activate hook up a handler for unhandled Exceptions /// </summary> protected override void OnActivated(EventArgs e) { base.OnActivated(e); //Read Available Properties PropertyTypeHelper.ReadCurrentlyAvailablePropertyTypes(); ICollectionView propTypeView = CollectionViewSource.GetDefaultView(propertyTypes); propTypeView.SortDescriptions.Add(new SortDescription()); //Read Referenced Assemblies ReferencedAssembliesHelper.ReadCurrentlyAvailableReferencedAssemblies(); ICollectionView refAssView = CollectionViewSource.GetDefaultView(referencedAssemblies); refAssView.SortDescriptions.Add(new SortDescription("Name", ListSortDirection.Ascending)); DispatcherUnhandledException += App_DispatcherUnhandledException; }