I actually had WPF pushpins originally, but chose not to go that route. That's not to say you couldn't. In fact, I actually use an invisible (Opacity=".01") WPF button over the pushpin rendered by the map. That's how I chose to implement the ability to
hover over the pushpin and get a WPF InfoBox (implemented as a UserControl). If you really want to have WPF based pushpins, just comment out line 387 in VEMap and comment out line 401 which is the call telling VE to add the pushpin.
& managed code, the repositioning of the pushpins is a little “jerky.” So I am a bigger fan of drawing your pushpins with a vector drawing tool, and then saving them as bitmaps. You get the same visual experience with better overall perf. Your mileage may
Do you mind explaining why you believe this is a terrible programming practice? I can guess that you might think the "var" keyword means that "request" is a variant. Not so. What you are seeing is a new feature of C# 3.0 called type inference. The
variable "request" is strongly typed. In this case, "request" is of type WebClient. Essentially, the way it works is the compiler evaluates what's on the right hand side of the equals sign and ensures that the variable on the left hand side is typed appropriately.
Personally, I think using the var keyword is a matter of preference, but not a terrible programming practice as you suggest. The beauty is that the following two lines of code are identical to the compiler:
var request = new WebClient();
WebClient request = new WebClient();
I don't think there is necessarily a right or wrong answer here. I think it is a bit of a stretch to suggest I have declared request
improperly. It would be more accurate to say that I have declared request in a way that you dislike for valid reasons. You make some really good points about the side effects of using var. I appreciate you making these points because it
is very important for people to understand the side effects you mention. Unfortunately, I can't cover every detail about all the technology in use in a screencast/demo. If I did, the screencast would have been at least twice as long:).
one could argue a number of technologies such as intellisense, code snippets, and many more have made me a lazier programmer over the years. I surely know that I can't code in notepad or vi like I used to because of my dependency on both IDE and language
features. Then again, it is also fair to say that the productivity gains outweigh the dependency on the features.
With the var keyword, it seems the documentation at
http://msdn2.microsoft.com/en-us/library/bb383973.aspx would somewhat support your statements since it says “It is recommended to use var only when it is necessary, that is, when the variable will be used to store an anonymous type or a collection of anonymous
types.” However, like any documentation, it is a recommendation. I still believe the use of var is a matter of preference. Am I misusing the var keyword? That’s in the eye of the beholder. I know where you stand:).
Highlight the js or markup that you want to turn into a "reusable chunk of text," left click and drag it over to the toolbox. You now have a new toolbox item. You can then right click the item an rename it to something more memorable.