public ViewModelTransactionalActionStack(int capacity, IViewModelServiceProvider serviceProvider) : base(capacity) { if (serviceProvider == null) throw new ArgumentNullException("serviceProvider"); ServiceProvider = serviceProvider; Dispatcher = serviceProvider.Get<IDispatcherService>(); }
public ViewModelTransactionalActionStack(int capacity, IViewModelServiceProvider serviceProvider, IEnumerable<IActionItem> initialActionsItems) : base(capacity, initialActionsItems) { if (serviceProvider == null) throw new ArgumentNullException("serviceProvider"); ServiceProvider = serviceProvider; Dispatcher = serviceProvider.Get<IDispatcherService>(); }
public ModelNodeCommandWrapper(IViewModelServiceProvider serviceProvider, INodeCommand nodeCommand, GraphNodePath nodePath, IEnumerable<IDirtiable> dirtiables) : base(serviceProvider, dirtiables) { if (nodeCommand == null) throw new ArgumentNullException(nameof(nodeCommand)); NodePath = nodePath; NodeCommand = nodeCommand; Service = serviceProvider.Get<ObservableViewModelService>(); }
/// <summary> /// Initializes a new instance of the <see cref="ObservableViewModel"/> class. /// </summary> /// <param name="serviceProvider">A service provider that can provide a <see cref="IDispatcherService"/> and an <see cref="ObservableViewModelService"/> to use for this view model.</param> /// <param name="nodeContainer">A <see cref="NodeContainer"/> to use to build view model nodes.</param> /// <param name="dirtiables">The list of <see cref="IDirtiable"/> objects linked to this view model.</param> private ObservableViewModel(IViewModelServiceProvider serviceProvider, NodeContainer nodeContainer, IEnumerable<IDirtiable> dirtiables) : base(serviceProvider) { if (nodeContainer == null) throw new ArgumentNullException(nameof(nodeContainer)); if (dirtiables == null) throw new ArgumentNullException(nameof(dirtiables)); NodeContainer = nodeContainer; Dirtiables = dirtiables; ObservableViewModelService = serviceProvider.Get<ObservableViewModelService>(); Logger = GlobalLogger.GetLogger(DefaultLoggerName); }
public VirtualNodeCommandWrapper(IViewModelServiceProvider serviceProvider, INodeCommand nodeCommand, IGraphNode node, Index index) : base(serviceProvider) { if (nodeCommand == null) throw new ArgumentNullException(nameof(nodeCommand)); if (node == null) throw new ArgumentNullException(nameof(node)); this.node = node; this.index = index; NodeCommand = nodeCommand; Service = serviceProvider.Get<ObservableViewModelService>(); }
/// <summary> /// Initializes a new instance of the <see cref="ObservableViewModel"/> class. /// </summary> /// <param name="serviceProvider">A service provider that can provide a <see cref="IDispatcherService"/> and an <see cref="ObservableViewModelService"/> to use for this view model.</param> /// <param name="modelContainer">A <see cref="ModelContainer"/> to use to build view model nodes.</param> /// <param name="dirtiables">The list of <see cref="IDirtiableViewModel"/> objects linked to this view model.</param> private ObservableViewModel(IViewModelServiceProvider serviceProvider, ModelContainer modelContainer, IEnumerable<IDirtiableViewModel> dirtiables) : base(serviceProvider) { if (modelContainer == null) throw new ArgumentNullException("modelContainer"); if (dirtiables == null) throw new ArgumentNullException("dirtiables"); this.modelContainer = modelContainer; this.dirtiables = dirtiables; this.dirtiables.ForEach(x => x.DirtinessUpdated += DirtinessUpdated); observableViewModelService = serviceProvider.Get<ObservableViewModelService>(); Logger = GlobalLogger.GetLogger(DefaultLoggerName); }
public CombinedNodeCommandWrapper(IViewModelServiceProvider serviceProvider, string name, string observableNodePath, ObservableViewModelIdentifier identifier, IReadOnlyCollection<ModelNodeCommandWrapper> commands) : base(serviceProvider, null) { if (commands == null) throw new ArgumentNullException("commands"); if (commands.Count == 0) throw new ArgumentException(@"The collection of commands to combine is empty", "commands"); if (commands.Any(x => !ReferenceEquals(x.NodeCommand, commands.First().NodeCommand))) throw new ArgumentException(@"The collection of commands to combine cannot contain different node commands", "commands"); service = serviceProvider.Get<ObservableViewModelService>(); this.commands = commands; this.name = name; this.identifier = identifier; this.serviceProvider = serviceProvider; ObservableNodePath = observableNodePath; }
public ModelNodeCommandWrapper(IViewModelServiceProvider serviceProvider, INodeCommand nodeCommand, string observableNodePath, ObservableViewModel owner, ModelNodePath nodePath, IEnumerable<IDirtiableViewModel> dirtiables) : base(serviceProvider, dirtiables) { if (nodeCommand == null) throw new ArgumentNullException(nameof(nodeCommand)); if (owner == null) throw new ArgumentNullException(nameof(owner)); NodePath = nodePath; // Note: the owner should not be stored in the command because we want it to be garbage collectable Identifier = owner.Identifier; ModelContainer = owner.ModelContainer; NodeCommand = nodeCommand; Service = serviceProvider.Get<ObservableViewModelService>(); ObservableNodePath = observableNodePath; }
/// <summary> /// Initializes a new instance of the <see cref="ObservableViewModel"/> class. /// </summary> /// <param name="serviceProvider">A service provider that can provide a <see cref="IDispatcherService"/> and an <see cref="ObservableViewModelService"/> to use for this view model.</param> private ObservableViewModel(IViewModelServiceProvider serviceProvider) : base(serviceProvider) { ObservableViewModelService = serviceProvider.Get<ObservableViewModelService>(); Logger = GlobalLogger.GetLogger(DefaultLoggerName); }
/// <summary> /// Initializes a new instance of the <see cref="DispatcherViewModel"/> class. /// </summary> /// <param name="serviceProvider">A service provider that can provide a <see cref="IDispatcherService"/> to use for this view model.</param> protected DispatcherViewModel(IViewModelServiceProvider serviceProvider) : base(serviceProvider) { Dispatcher = serviceProvider.Get<IDispatcherService>(); }
/// <summary> /// Initializes a new instance of the <see cref="DispatcherViewModel"/> class. /// </summary> /// <param name="serviceProvider">A service provider that can provide a <see cref="IDispatcherService"/> to use for this view model.</param> protected DispatcherViewModel(IViewModelServiceProvider serviceProvider) : base(serviceProvider) { Dispatcher = serviceProvider.Get <IDispatcherService>(); }
/// <summary> /// Initializes a new instance of the <see cref="ObservableViewModel"/> class. /// </summary> /// <param name="serviceProvider">A service provider that can provide a <see cref="IDispatcherService"/> and an <see cref="ObservableViewModelService"/> to use for this view model.</param> private ObservableViewModel(IViewModelServiceProvider serviceProvider) : base(serviceProvider) { ObservableViewModelService = serviceProvider.Get <ObservableViewModelService>(); Logger = GlobalLogger.GetLogger(DefaultLoggerName); }
public XenkoDebugService(IViewModelServiceProvider serviceProvider) { Dispatcher = serviceProvider.Get <IDispatcherService>(); RecompilationDelay = TimeSpan.FromSeconds(0.5); }
/// <summary> /// Initializes a new instance of the <see cref="EditableViewModel"/> class. /// </summary> /// <param name="serviceProvider">A service provider that can provide a <see cref="IDispatcherService"/> and an <see cref="ITransactionalActionStack"/> to use for this view model.</param> protected EditableViewModel(IViewModelServiceProvider serviceProvider) : base(serviceProvider) { ActionStack = serviceProvider.Get <ITransactionalActionStack>(); }
private bool DisplayMessage(string message) { var result = serviceProvider.Get <IDialogService>().BlockingMessageBox(message, MessageBoxButton.OKCancel); return(result != MessageBoxResult.Cancel); }