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

How can a Metro app in Windows 8 communicate with a backend desktop app on the same machine?

I’m porting my existing project to Win8 right now. It consists of windows service and tray application which are talking to each other via NamedPipes WCF. As you may already know Metro doesn’t support named pipes. I ended up using TcpBinding for full duplex connection. This post describes what functionality is supported. Sample of my … Read more

Can you force Visual Studio to always run as an Administrator in Windows 8?

In Windows 8, Windows 10, and Windows 11, you have to right-click devenv.exe and select “Troubleshoot compatibility”. Select “Troubleshoot program” Check “The program requires additional permissions” Click “Next” Click “Test the program…” Wait for the program to launch Click “Next” Select “Yes, save these settings for this program” Click “Close” If, when you open Visual … Read more

Python command not working in command prompt

I have installed the latest Python for Win10 from Releases for Windows. Just typing py in the Command Prompt Window starts Python. Microsoft Windows [Version 10.0.15048] (c) 2017 Microsoft Corporation. All rights reserved. C:\Users\sg7>py Python 3.6.3 (v3.6.3:2c5fed8, Oct 3 2017, 18:11:49) [MSC v.1900 64 bit (AMD64)] on win32 Type “help”, “copyright”, “credits” or “license” for … Read more

Run code on UI thread in WinRT

It’s easier to directly get the CoreWindow from the non-UI thread. The following code will work everywhere, even when GetForCurrentThread() or Window.Current returns null. CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, <lambda for your code which should run on the UI thread>); for example: CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => { // Your UI update code goes here! }); You’ll need to reference Windows.ApplicationModel.Core … Read more

How to parse JSON without JSON.NET library?

You can use the classes found in the System.Json Namespace which were added in .NET 4.5. You need to add a reference to the System.Runtime.Serialization assembly The JsonValue.Parse() Method parses JSON text and returns a JsonValue: JsonValue value = JsonValue.Parse(@”{ “”name””:””Prince Charming””, …”); If you pass a string with a JSON object, you should be … Read more