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>();
 }
예제 #3
0
 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>();
 }
예제 #4
0
 /// <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>();
 }
예제 #6
0
 /// <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;
 }
예제 #9
0
 /// <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);
 }
예제 #10
0
 /// <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>();
 }
예제 #11
0
 /// <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>();
 }
예제 #12
0
 /// <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);
 }
예제 #13
0
 public XenkoDebugService(IViewModelServiceProvider serviceProvider)
 {
     Dispatcher         = serviceProvider.Get <IDispatcherService>();
     RecompilationDelay = TimeSpan.FromSeconds(0.5);
 }
예제 #14
0
 /// <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>();
 }
예제 #15
0
        private bool DisplayMessage(string message)
        {
            var result = serviceProvider.Get <IDialogService>().BlockingMessageBox(message, MessageBoxButton.OKCancel);

            return(result != MessageBoxResult.Cancel);
        }