24

I feel very much annoyed by default zoom of XAML Designer in VS2015 (not sure if version is relevant), which is Fit all by default.

Is there a way to set it to 100% by default? Disabling zoom feature is also an option. But there is nothing related in VS Settings - XAML Designer.

P.S.: tagging it with languages to be visible to peoples like me, who only look at tagged questions (in my case C#).

Sinatr
  • 20,892
  • 15
  • 90
  • 319

3 Answers3

7

Visual Studio 2015 (at least Professional with Update 1) remembers your XAML Designer's zoom setting.

Start just one instance of VS2015 and create a new WPF Application. Open the MainWindow.xaml and select the designer. In my case it opens up with 100% zoom:

Default 100 zoom

Now change the zoom to Fit all and then create a new WPF Application. Again open MainWindow.xaml and select the designer. The zoom should show something like 229.4% (which is the % for Fit all in this case):

Fit all default

Restart VS2015 and create new WPF project and again check the zoom. It should till default to your last selection.

Note: Selecting 400% didn't have this same behavior. The designer opened with 100% instead.

Mikael Koskinen
  • 12,306
  • 5
  • 48
  • 63
  • 1
    Can't confirm that. Creating new wpf application, default zoom is `143.6%` (probably depends on screen resolutions and VS layout), making it `100%`, adding another wpf window to project or opening a new project - again `143.6%`. Community Edition Update 1. – Sinatr Dec 18 '15 at 12:19
  • Disregard my previous comment. You answer how to set it to `Fit to all`, but it's already `Fit to all` by default. I need `100%` by default. Can you tell me how you managed to have it `100%` by default? – Sinatr Dec 18 '15 at 12:21
  • 1
    As I mentioned, my Visual Studio 2015 seems to remember the setting. The above example works from 100%->Fit all so now my default is Fit all. If I now do the same thing from Fit all->100%, it seems to work OK too. One key seems to be the "Create a new WPF Application". If I just add a new Window, there seems to be some issues. – Mikael Koskinen Dec 18 '15 at 12:26
  • Once you have set the designer view for a xaml file it is persisted in the solution's `.suo` file. If you delete that file you're back at square one. – CAD bloke Oct 18 '18 at 12:04
3

With VS2015 the default option became "fit all", however, VS remembers your zoom settings for every XAML element. Once you set it to 100%, it stays there, even after closing project or solution. I couldn't find a way to change this default behavior.

The annoying thing is, when you have a large existing project created with VS2013 or below and start using 2015. Every XAML element previously showing at 100% is now fitted to the designer size.

After three month on VS2015, I'm still stumbling over "not-yet-touched" XAML elements popping up at 1360% zoom level.

Patrick Stalph
  • 792
  • 1
  • 9
  • 19
  • 3
    Who in their right mind changes a sane default of 100% to something totally random depending on the size of a page / window / control which always looks awful thanks to unsharp lines and weirdly resized text, even with a vector based UI like WPF? If they want to promote DPI awareness, annoying developers is not the right way. – Ray Apr 11 '18 at 06:24
3

If you're looking for a quick keyboard way of zooming to 100% do this ...

  • open a xaml file. I use a split window, it also works with just the design surface. The design surface needs to have focus for the next step to work
  • alt-G (opens the Design menu, only available if you are in the designer
  • alt-S selects "Actual Size" from that menu.

I added a keyboard shortcut shift-alt-0 (zero). In the options -> Environment -> Keyboard search for "Actual" and set a your keyboard shortcut in the "XAML Designer" ... or Global if you like and it's not killing another shortcut. The Designer needs to have focus for it to work so it can be fiddly at times.

But that whole "any default zoom you like as long as it is zoom to extents" is dumb

CAD bloke
  • 8,578
  • 7
  • 65
  • 114
  • An amazing workaround, thanks. I've set a hotkey `ctr+shift+/` (it's 3 keys together on the left bottom side of keyboard) and then opening xaml, clicking inside designer and pressing it is much more comfortable than clicking pointing a little combobox and choosing "100%" item there. – Sinatr Oct 18 '18 at 12:49
  • Left is the new right? (or is that just my keyboard?) That's a better keyboard combo, I'm switching to that before I get too much muscle memory... ah, wait, that's a Resharper shortcut I use all the time for block comments. Darn. – CAD bloke Oct 18 '18 at 23:03