Example #1
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="windowNavigationService"></param>
        public SolutionService(IEventAggregator eventAggregator, IWindowNavigationService windowNavigationService)
        {
            this.eventAggregator         = eventAggregator;
            this.windowNavigationService = windowNavigationService;

            this.TempFolderPath = System.IO.Path.GetTempPath() + "DaVinciTemporary" + "\\";
        }
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="solutionService"></param>
        public AddPageViewModel(ISolutionService solutionService, IWindowNavigationService windowNavigationService, IEventAggregator eventAggregator) : base(Guid.NewGuid().ToString())
        {
            this.solutionService         = solutionService;
            this.windowNavigationService = windowNavigationService;
            this.eventAggregator         = eventAggregator;

            this.SelectLogoButtonCommand = new DelegateCommand(ExecuteSelectLogoButtonCommand, CanExecuteSelectLogoButtonCommand);
        }
Example #3
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="solutionService"></param>
        /// <param name="windowNavigationService"></param>
        public AddSectionViewModel(ISolutionService solutionService, IWindowNavigationService windowNavigationService) : base(Guid.NewGuid().ToString())
        {
            this.solutionService         = solutionService;
            this.windowNavigationService = windowNavigationService;

            this.BannerSection    = new Banner();
            this.MetroSection     = new MetroSection();
            this.BasicSection     = new BasicSection();
            this.ParagraphSection = new ParagraphSection();
            this.ImageSection     = new ImageSection();
            this.CardsSection     = new CardsSection();
            this.BlogSection      = new BlogSection();
            this.GallerySection   = new GallerySection();

            this.SelectBackgroundImageButtonCommand = new DelegateCommand <Section>(ExecuteSelectBackgroundImageButtonCommand, CanExecuteSelectBackgroundImageButtonCommand);
            this.AddSubParagraphCommand             = new DelegateCommand <ParagraphSection>(ExecuteAddSubParagraphCommand, CanExecuteAddSubParagraphCommand);
            this.AddImageInfoCommand          = new DelegateCommand <ImageSection>(ExecuteAddImageInfoCommand, CanExecuteAddImageInfoCommand);
            this.SelectImageInfoButtonCommand = new DelegateCommand <ImageInfo>(ExecuteSelectImageInfoButtonCommand, CanExecuteSelectImageInfoButtonCommand);
            this.ImageInfoRemoveCommand       = new DelegateCommand <ImageInfo>(ExecuteImageInfoRemoveCommand, CanExecuteImageInfoRemoveCommand);
            this.AddCardButtonCommand         = new DelegateCommand <CardsSection>(ExecuteAddCardButtonCommand, CanExecuteAddCardButtonCommand);
            this.SubParagraphRemoveCommand    = new DelegateCommand <SubParagraph>(ExecuteSubParagraphRemoveCommand, CanExecuteSubParagraphRemoveCommand);
        }
Example #4
0
        public MainViewModel(IWindowNavigationService windowDlgService)
        {
            if (IsInDesignMode == false)
            {
                _WindowNaviService = windowDlgService;

                LibraryTransactionsAggregate = new LibraryTransactionsAggregate();

                var shortRfidReader = SimpleIoc.Default.GetInstance <IRFIDReader>("short");
                shortRfidReader.StartReader();
                AuthenticationViewModel.LibraryUserEventHandler += (s, e) =>
                {
                    if (e.LibraryUserEventType == VMMessages.UserEvent.UserEventType.Login)
                    {
                        LibraryTransactionsAggregate.PrepareForNewUser(e.LibraryUser);
                        shortRfidReader.TagRead += ShortRfidReader_TagRead;
                    }
                    else
                    {
                        LibraryTransactionsAggregate.Reset();
                        shortRfidReader.TagRead -= ShortRfidReader_TagRead;
                    }
                };

                MessengerInstance.Register <ApplicationExiting>(this, (x) =>
                {
                    shortRfidReader.StopReader();
                });
            }
            else
            {
                LibraryTransactionsAggregate = new LibraryTransactionsAggregate();
                LibraryTransactionsAggregate.AddTransaction("D3-46-EC-EA-90-00");
                LibraryTransactionsAggregate.AddTransaction("23-DF-EC-EA-90-00");
                LibraryTransactionsAggregate.AddTransaction("93-BE-EA-EA-90-00");
                LibraryTransactionsAggregate.AddTransaction("D3-DE-EC-EA-90-00");
            }
        }
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="guid"></param>
        public DesignerViewModel(ISolutionService solutionService, IWindowNavigationService windowNavigationService, IEventAggregator eventAggregator) : base(Guid.NewGuid().ToString())
        {
            this.solutionService         = solutionService;
            this.windowNavigationService = windowNavigationService;
            this.eventAggregator         = eventAggregator;

            this.AddSectionVMI   = new ModalViewMenuItem(102, typeof(Views.AddSectionView), "NewSection", "List");
            this.AddPageVMI      = new ModalViewMenuItem(103, typeof(Views.AddPageView), "NewPage", "Clone");
            this.SiteSettingsVMI = new ModalViewMenuItem(104, typeof(Views.SiteSettingsView), "SiteSettings", "Clone");

            this.AddSectionButtonCommand   = new DelegateCommand(ExecuteAddSectionButtonCommand, CanExecuteAddSectionButtonCommand);
            this.AddNewPageCommand         = new DelegateCommand(ExecuteAddNewPageCommand, CanExecuteAddNewPageCommand);
            this.EditSectionCommand        = new DelegateCommand <Section>(ExecuteEditSectionCommand, CanExecuteEditSectionCommand);
            this.DeleteSectionCommand      = new DelegateCommand <Section>(ExecuteDeleteSectionCommand, CanExecuteDeleteSectionCommand);
            this.MoveUpSectionCommand      = new DelegateCommand <Section>(ExecuteMoveUpSectionCommand, CanExecuteMoveUpSectionCommand);
            this.MoveDownSectionCommand    = new DelegateCommand <Section>(ExecuteMoveDownSectionCommand, CanExecuteMoveDownSectionCommand);
            this.PageSettingsButtonCommand = new DelegateCommand(ExecutePageSettingsButtonCommand, CanExecutePageSettingsButtonCommand);
            this.SiteSettingsButtonCommand = new DelegateCommand(ExecuteSiteSettingsButtonCommand, CanExecuteSiteSettingsButtonCommand);

            this.CurrentProject = this.solutionService.CurrentSolution.ProjectList.FirstOrDefault();

            this.eventAggregator.GetEvent <Events.PageAddedEvent>().Subscribe(OnPageAdded);
        }
 public WindowManager(IWindowNavigationService windowNavigationService)
 {
     WindowNavigationService = windowNavigationService;
 }
Example #7
0
        public LeftSidePanelViewModel(IGuiRoutingService guiRoutingService, IRegionManager regionManager, IWindowNavigationService windowNavigationService) : base(Guid.NewGuid().ToString())
        {
            this.guiRoutingService       = guiRoutingService;
            this.regionManager           = regionManager;
            this.WindowNavigationService = windowNavigationService;

            this.LeftSidePanelCommand = new DelegateCommand(LeftSidePanelCommandExecute);

            this.MainViewMenuItems = new ObservableCollection <IViewMenuItem>(this.guiRoutingService.MainViewMenuItems);
        }
Example #8
0
        /// <summary>
        /// Constructor
        /// </summary>
        public BaseViewModel(string guid)
        {
            this.TargetName = guid;

            this.windowNavigationService = ServiceLocator.Current.GetInstance <IWindowNavigationService>();
        }