How do I detect design mode with WinJS? - expression-blend

I have bits of javascript that causes problems when viewed in Blend for Visual Studion 2012. I want to have a simple check for design mode so that I can skip the code when viewed in the Blend Design Surface.

I tweeted this question and got an answer from my peers really quick.
var isInDesignMode = Windows.ApplicationModel.DesignMode.designModeEnabled;

Related

Font differences between Visual Studio 2019 and VS Code

I'm trying to make VS Code editor to look exactly like Visual Studio. I made sure the font settings are exactly the same, however text still renders differently in VS Code (it seems "lighter").
Is there any way to fix this issue?
In the image below the top text is copied from Visual Studio while the bottom one is copied from VS code.
I know the difference is subtle but is still pretty noticeable.
Font rendering in VSCode has been a reoccurring issue throughout a good portion of the editors life time. Font rendering, especially in portable GUI's, is affected by several different layers, for example:
Your Graphics Card can affect the way font is rendered (you can try adjusting the graphic cards settings manually).
Your Monitor, obviously, affects rendering. In fact your monitor has a huge impact. (Try playing with your Monitor's Settings)
The color settings that are offered by your OS may have an impact (often times the color settings are the same as the graphic card settings though. Which means you can just use your OS's GUI to adjust your cards settings in some cases (Not on Ubuntu though))_
Somethings are out of your control, like:
VSCode, it is written using Electron v6. Not only does Electron impact font rendering, but when VSCode switched it Version 6 a lot of people reported a decrease in the editors font rendering quality.
VSCode also implements Anti-Aliasing tools, but as far as I can tell, they auto configure, so you have no control over this. These tools are likely to be one of the biggest causes to the difference in rendering you see, between VS IDE & VS CODE. There is a tool however that may give you some control over the Visual Studio side of rendering that I share a link to below. And just as an FYI, the Anti-Aliasing that VSCode uses is called Sub-pixel Rendering, which is something that Visual Studio doesn't implement as far as I can tell.
The Area You Have the Most Control in:
There is ONE tool/thing that you have 100% control over, that also greatly affects font-rendering, and that is the font that you decide to use. When choosing a font, you have the choice of equipping an OTF, or a TTF. In my personal experience, OTF's render better 90% of the time. The difference is in how they are created.
TTF fonts are made using quadratic Beziers.
OTF fonts are made using cubic Beziers.
Links above are the same
Fonts use something called font-hinting
Font hinting. Essentially font-hinting is a list of instructions that dynamically changes the way a font is rendered, by using the rasterized grid background as a parameter. adjust the display of an outline font so that it lines up with a rasterized grid. Choosing a quality font equipped with good hinting is critical for non-blurry readable text.
Many people choose font because like the way they look, or the italic version of the font they use is popular. When choosing a font, it is extremely important to choose, not the coolest one, but the one that renders with the highest quality, and is the easiest for you to read.
Well Rendering Fonts:
Not only are their fonts that render well, with ligature support, but the best rendering fonts are always free IMO. Bellow are Fonts that use font hinting and have top notch rendering abilities.
JetBrains Mono (JetBrain's Font & My Personal Favorite)
Cascadia Code (Microsoft's Programming Font from 2019)
Fira Code (Not that old, but not that new either. Is loved by many.)
Fira Mono (No Ligatures, Different Font than Fira Code)
Consolas (A classic)
Menlo (Another Classic)
The top 4 are at the top of the list because they receive updates ever few months. I don't think Menlo & Consolas receive regular updates, but they aren't left forgotten either, the are updated every year or two.
To finish with as solid of an answer as I can provide:
_"Getting VSCode to render like the Visual Studio IDE, is not something that you will probably get, with 100% satisfaction, getting an exact match with all of the different factors is just an extremely and possibly impossible thing to due. You can probably make the way the two pieces of software render, more a like, not in functionality, but in looks. It would probably help a great deal to make sure that everything that affects rendering is up to date, editor, IDE, fonts, tools, ect... From their you can try different versions, and see if maybe an older version of VSCode rendered in a way that is preferable to you. You should also play with your monitors settings. I have found that I can accomplish a great deal just through the buttons under the face of my monitor. Check Visual Studio for any rendering settings it might have, VSCode doesn't have much available, but maybe Visual Studio IDE does (I haven't used the IDE in 5 years so IDK if it does).
On a final note:
Their is one tool that could help you, I haven't used it, because it isn't for VSCode, it's for Visual Studio, but it might give you more control than you have now. The tool is called..."_
Text Sharp (Click Here to see it in the VS Market Place)

Visual Studio 2015 Taskbar Title and Taskbar Previews Vague

Visual Studio 2015 is nice and all, but it's very hard to use when having multiple instance open. I have my Taskbar on the right, and this is what it looks like:
Any ideas on how to clear this up and make it easy to select the project I want, without hunting around?! Extensions welcome.
What do you guys do? Or should I utilize my memory powers more and remember which is which heh.
In VS 2013, there was VS Commands which helped, but they are yet to update it for VS2015...
One suggestion was to have my taskbar at the bottom of the screen. To me this is not feasible on a wide screen because you're losing even more height, where as you generally have more width that you can afford to lose...
I then tried it at the bottom, and it's even worse, since you fit less items in, and they group sooner, so you'd have to hover over VS before you can pick which one to switch to.
Update
As Sergey Vlasov mentioned, here is the window title change in action. Very nice solution, thanks!
You can create short abbreviations for your solutions using the Visual Studio Window Title Changer extension.

A simple Transition Animation

Trying to create a simple Card Game, I want to make a Transition Animation which moves an Image from a Canvas point to another. How can I do this?
I wonder if such animations are available out of the box.
you can just use a storyboard and provide start / end positions.
I show / hide text etc, change opacity etc no problems. infact all animations i used were direct port from WPDev and they work just fine.
More on them here
http://msdn.microsoft.com/en-us/magazine/cc721608.aspx
I recommend a Microsoft website named .toolbox which contains lots of video tutorial and sample code teaching you how to create animation by Blend and visual studio 2010.
Those code samples mostly are written by Silverlight in vs 2010. I tried to compile them under vs 2012, but it failed.

Why doesn't MS apply the ribbon UI to Visual Studio? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 11 years ago.
We have seen that office has the ribbon UI since 2007. Now is 2010 and we all feel the great productivity the ribbon has brought to us.
My question is why Visual Studio, now 2010, still not use the ribbon? What do you think? Please share.
Ribbon its a great user interface to organize tools like buttons and some kind of small items.
But it doesn't work well, (or at least it's very difficult to achive) when the user interface has to be very personalizable as Visual Studio has to be. And there's also the problem of many windows that are not toolbars, like the solution explorer or the many different designer, they can't be placed very easily.
Whili I'm not saying it's impossible. There is a lot of features that would have to be rebuilt to accomodate a ribbon.
From MSDN Ribbon User Experience Guidelines
Command scale
Is there a large number of commands? Would using a ribbon require more than seven core tabs? Would users constantly have to change tabs to perform common tasks? If so, using toolbars (which don't require changing tabs) and palette windows (which may require changing tabs, but there can be several open at a time) might be a more efficient choice.
For efficiency and flexibility, do users need to make significant changes to the command presentation contents, location, or size? If so, customizable and extensible toolbars and palette windows are a better choice. Note that some types of toolbars can be undocked to become palette windows, and palette windows can be moved, resized, and customized.
Because of some of this reasons I believe Visual Studio works better in a toolbar-based interface
PS: While I don't believe Visual Studio will implement the ribbon, Autodesk products like AutoCAD are very good examples of very complex ribbon-based application.
I kind of think Ribbon would be as bad for Visual Studio as those silly button bars. Working quickly in visual studio is all about good navigational keyboard shortcuts, not mouse clicking.
I have been using Office 2007 for over a year now.
The answer is simple, the ribbon interface is an almost purely cosmetic addition that in fact still slows me down dramatically.
It looks cool, and I like the fact it has more "text" and larger icons from a "Learning" perspective. But after you have "Learned" an interface the ribbon gets in the way. I find the excessively "verbose" text is distracting and causes me to spend more time looking for the desireable command.
Effectively it is just a menu turned inside out and sideways that causes you to have to click far too many times to perform actions. additionally the layout is very unnatural, it begins at the top then switches to the bottom "chunks" then goes into random left to right and top to bottom sections with possible sub menus.
This statement in the original post to me is completely inaccurate.
... Now is 2010 and we all feel the
great productivity the ribbon has
brought to us ...
I end up putting ALL the commands I normally use on the quick access toolbar and "hide" the ribbon to make up for the screen real estate it steals.
If it was put in VS I would do the same thing, add all the common commands to the quick access toolbar and "Hide" the ribbon.
Not really an SO thread, but I think the rationale behind not moving the VS interface to the ribbon was that it is meant for end users, who are typically non-technical. Users of Visual Studio do not fall in that camp (typically ;)) and there would definitely need to be a lot of usability testing and allowing developers to customize the interface to get it to where they're comfortable.
From this MSDN thread, a Microsoft employee marked this as the answer:
I once asked that question too, and the answer was then that the audience for the ribbon are the end-users. Since it uses much space and since the developer is an experienced user, there is no need for ribbon support in Visual Studio.
I agree that they should bring the ribbon to VS because the stacked command bar UI is dated and ugly. I have to look at that garbage for 8-12 hours per day. Let's not even get me started on how frustrating it is when a contextual toolbar grows the height of the toolbar and shoves the top of the text editor down.
But you're unlikely to get anything more than opinion here which is not really the right forum. I'd post it to http://connect.microsoft.com.

Visual Studio & GDI++

I tried to find a similar question here, but found something different. I prefer to use display fonts smoothing in Windows, but I don't like the way how Windows XP smoothes the display font edges. Currently I use GDI++ that smoothes the display fonts making them look very similar to text rendered in Safari browser for Windows (as far as I know, not a Mac user, it's a native approach to MacOS). Great, GDI++ really renders the fonts very similar to Safari almost for all application I use, but I'm disappointed knowing that GDI++ does not (and can't?) support Visual Studio and Google Chrome. I guess these applications use somewhat another way to render the display fonts (just GDI O_o; and I guess they take into consideration Windows font edges smoothing settings [no smoothing, Standard or ClearType]), but I'm not sure and I'm not familiar with it. :(
Please clarify this to me. I'd really like to use GDI++ in Visual Studio and Google Chrome. Probably, someone uses some workarounds (sure, if it's possible). Thank you.
This blog post by our esteemed benefactor is relevant. GDI+ indeed does things the Apple way, it uses true resolution independent rendering. It was pretty widely panned for this, so much so that it was replaced in .NET 2.0 with the TextRenderer class. Which uses the GDI DrawTextEx() function to draw text. To give an example of how GDI+ can suck, try running this sample Windows Forms form:
public partial class Form1 : Form {
public Form1() {
InitializeComponent();
}
protected override void OnPaint(PaintEventArgs e) {
e.Graphics.DrawString("Hiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii!", this.Font, Brushes.Black, 0, 0);
}
}
YMMV, but I haven't yet had a machine where that didn't look completely awful. TextRenderer saved the day.
Until .NET 3.0 when WPF was introduced. Back to resolution independent rendering. The amount of hate that generated was stunning.
Long story short, the majority of users like GDI text rendering. Or at least they get very vocal when they don't get it. Visual Studio and Chrome no doubt use GDI for text output. This is not something you can easily change yourself, although Chrome is open source afaik.
Just wait for the next version. Visual Studio 2010 will use WPF. Beta 1 generated a lot of hate for blurry text. But WPF has been tweaked to limit the fuzzies so it might not fit your taste anymore.

Resources