示例#1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="WorkbenchViewModel"/> class.
        /// </summary>
        /// <param name="host">The host.</param>
        public WorkbenchViewModel()
        {
            if (!Designer.IsDesignMode)
            {
                this.Remove = new RemoveCommands(this, this.Handle);
                this.Edit   = new EditCommands(this, this.Handle);

                ConfigureTimers();
                PluginContext.Host.UserConnected += (sender, e) =>
                {
                    this.Refresher.Component
                            = this.Remove.Component
                            = this.Edit.Component
                            = PluginContext.ComponentFactory.GetInstance <IAdministrationComponent>();
                };

                var component = PluginContext.ComponentFactory.GetInstance <IAdministrationComponent>();
                this.Refresher = new WorkbenchRefresher(this, component, this.Handle);
                this.Refresher.Component
                        = this.Remove.Component
                        = this.Edit.Component
                        = component;
            }
            #region Instanciate collections
            this.Insurances  = new ObservableCollection <InsuranceDto>();
            this.Practices   = new ObservableCollection <PracticeDto>();
            this.Pathologies = new ObservableCollection <PathologyDto>();
            this.Drugs       = new ObservableCollection <DrugDto>();
            this.Reputations = new ObservableCollection <ReputationDto>();
            this.Professions = new ObservableCollection <ProfessionDto>();
            this.Tags        = new ObservableCollection <TagViewModel>();
            this.Doctors     = new ObservableCollection <DoctorDto>();
            this.SearchTags  = new ObservableCollection <SearchTagDto>();
            #endregion
        }
示例#2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="WorkbenchViewModel"/> class.
        /// </summary>
        /// <param name="host">The host.</param>
        public WorkbenchViewModel()
        {
            if (!Designer.IsDesignMode)
            {
                this.Remove = new RemoveCommands(this, this.Handle);
                this.Edit = new EditCommands(this, this.Handle);

                ConfigureTimers();
                PluginContext.Host.UserConnected += (sender, e) =>
                {
                    this.Refresher.Component
                        = this.Remove.Component
                        = this.Edit.Component
                        = PluginContext.ComponentFactory.GetInstance<IAdministrationComponent>();
                };

                var component = PluginContext.ComponentFactory.GetInstance<IAdministrationComponent>();
                this.Refresher = new WorkbenchRefresher(this, component, this.Handle);
                this.Refresher.Component
                    = this.Remove.Component
                    = this.Edit.Component
                    = component;

            }
            #region Instanciate collections
            this.Insurances = new ObservableCollection<InsuranceDto>();
            this.Practices = new ObservableCollection<PracticeDto>();
            this.Pathologies = new ObservableCollection<PathologyDto>();
            this.Drugs = new ObservableCollection<DrugDto>();
            this.Reputations = new ObservableCollection<ReputationDto>();
            this.Professions = new ObservableCollection<ProfessionDto>();
            this.Tags = new ObservableCollection<TagViewModel>();
            this.Doctors = new ObservableCollection<DoctorDto>();
            this.SearchTags = new ObservableCollection<SearchTagDto>();
            #endregion
        }