ParamPassing Class |
Namespace: Cauldron.XAML
public static class ParamPassing
The ParamPassing type exposes the following members.
Name | Description | |
---|---|---|
AreOtherInstanceActive |
Gets a value that indicates if other instances of the application are already running.
|
Name | Description | |
---|---|---|
BringToFront |
Brings the thread that created the specified application into the foreground and activates the
window. Keyboard input is directed to the window, and various visual cues are changed for
the user. The system assigns a slightly higher priority to the thread that created the
foreground window than it does to other threads.
This will only activate the first application instance in the list, if multiple instances are active.
| |
BringToFront(FuncProcess, Boolean) |
Brings the thread that created the specified application into the foreground and activates the
window. Keyboard input is directed to the window, and various visual cues are changed for
the user. The system assigns a slightly higher priority to the thread that created the
foreground window than it does to other threads.
| |
Configure |
Configures the parameter passing
|
[STAThread] public static void Main(string[] args) { ParamPassing.Configure(args, x => { x.IsSingleInstance = true; x.ParameterPassedCallback = new Action<string[]>(p => { Application.Current.MainWindow.Title = string.Join(" ", p); }); }); try { new App().Run(new MainWindow()); } catch (Exception e) { MessageBox.Show(e.Message); } }
public MainWindow() { InitializeComponent(); this.Loaded += (s, e) => this.AddHookParameterPassing(); }