Windows 10

Microsoft Windows 10 was released on 29th July to the public.

The newest iteration of the number one operating system in the world of PCs brings along a myriad of enhancements and improvements which make it a perfect choice for everyone using a previous version of Windows or a sub-par OS like Mac OS X.

Best of all – it is free for all users of Windows 7 and Windows 8 who upgrade within the first year of its availability.

One Windows

The most important feature for me as a developer is the fact that Windows is now one and the same operating system on all devices – phones, tablets, notebooks, desktops, IoT devices, Surface Hub workstations, Microsoft HoloLens, Xbox One – you name it and all apps will work on it! Microsoft achieved something incredible here – an unified API and runtime, that spans every device in your life. And even better – the apps are able to adapt easily to the device they are running on and behave just as you expect them.

Gallo-blog-1-v2

No other company (nor Google nor Apple), is able to achieve this, ever. No other technology company has an operating system that can span such a varied range of devices and even less a application runtime that can run everywhere without much hassle. This is a huge advantage for both customers and developers and is sure to bring a huge number of apps to the Windows ecosystem. By the way – do you know that Android and iOS apps will be able to run on Windows 10 without almost any changes? Surprised? No – this is Microsoft. Now there is no reason for developers to resist building or releasing apps for Windows and the OS has now the potential to have the largest app offering of all.

Start is back

I have to confess – I have loved Windows 8. Many people hated the new user interface it brought, but I loved the modern and fresh approach the system chose.

That being said, I love Windows 10 even more, if that is even possible.

WIndows-10-Start-Menu

The Start menu is now behaving in exactly the way that makes sense for the device and work mode you are in. Want small contextual menu on desktop? Check. Want full-screen immersive experience when working with the device as a tablet? Check.

The new Start menu also blends seamlessly the world of tiles with classic applications and the result is extremely satisfying.

Modern apps done just right

One of the criticisms Windows 8 received extremely often was the fact that it was no longer “Windows” – modern apps ran in full-screen or snapped mode, unable to be easily integrated in the classical desktop workflow.

This changes drastically with Windows 10 – Modern apps are first-class citizens of the desktop and work just as you expect them with full resizing support, ability to open multiple windows and much more.

The great thing is that all “old” Windows 8 apps work as well without the need for rewriting any code. Because the apps were written with adaptivity to snap mode from the start, resizing is very well supported. This is a stark difference to the likes of Apple iOS, which just now introduced a very limited and half-baked multitasking support for the iPad (well at least for the latest model – because they need to make money, right?), that requires a complete rewrite of the user interface for most apps.

Continuum

The current PC market is filled with devices that can be described as “hybrid” and “2 in 1” devices like the Microsoft Surface Pro. These devices offer the traditional looks of a notebook, but can be transformed into a touch-enabled tablet.

Windows 8 was the touch-first operating system. While offering great usability with your fingers, the mouse and keyboard input was a bit less satisfying. Now that changes drastically with Windows 10.

Windows 10 adapts to the way you currently use your PC. As I mentioned – this automatically includes the Start menu, but also includes all your apps. In the tablet mode, that is automatically triggered when you disconnect or flip the keyboard, all apps go full-screen which is the logical way to use a tablet. You can still do multitasking of two apps at the same time, of course. When you need to have a more powerful workstation, just reconnect the keyboard and go into the classic desktop mode. The transition is seamless and logical – just the thing you would expect from an operating systems that understands your needs perfectly.

Tento příběh je však ještě zajímavější v případě mobilních telefonů. Nová zařízení s Windows 10 Mobile umožní připojit telefon k obrazovce a následně jej využívat jako plnohodnotný počítač. To je snem každého business uživatele. Jedno zařízení, které vystačí na opravdu každý úkon.

Cortana

The first and only true personal assistant Cortana is now on your desktop PC. All features of the phone version are present – including her witty answers and remarks, funny quotes, weather checking, reminders, sports and travel tips, finance tracking and much more. On top of that several new features were added – composing a quick mail message on the fly or finding tips on Windows usage are welcome additions to the growing arsenal of Cortana’s abilities.

cortana-windows-10And we are still just getting started! Now that Cortana will be available on all operating systems including iOS (including iPad – sorry Siri) and Android (with the ability to directly replace Google Now), we can expect a fast paced tempo of new features and additions to her smarts. Cortana learns about the user in a controlled way (all privacy settings can be controlled by the user), so she can be proactive and help directly with the things that matter most.

Microsoft Edge

The new Browser (B uppercase intentionally). Microsoft decided to retire the Internet Explorer to bring a whole new browser for Windows 10 that matches and outperforms all other browsers on the current market. With automatic updates and latest features, Microsoft Edge is the best thing that happened to browsing on Windows ever. Although it is still in its starting phase, it already offers a great and seamless user experience and is amazingly fast and stable.

Snap assist

Windows 7 brought the productivity revolutionary feature of snapping apps to the sides of the screen. This automatically resized the apps to match the half of the screen and made multitasking a breeze. Now Windows 10 improves on this idea with Snap Assist.

snap_assist-1346fcb1683747c5

This feature goes beyond the original offering by enabling snapping to corners as well as to the sides of the screen and then offering the user a choice of which complementary apps to place on the screen. It may look like a small improvement, but it goes miles in the usability of the snapping feature.

Windows Feedback

This is something the users should be most excited about.

In contrast with Apple’s and Google’s approach of making changes without any regard to the needs and wishes of the users, Microsoft chose a completely new way of building this new iteration of Windows. Windows 10 was built from the start with direct input of its users. Microsoft announced the beta testing of Windows 10 for tech enthusiasts friendly names Windows Insiders.

Capture

Through a dedicated app Windows Feedback can now all users send their ideas for changes and improvements directly to Microsoft. All ideas are considered and used to improve the OS, so you should definitely sound off your opinion, vote for good ideas, because it actually counts!

Do

Windows is for doing. Whether you are an professional, designer, creative, business person, gamer – Windows 10 is made for you. I encourage you to upgrade and enjoy the best Windows ever. The best OS ever.

And yes, Microsoft is cool again.

Windows_Insider_Ninjacat_Trex-1600x900

 

Replacing [ExpectedException] in WinRT unit test library

Recently I needed to write an unit test for my Windows Store application, that would check if a code snippet caused an expected exception. Usually this is done in the following manner:

However, the Unit Test Library for WinRT lacks the ExpectedException attribute.

Luckily, it was replaced by a far more convenient and useful method  Assert.ThrowsException :

You need to provide the type of expected exception as the type parameter of this method and then a lambda expression (or   Action  instance), that contains the code that should throw the exception.

Accessing WebView cookies in WinRT

In my recent Windows 8.1 app project I needed to take advantage of ASP.NET Identity to authenticate in my ASP.NET Web API service. Because Identity offers social (external) logins on top of classic login flow, I decided to integrate them as well. Unfortunately the authentication process required the use of cookies, which needed to be forwarded to the registration endpoint to complete the registration process of a new user. Because the process itself is initiated in a WebView control, we need to obtain the resulting cookies. But WebView does not expose any properties to access them. What can we do?

Continue reading “Accessing WebView cookies in WinRT”

StorageApplicationPermissions in WinRT

Windows 8 and now also Windows Phone 8.1 enable apps access to the filesystem. This API is very limited unfortunately (primarily for security reasons), so by setting several Capabilities in app’s manifest you can access directly just a few basic pseudo-folders – libraries Pictures, Music and Videos (and for enterprise apps in Windows 8 also Documents), but access to other folders directly is only possible through pickers. These return a non-persistent file/folder object, that can’t be accessed after the app closes or terminates.  StorageApplicationPermissions class comes to the rescue. Continue reading “StorageApplicationPermissions in WinRT”

Removing touch highlights on smartphones

When you are testing your websites on your favorite smartphone, you might find out, that Windows Phone and iOS are including a special behavior when any links on the page are pressed – sort of a highlighting – graying out of the active touched area. This is of course quite helpful sometimes when the bounds of active links on the small screen are hard to discern, but at the same time it can in some cases be quite unfriendly and interfering with your site’s design.

How can we prevent it? Let’s see for both operating systems! Continue reading “Removing touch highlights on smartphones”

Showing more stuff on Windows 8.1 tablets and laptops

I recently discovered a great feature of new Windows 8.1 Modern UI, that enables owners of high resolution tablets and laptops to display much more content at once (for the price of making things smaller).

Microsoft Surface Pro 2 with Full HD display will by default show the Start Screen in a fashion similar to this: startscreennormal

As you can see I get four rows of medium sized tiles. Also in normal setup, the device is capable of showing at most two Windows Store apps at once with multitasking.

Now let’s try to tune it up a little!
Continue reading “Showing more stuff on Windows 8.1 tablets and laptops”

ItemsSource and SelectedItem

Quite a common mistake that XAML developers do here and there (especially myself, I just can’t stop causing this bug…) is to switch the order the ItemsSource and SelectedItem properties in XAML while building a MVVM pattern based app.

Let’s see it in context the WinRT ListView control. To bind some items to it we use the ItemsSource dependency property. To select one of them we bind to SelectedItem.

Looks great right? Not yet.

XAML parser processes the file in the left right order. This way the first dependency property it faces is the SelectedItem. Here it tries to select the item in the collection, but unfortunately, it cannot be found. In that moment the SelectedItem of the ListView is actually set back to null. Now the ItemsSource is reached normally, but it is too late to get the SelectedItem back “from the dead”.

The correct order only when SelectedItem is placed behind the ItemsSource. Then we get the desired results and will no longer get unexpected, hard to decode behavior.

 The devil is in the details.

Localization in WinRT not working?

This week I had to deal with very strange behavior when trying to localize a Windows 8.1 app in Czech and English.

As always, I prepared a special localization class, added the *.resw files for en and cs and finally hooked it all up to XAML via binding. Everything seemed hunky-dory except for the tiny fact that only English (language neutral) variant of the app was functional. The situation got even stranger when I replicated the exact same set-up in a new project and it worked normally.

After a longer search I found the hidden cause of the problem.
The Package.appmanifest file, that stores different package-related settings of the resulting Windows 8.1 app package has numerous options, that are not available directly via the designer. In fact, the AppManifest file is just a XML file with a fancy extension, that can be edited directly. In Visual Studio 2013 click the right mouse button on this file and select the Open With… or View Code command.

Opening Package.appmanifest in XML editor

The source of my problems was one of the elements in manifest file – element Resources to be exact. This element influences the behavior of resource files in the project and more importantly its contents describe which languages the app supports. In my case it contained just one – the english variant:

To support other languages, I would have to repeat the Resource element with other ISO codes of languages I need. This would be too much of a burden and not very practical. A better solution is the form that is actually set as default in newly created Windows 8.1 projects:

Special constant x-generate specifies, that while the package is constructed, the required localizations are automatically generated on the basis of what language *.resw are present in the project.