The IProcessService allows a developer to run processes from inside a view model.
Platform info
Framework | Supported |
---|---|
WPF | |
Silverlight 5 | |
Windows Phone 8.0 | |
Windows Phone 8.1 | |
Windows RT 8.0 | |
Windows RT 8.1 | |
Android | |
iOS | |
Test/emulation service |
Starting a process with arguments
To start a process with arguments, use the following code:
var dependencyResolver = this.GetDependencyResolver(); var processService = dependencyResolver.Resolve<IProcessService>(); processService.StartProcess("notepad.exe", @"C:\mytextfile.txt");
Starting a process with arguments and completed callback
To start a process with arguments and receive a callback on completion, use the following code:
var dependencyResolver = this.GetDependencyResolver(); var processService = dependencyResolver.Resolve<IProcessService>(); processService.StartProcess("notepad.exe", @"C:\mytextfile.txt", OnProcessCompleted);