Example #1
0
        private bool IsNameCollision(string name)
        {
            NodeViewModel node = PageNoteModel.GetInstance().NoteList.FirstOrDefault(x => x.NoteName == name);

            if (node != null && node != this)
            {
                return(true);
            }
            return(false);
        }
        public PageNoteFieldsViewModel()
        {
            this.AddNoteCommand     = new DelegateCommand <object>(AddNoteExecute, CanExecuteAddNote);
            this.MoveUpCommand      = new DelegateCommand <object>(MoveUpExecute, CanExecuteMoveUp);
            this.MoveDownCommand    = new DelegateCommand <object>(MoveDownExecute, CanExecuteMoveDown);
            this.DeleteNodeCommand  = new DelegateCommand <object>(DeleteNodeExecute, CanExecuteDeleteNode);
            this.CloseWindowCommand = new DelegateCommand <Window>(CloseWindowExecute);
            //NoteList = new ObservableCollection<Node>();

            _model = PageNoteModel.GetInstance();

            IDocumentService doc = ServiceLocator.Current.GetInstance <IDocumentService>();

            _document = doc.Document;
        }
Example #3
0
        public PagePropertyViewModel()
        {
            if (this.IsInDesignMode)
            {
                return;
            }

            _model = PageNoteModel.GetInstance();

            this.OpenPageNoteFieldCommand = new DelegateCommand <object>(OpenPageNoteFieldExecute);

            _ListEventAggregator.GetEvent <UpdateNoteEvent>().Subscribe(UpdateNoteHandler, ThreadOption.UIThread);
            _ListEventAggregator.GetEvent <SelectionPageChangeEvent>().Subscribe(SelectionPageChangeHandler, ThreadOption.UIThread);
            _ListEventAggregator.GetEvent <DomLoadedEvent>().Subscribe(DomLoadedEventHandler, ThreadOption.UIThread);
            _ListEventAggregator.GetEvent <OpenDialogEvent>().Subscribe(OpenDialogEventHandler, ThreadOption.UIThread);
            // _ListEventAggregator.GetEvent<UpdateLanguageEvent>().Subscribe(UpdateLanguageEventHandler);
        }