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

Using jQuery with Windows 8 Metro JavaScript App causes security error

You need to edit the jQuery source so that you pass the jQuery.support function to MSApp.execUnsafeLocalFunction, which disables the unsafe content checking, like this: jQuery.support = MSApp.execUnsafeLocalFunction(function() { var support, all, a, select, opt, input, fragment, tds, events, eventName, i, isSupported, div = document.createElement( “div” ), documentElement = document.documentElement; // lots of statements removed for … Read more

How do I print WebView content in a Windows Store App?

Sure, here you go. First, you can resize the WebView to the actual content. Then, you scale the WebView back to the original size. It would require a script invoke and a ScaleTransform. Pretty simple, really. Like this: <Grid Background=”{StaticResource ApplicationPageBackgroundThemeBrush}”> <WebView x:Name=”MyWebView” Source=”http://www.stackoverflow.com” /> </Grid> void MyWebView_LoadCompleted(object sender, NavigationEventArgs e) { var _Original = … Read more

Making WPF applications look Metro-styled, even in Windows 7? (Window Chrome / Theming / Theme)

What I did was creating my own Window and Style. Because I like to have control over everything and I didn’t want some external libraries just to use a Window from it. I looked at already mentioned MahApps.Metro on GitHub and also very nice Modern UI on GitHub. (.NET4.5 only) There is one more it’s … Read more

Is it possible to await an event instead of another async method?

You can use an instance of the SemaphoreSlim Class as a signal: private SemaphoreSlim signal = new SemaphoreSlim(0, 1); // set signal in event signal.Release(); // wait for signal somewhere else await signal.WaitAsync(); Alternatively, you can use an instance of the TaskCompletionSource<T> Class to create a Task<T> that represents the result of the button click: … Read more