예제 #1
0
        /// <summary>
        /// This constructor supports the configuration design-time and is not intended to be used directly from your code.
        /// </summary>
        public ElementLookup(ConfigurationSourceDependency sourceModelDependency)
        {
            this.sourceModelDependency          = sourceModelDependency;
            this.sourceModelDependency.Cleared += new EventHandler(sourceModelDependency_Refresh);

            innerCollection = new CompositeCollection();
            innerCollection.Add(new CollectionContainer {
                Collection = sections
            });
            innerCollection.Add(new CollectionContainer {
                Collection = customElementViewModels
            });

            var view = ((ICollectionViewFactory)innerCollection).CreateView();

            innerCollectionChanged = view;

            allElements = view.OfType <ElementViewModel>();

            innerCollectionChanged.CollectionChanged += (sender, args) =>
            {
                if (!refreshing)
                {
                    if (args.Action == NotifyCollectionChangedAction.Reset)
                    {
                        return;
                    }
                    OnCollectionChanged(args);
                }
            };
        }
예제 #2
0
 /// <summary>
 /// This constructor supports the configuration design-time and is not intended to be used directly from your code.
 /// </summary>
 public MenuCommandService(IUnityContainer builder, AssemblyLocator assemblyLocator, ConfigurationSourceDependency configurationSourceRefresh, Profile profile)
 {
     this.configurationSourceRefresh = configurationSourceRefresh;
     this.profile = profile;
     this.builder = builder;
     this.assemblyLocator = assemblyLocator;
 }
 /// <summary>
 /// This constructor supports the configuration design-time and is not intended to be used directly from your code.
 /// </summary>
 public MenuCommandService(IUnityContainer builder, AssemblyLocator assemblyLocator, ConfigurationSourceDependency configurationSourceRefresh, Profile profile)
 {
     this.configurationSourceRefresh = configurationSourceRefresh;
     this.profile         = profile;
     this.builder         = builder;
     this.assemblyLocator = assemblyLocator;
 }
        protected override void Arrange()
        {
            base.Arrange();

            dependency = Container.Resolve<ConfigurationSourceDependency>();
            dependency.Cleared += (sender, args) => refreshed = true;
        }
 /// <summary>
 /// Initializes a new <see cref="ConfigurationSourceModel"/>.
 /// </summary>
 /// <param name="lookup">The <see cref="ElementLookup"/> service used for locating elements.</param>
 /// <param name="viewModelDependency">The <see cref="ConfigurationSourceDependency"/> for notifying others of changes in this configuration source.</param>
 /// <param name="builder">The container for building new objects.</param>
 /// <param name="uiService">The user-interface service for presenting dialogs and windows to the user.</param>
 /// <param name="saveOperation">Save operation integration with a host environment.</param>
 public ConfigurationSourceModel(ElementLookup lookup, ConfigurationSourceDependency viewModelDependency, IUnityContainer builder, IUIServiceWpf uiService, SaveOperation saveOperation)
 {
     this.uiService = uiService;
     this.builder = builder;
     this.viewModelDependency = viewModelDependency;
     this.lookup = lookup;
     this.saveOperation = saveOperation;
     sections = new ObservableCollection<SectionViewModel>();
     readOnlySectionView = new ReadOnlyObservableCollection<SectionViewModel>(sections);
 }