Example #1
0
 public ActionVisibleChangedCommand(EditorActionsProvider model)
 {
     if (model == null)
     {
         throw new ArgumentNullException("model");
     }
     this.Model = model;
 }
		public ContextActionsBulbViewModel(EditorActionsProvider model)
		{
			this.Model = model;
			this.Actions = new ObservableCollection<ContextActionViewModel>(
				model.GetVisibleActions().Select(a => new ContextActionViewModel(a) { IsVisible = true } ));
			this.HiddenActions = new ObservableCollection<ContextActionViewModel>();
			this.ActionVisibleChangedCommand = new ActionVisibleChangedCommand(model);
		}
Example #3
0
 public ContextActionsBulbViewModel(EditorActionsProvider model)
 {
     this.Model   = model;
     this.Actions = new ObservableCollection <ContextActionViewModel>(
         model.GetVisibleActions().Select(a => new ContextActionViewModel(a)
     {
         IsVisible = true
     }));
     this.HiddenActions = new ObservableCollection <ContextActionViewModel>();
     this.ActionVisibleChangedCommand = new ActionVisibleChangedCommand(model);
 }
		public ActionVisibleChangedCommand(EditorActionsProvider model)
		{
			if (model == null)
				throw new ArgumentNullException("model");
			this.Model = model;
		}
		void ClosePopup()
		{
			this.delayMoveTimer.Stop();
			this.popup.Close();
			this.popup.IsDropdownOpen = false;
			this.popup.IsHiddenActionsExpanded = false;
			this.popup.ViewModel = null;
			if (this.lastActions != null) {
				// Clear the context to prevent memory leaks in case some users kept long-lived references to EditorContext
				this.lastActions.EditorContext.Clear();
				this.lastActions = null;
			}
		}
		ContextActionsBulbViewModel BuildPopupViewModel(ITextEditor editor)
		{
			var actionsProvider = ContextActionsService.Instance.GetAvailableActions(editor);
			this.lastActions = actionsProvider;
			return new ContextActionsBulbViewModel(actionsProvider);
		}