简体   繁体   中英

XAML Designer - default zoom?

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 .

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

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:

默认为100变焦

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):

适合所有默认值

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.

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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM