Launching a Desktop Application with a Metro-style app

If you simply want to run a desktop application like (notepad, wordpad, internet explorer etc) then go through Process Methods and ProcessStartInfo Class try { // Start the child process. Process p = new Process(); // Redirect the output stream of the child process. p.StartInfo.UseShellExecute = false; p.StartInfo.FileName = “C:\Path\To\App.exe”; p.Start(); } // Exp 2 … Read more

Yet Another MinGW “gcc: error: CreateProcess: No such file or directory”

You shouldn’t add C:\MinGw\libexec\gcc\mingw32\4.7.2 to the path. Add: c:\MinGW\bin You may need to reboot to ensure that the path is made available to all processes properly. Another suggestion is to use a different MinGW distribution. It’s been a long time since I used an ‘official’ MinGW distribution because the installation steps were so byzantine and … Read more

Setting Background Color or WPF (4.0) ListBox – Windows 8

Those posts are getting outdated for Windows-8. In Windows-8 for some reason Microsoft don’t want people editing their Default Style‘s so easily or something with a Brush over-ride. ListBoxItem default Style from VS has this for selection triggers: <MultiTrigger> <MultiTrigger.Conditions> <Condition Property=”Selector.IsSelectionActive” Value=”False” /> <Condition Property=”IsSelected” Value=”True” /> </MultiTrigger.Conditions> <Setter TargetName=”Bd” Property=”Background” Value=”#3DDADADA” /> <Setter … Read more

How to download/upload files from/to SharePoint 2013 using CSOM?

Upload a file Upload a file to a SharePoint site (including SharePoint Online) using File.SaveBinaryDirect Method: using (var clientContext = new ClientContext(url)) { using (var fs = new FileStream(fileName, FileMode.Open)) { var fi = new FileInfo(fileName); var list = clientContext.Web.Lists.GetByTitle(listTitle); clientContext.Load(list.RootFolder); clientContext.ExecuteQuery(); var fileUrl = String.Format(“{0}/{1}”, list.RootFolder.ServerRelativeUrl, fi.Name); Microsoft.SharePoint.Client.File.SaveBinaryDirect(clientContext, fileUrl, fs, true); } } Download … Read more

How can I make SmartScreen Filter trust a self-signed certificate

To quote from MSDN’s website: Detractors may claim that SmartScreen is “forcing” developers to spend money on certificates. It should be stressed that EV code signing certificates are not required to build or maintain reputation with SmartScreen. Files signed with standard code signing certificates and even unsigned files continue to build reputation as they have … Read more

WinRT/UWP Frame and Page caching: How to create new page instance on Navigate() and keep the page instance on GoBack()

Because there was no solution to this problem, I had to reimplement all paging relevant classes: Page, Frame, SuspensionManager, etc… The solution can be downloaded here: https://github.com/MyToolkit/MyToolkit/wiki/Paging-Overview Update: The page class now also provides the OnNavigatingFromAsync method to show for example an async popup and cancel navigation if required…

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