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 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(); }
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(); }
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); }
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); }
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); }
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); }
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; }