Are Click, Tapped, and PointerPressed synonymous in WinRT-XAML?

Click is there for backwards compatibility, and is essentially the same as Tapped. Tapped is a “high level gesture” that will translate automatically to a click, tap, pen press, etc. and is what I would recommend to use. PointerPressed is not what you want. Here’s why: if I press and hold, the PointerPressed event will … Read more

How to add HTTP Header to SOAP Client

Try to use this: SoapServiceClient client = new SoapServiceClient(); using(new OperationContextScope(client.InnerChannel)) { // // Add a SOAP Header (Header property in the envelope) to an outgoing request. // MessageHeader aMessageHeader = MessageHeader // .CreateHeader(“MySOAPHeader”, “http://tempuri.org”, “MySOAPHeaderValue”); // OperationContext.Current.OutgoingMessageHeaders.Add(aMessageHeader); // Add a HTTP Header to an outgoing request HttpRequestMessageProperty requestMessage = new HttpRequestMessageProperty(); requestMessage.Headers[“MyHttpHeader”] = “MyHttpHeaderValue”; … Read more

WPF Handedness with Popups

Thanks @TravisWhidden for the solution. Just implemented an improved version of it that listens to the StaticPropertyChanged event, I’ll paste it in here because it seems less of a “hack”. private static readonly FieldInfo _menuDropAlignmentField; static MainWindow() { _menuDropAlignmentField = typeof(SystemParameters).GetField(“_menuDropAlignment”, BindingFlags.NonPublic | BindingFlags.Static); System.Diagnostics.Debug.Assert(_menuDropAlignmentField != null); EnsureStandardPopupAlignment(); SystemParameters.StaticPropertyChanged += SystemParameters_StaticPropertyChanged; } private static void … Read more

How do I create a shortcut via command-line in Windows?

You could use a PowerShell command. Stick this in your batch script and it’ll create a shortcut to %~f0 in %userprofile%\Start Menu\Programs\Startup: powershell “$s=(New-Object -COM WScript.Shell).CreateShortcut(‘%userprofile%\Start Menu\Programs\Startup\%~n0.lnk’);$s.TargetPath=”%~f0″;$s.Save()” If you prefer not to use PowerShell, you could use mklink to make a symbolic link. Syntax: mklink saveShortcutAs targetOfShortcut See mklink /? in a console window for … Read more

MessageDialog ShowAsync throws accessdenied exception on second dialog

Okay I found a quick solution, define a IAsyncOperation class varialble IAsyncOperation<IUICommand> asyncCommand = null; and set it to the ShowAsync method of MessageDialog asyncCommand = msg.ShowAsync(); In the command handler for retry/try again check if asyncCommand is not null and cancel the last operation if necessary if(asyncCommand != null) { asyncCommand.Cancel(); } Please let … Read more