public BubbleViewModel(IEditingContext editingContext)
        {
            EditingContext = editingContext;
            EditingContext.SelectedItems.CollectionChanged += SelectedItemsOnCollectionChanged;

            ChangeFontSizeCommand = new DelegateCommand(ChangeFontSize);
        }
        public ToolbarViewModel(IToolProvider toolProvider, IEditingContext editingContext)
        {
            ToolProvider = toolProvider;
            EditingContext = editingContext;            

            CreateObjectCommand = new DelegateCommand(parameter => CreateObject((ITool)parameter));
        }
        public ToolbarViewModel(IToolProvider toolProvider, IEditingContext editingContext)
        {
            ToolProvider   = toolProvider;
            EditingContext = editingContext;

            CreateObjectCommand = new DelegateCommand(parameter => CreateObject((ITool)parameter));
        }
        public MainViewModel(IEditingContext editingContext, IDesignCommandHandler designCommandHandler)
        {
            EditingContext       = editingContext;
            DesignCommandHandler = designCommandHandler;

            // Since we're Main, we have to instance the document into the editing context.
            EditingContext.Document    = new Document();
            ChangeSelectedItemsCommand = new DelegateCommand(ChangeSelectedItems);
        }
        public MainViewModel(IEditingContext editingContext, IDesignCommandHandler designCommandHandler)
        {
            EditingContext = editingContext;
            DesignCommandHandler = designCommandHandler;

            // Since we're Main, we have to instance the document into the editing context.
            EditingContext.Document = new Document();            
            ChangeSelectedItemsCommand = new DelegateCommand(ChangeSelectedItems);
        }
        public DesignSurfaceCommandHandler(IEditingContext editingContext)
        {
            EditingContext = editingContext;

            EditingContext.SelectedItems.CollectionChanged += SelectedItemsOnCollectionChanged;

            LoadItemsCommand = new RelayCommand(OnLoadItems);
            BringToFrontCommand = new RelayCommand(BringToFront, IsSomethingSelected);
            SendToBackCommand = new RelayCommand(SendToBack, IsSomethingSelected);
            UndoCommand = new RelayCommand( this.Undo, this.CanUndo );
            RedoCommand = new RelayCommand( this.Redo, this.CanRedo );

            RecordingServices.DefaultRecorder.UndoOperations.CollectionChanged += ( sender, args ) => this.UndoCommand.RaiseCanExecuteChanged();
            RecordingServices.DefaultRecorder.RedoOperations.CollectionChanged += (sender, args) => this.RedoCommand.RaiseCanExecuteChanged();
        }
Exemple #7
0
        public DesignSurfaceCommandHandler(IEditingContext editingContext)
        {
            EditingContext = editingContext;

            EditingContext.SelectedItems.CollectionChanged += SelectedItemsOnCollectionChanged;

            LoadItemsCommand    = new RelayCommand(OnLoadItems);
            BringToFrontCommand = new RelayCommand(BringToFront, IsSomethingSelected);
            SendToBackCommand   = new RelayCommand(SendToBack, IsSomethingSelected);
            UndoCommand         = new RelayCommand(this.Undo, this.CanUndo);
            RedoCommand         = new RelayCommand(this.Redo, this.CanRedo);

            RecordingServices.DefaultRecorder.UndoOperations.CollectionChanged += (sender, args) => this.UndoCommand.RaiseCanExecuteChanged();
            RecordingServices.DefaultRecorder.RedoOperations.CollectionChanged += (sender, args) => this.RedoCommand.RaiseCanExecuteChanged();
        }
Exemple #8
0
        void OnDisable()
        {
            VRView.afterOnGUI -= OnVRViewGUI;

            defaultContext = m_CurrentContext;
            m_CurrentContext.Dispose();

            m_AvailableContexts = null;

            ISetEditingContextMethods.getAvailableEditingContexts   = null;
            ISetEditingContextMethods.getPreviousEditingContexts    = null;
            ISetEditingContextMethods.setEditingContext             = null;
            ISetEditingContextMethods.restorePreviousEditingContext = null;

            SaveUserSettings(m_Settings);
        }
Exemple #9
0
        public CanvasItemViewModel CreateItem(IEditingContext editingContext)
        {
            var items = editingContext.Document.Children;
            var canvasItemViewModel = CreateItem();

            if (this.InsertOrder == InsertOrder.ToEnd)
            {
                items.Add(canvasItemViewModel);
            }
            else
            {
                items.Insert(0, canvasItemViewModel);
            }

            return(canvasItemViewModel);
        }
Exemple #10
0
        void SetEditingContext(IEditingContext context)
        {
            if (context == null)
            {
                return;
            }

            if (m_CurrentContext != null)
            {
                m_PreviousContexts.Insert(0, m_CurrentContext);
                m_CurrentContext.Dispose();
            }

            context.Setup();
            m_CurrentContext = context;

            m_SelectedContextIndex = m_AvailableContexts.IndexOf(context);
        }
Exemple #11
0
        void OnDisable()
        {
            EditorApplication.playmodeStateChanged -= OnPlaymodeStateChanged;

            VRView.afterOnGUI -= OnVRViewGUI;

            defaultContext = m_CurrentContext;
            m_CurrentContext.Dispose();

            m_AvailableContexts = null;

            ISetEditingContextMethods.getAvailableEditingContexts   = null;
            ISetEditingContextMethods.getPreviousEditingContexts    = null;
            ISetEditingContextMethods.setEditingContext             = null;
            ISetEditingContextMethods.restorePreviousEditingContext = null;

            SaveUserSettings(m_Settings);
        }
Exemple #12
0
        public CanvasItemViewModel CreateItem(IEditingContext editingContext)
        {
            
            var items = editingContext.Document.Children;
            var canvasItemViewModel = CreateItem();

            if ( this.InsertOrder == InsertOrder.ToEnd )
            {
                items.Add( canvasItemViewModel );
            }
            else
            {
                items.Insert( 0, canvasItemViewModel );
            }

            return canvasItemViewModel;
            
        }
 /// <summary>
 /// Set the editing context, which will dispose of the current editing context
 /// </summary>
 /// <param name="context">The editing context to use</param>
 public static void SetEditingContext(this ISetEditingContext obj, IEditingContext context)
 {
     setEditingContext(context);
 }
 public FrameViewModel(IEditingContext editingContext)
 {
     EditingContext = editingContext;
     EditingContext.SelectedItems.CollectionChanged += SelectedItemsOnCollectionChanged;
 }
 public FrameViewModel(IEditingContext editingContext)
 {
     EditingContext = editingContext;
     EditingContext.SelectedItems.CollectionChanged += SelectedItemsOnCollectionChanged;                        
 }