Category Archives: Software

VS2015 Preview: Inline Rename

Another IDE experience that has been revamped in Visual Studio 2015 Preview is that of renaming stuff. You can rename a variable by right-clicking it and selecting “Rename…” from the context menu, or instead by simply hitting F2 on your keyboard:

vs2015-inline-rename-menu

When you do this, Visual Studio goes into Inline Rename mode. It finds all the instances of that variable and highlights them for you, while providing some other options on the side:

vs2015-inline-rename-renaming

As you type a new name, all instances are instantly updated:

vs2015-inline-rename-renamed

What’s really cool about this is that the IDE actually warns you if the new name conflicts with some other variable:

vs2015-inline-rename-conflict

Just press Enter to accept the changes.

Although I have demonstrated how to rename a variable, this also works for other things such as methods and classes. In case of conflicts, Inline Rename will attempt to resolve them using fully-qualified names if possible, as demonstrated in the video with Beth Massi and Dustin Campbell.

VS2015 Preview: Potential Fixes and Preview

When there’s a squiggly line in your code due to some error or warning, Visual Studio 2015 Preview provides an improved experience in dealing with them. When you hover over the squiggly line, aside from the fancy coloured tooltip, you’ll also get a link saying “Show potential fixes”:

vs2015-potential-fixes

Once you click on that “Show potential fixes”, you are given a list of actions. Note that you can also get to this list by clicking on the light bulb next to the tooltip, or else pressing Ctrl+. (read: Control Dot) on the keyboard while the caret is on the squiggly line.

vs2015-fixes-preview

When an item in the list is selected (but before you actually accept it), you get a handy preview (similar to what we saw with the unused usings) showing how the code will change as a result of that action. This means you will know what effect any fixes and refactoring (which will be covered in later articles) will have on your code before you take the plunge.

 

VS2015 Preview: Debugger support for lambdas and LINQ

If you’ve ever tried running a lambda expression in the Immediate Window or as a Watch, you’ll be pretty familiar with the response, “Expression cannot contain lambda expressions” (shown below in VS2012). If you try LINQ, you instead get “Expression cannot contain query expressions”, which is no better.

vs2012-lambda-immediate-window

This changes in Visual Studio 2015, which adds debugger support for lambda expressions and LINQ. VS2015 happily runs lambdas in both the Immediate Window and as Watches:

vs2015-lambda-immediate-window

LINQ works just as happily:

vs2015-linq-immediate-window

So there you go: another much-anticipated and extremely useful feature coming in Visual Studio 2015.

VS2015 Preview: XAML Peek

In Visual Studio 2015 Preview, you can now peek and edit definitions from XAML. Let’s take a look at some examples from Lilly Notes, a WPF application I built upon WPF MDI.

You can Peek Definition in your XAML editor via a context menu when right-clicking, or by pressing Alt+F12:

vs2015-xaml-peek-context-menu

If you do that on an event handler, you can peek into the event handler’s definition in the codebehind, without ever leaving your XAML:

vs2015-xaml-peek-edit

For more extended editing, you can “Promote to Document” (see screenshot above) to open the actual code file.

If you have an ElementName binding, you can peek into the definition of the target element, as you can see below with ToggleEditTitleButton:

vs2015-xaml-peek-elementname

XAML Peek also works pretty nicely with resources, which may be scattered about your project. For instance, I’m using this BoolToHiddenConverter as a StaticResource. I can peek its definition in the UserControl’s Resources section:

vs2015-xaml-peek-resource2

As it turns out, I can also peek the resource’s type (in this case BoolToVisibilityConverter), to edit the converter directly:

vs2015-xaml-peek-resource

No doubt this feature will be pretty handy for those writing some of the larger WPF or Windows Phone 8 applications.

VS2015 Preview: Unused usings/imports

Another of the IDE enhancements you’ll find in Visual Studio 2015 Preview is that unused using directives (C#) or imports (VB .NET) will appear in a less prominent colour, to distinguish them from the usings/imports that are actually used.

vs2015-unused-usings

You can see an example of this when creating a new WPF application (screenshot above), since most of the usings provided by default in the codebehind are useless until you require specific WPF features.

vs2015-remove-unused-usings-preview

That’s not all, however. On the side, you’ll find a light bulb that will suggest remedial actions. In this case, it’s suggesting that you remove the unused usings. When you hover over this action, you actually get a preview of what your code will look like.

You’ll see more of this paradigm of suggested actions and live previews as I continue to cover the new features in Visual Studio 2015 Preview.

VS2015 Preview: Coloured Tooltips

Visual Studio 2015 brings a wealth of IDE enhancements. One of these is an improvement to the user experience of tooltips thanks to the addition of a touch of colour.

For instance, here’s what you get when you hover over a type:

vs2015-new-type-tooltip

…and this is the tooltip you get from intellisense:

vs2015-new-intellisense-tooptip

How about this tooltip showing a preview of a collapsed method:

vs2015-new-collapsed-tooltip

Or this tooltip showing a preview of XML documentation:

vs2015-new-xmldoc-tooltip

So that’s a nice touch of colour in several different tooltips.

Not impressed? Let’s take a look at what these looked like in Visual Studio 2013:

vs2015-old-type-tooltipvs2015-old-intellisense-tooptipvs2015-old-collapsed-tooltipvs2015-old-xmldoc-tooltip

OK, so you’ll realise that this new feature in Visual Studio 2015 won’t change your life, but it’s a great improvement in user experience from what we had before.

The Windows 10 window style you never see

I am currently installing the Visual Studio 2015 Preview on the machine where I have the Windows 10 Preview installed, and since it’s an old machine with just 1GB RAM, Windows started hanging at times. The screenshot below shows what the installer looked like while it was hanging:

win10-legacy-header

See that tiny box towards the top of the screenshot? I guess that’s what windows actually look like before the clunky window style we’re familiar with gets rendered over it.

It’s nothing new – I’ve written before about legacy window styles appearing in Windows XP and this seems to continue that trend. The window style above has a very Windows 2000 feel to it, and I personally prefer it over what we have today in Windows 8+.

Windows 10: Switching between Start Menu and Start Screen

Windows 10 Technical Preview brings back the Start Menu (as I wrote in my recent 20-minute review), which replaces the tiled Start Screen that was prevalent in Windows 8 and 8.1.

However, for those who actually liked the Start Screen, you can bring it back by changing a simple setting. First, bring up the Taskbar and Start Menu Properties, either by right-clicking on the taskbar and selecting Properties, or by typing “Navigation” in the Start Menu’s search bar and selecting either of the options provided:

win10-navigation-search

Switch to the Start Menu tab, and then turn off the “Use the Start menu instead of the Start screen” option:

win10-start-screen-setting

You will then be prompted to sign out and sign back in again to effect the change:

win10-start-screen-sign-out

Once you do this, you still go directly into the desktop. But when you click on the Start button or press the Windows key on your keyboard, you are taken to the Start Screen instead of the Start Menu:

win10-start-screen

A 20-minute review of Windows 10 Technical Preview

A few weeks ago, Microsoft released the Windows 10 Technical Preview. Here is a very quick overview of what’s new.

Return of the Start Menu

win10-start-menu

Many of us sorely missed the start menu in Windows 8, and dreaded having to search for programs in a tiled mess. Windows 10 brings back the start menu, combining the traditional search menu functionality we used up to Windows 7 (including searching for programs) and the live tiles from Windows 8.

Windowed Store Apps

Windows Store apps introduced with Windows 8 (formerly known as “Metro” apps, but that name has since been dropped due to legal reasons) have typically taken up the entire screen, which was pretty dumb in cases such as the  music player which really only needs to show a few buttons for its UI.

win10-windowed-apps

That changes in Windows 10, where even the Windows Store apps can be hosted in their own window. This comes with its own limitations though – the minimum width and height of a windowed Windows Store app seem to be what you see in the screenshot above.

Improved Docking

In previous editions of Windows, you could drag a Window to the top edge of the screen to maximize it, or to a lateral edge to dock it to that half of the screen.

win10-docking-1

In Windows 10, you can now dock a window to a quarter of the screen by dragging it into a corner. You can also dock a window to the bottom half of the screen by dragging it towards the taskbar.

win10-docking-2

As you are performing this action, you will even get suggestions on how to fill the remaining space with windows that are already open.

The usefulness of this feature is limited by the fact that windows docked to a quarter of the screen are inevitably quite small, and it does not yet work perfectly – for instance, there is no way to dock the task manager as yet.

Virtual Desktops

I first experienced virtual desktops in Linux almost 10 years ago, and Microsoft are finally adding them to Windows. Better late than never, but still very much appreciated.

win10-virtual-desktops

Virtual desktops are a great way to organize your windows according to different projects you may be working on. I never liked the grouping of taskbar icons by application: if you’re working on three different projects simultaneously, each one might have a Word document open, so it doesn’t really help to group all the Word documents. It’s much more convenient to switch desktop when moving from one project to another.

Improved Selection/Clipboarding in Command Prompt

The command prompt has finally become more usable. You can actually select portions of text normally rather than having to resort to block selection:

win10-command-prompt

…and it is now much easier to copy and paste text in the command prompt. To copy, just select the portion of text you want and press Ctrl+C – the command prompt is intelligent enough to treat Ctrl+C as a clipboard copy if text is selected, or as a process termination signal if no text is selected. Ctrl+V works just fine for pasting text.

Setup Experience

Since the start menu has pretty much replaced the tiled start screen on desktops, it is quite possible to live without the “Metro” experience. However, although the Windows installation routine may have changed a little since Windows 8, the experience hasn’t: it still features an all-Metro interface, attempts to get you to sign into Windows with a Microsoft account by default, and at one point displays some dumb text with nauseating rotating background colours rather than reporting on progress.

win10-setup

Visual Improvements

I noticed that windows now have a soft shadow, which makes the ugly window layout from Windows 8 more bearable:

win10-shadows

Summary

This was just a very quick overview of what has changed in Windows 10, after spending only a few minutes trying it out. I’m sure there are many other features I’ve missed, and this is pre-release software, so take this article for what it is.

My impression is that Windows 10 is nowhere near as horrible as Windows 8, but still does not live up to Windows 7 in terms of user experience.

Pros:

  • Start menu instead of start screen
  • Virtual desktops
  • Docking
  • Windowed Windows Store apps
  • Improved command prompt
  • Visual improvements

Cons:

  • “Metro” still dominates Windows installation
  • Start menu still has live tiles