Hi Guys,
I managed to get the above code working. It was probably a stupid question and really obvious for everyone on here but i thought i would post the solution anyway just in case.
SetSuspendState is part of the System.Windows.Forms namespace which is not part of the WPF framework.
System.Windows.Forms can be made accessible by following the below steps...
In Solution Explorer,
add a reference to the WindowsFormsIntegration assembly, which is named
WindowsFormsIntegration.dll.
In Solution Explorer,
add a reference to the Windows Forms assembly, which is named
System.Windows.Forms.dll.
Then the below code will allow control of the host PC's PowerState.
System.Windows.Forms.Application.SetSuspendState(PowerState.Suspend, false, false);
More information can be found at:
http://msdn.microsoft.com/en-us/library/ms751761.aspx
Alex.