Even a chimp can write code

Thursday, October 19, 2006

Internet Explorer 7

Internet Explorer 7 has now been released. I'm not going to tell you to Spread the word. Or to plug it on your sites and magazines; to go out and get buttons; to bash the competition on silly metrics; to sign petitions in support or think up propaganda campaigns. Internet Explorer 7 is just a browser. A damned good one too.

Tags: ,

Email this | Bookmark this

Monday, October 09, 2006

Notes from the Mozilla team's visit to Microsoft campus

Last week, the Mozilla team was on campus. I've been following their visit via the journal that Vladimir Vukićević has maintained on his blog.

  • Redmond, Pt. 1: Says he hopes to figure out the 2D rendering in Vista and some Direct3D aspects.

  • Redmond, Pt. 2: App compat, UAC, DPI awareness and the XBOX 360 room

  • Redmond, Pt. 3: By this time he's amused and slightly irked that just about everybody he meets is a Program Manager. Talks about CardSpace, Windows Installer and WiX, Watson, IE and running in Low Integrity Level, and closes with a SuperFetch rant

  • Redmond, Pt. 4: Clarification on SuperFetch and UAC. No he's not drinking the Microsoft kool-aid just yet. WPF/E, parental controls in Vista, IE again, and has some good advice for us on WhatWG.

  • Missing pieces: He's excited about Low Integrity Mode with UAC and a project to integrate CLR languages with Firefox as first-class scripting language providers.



Tags: , ,

Email this | Bookmark this

Thursday, October 05, 2006

Desktop 2.0

Kevin Gjerstad pointed us to this post by Brian Romanko who thinks we might be on the verge of Desktop 2.0. I hate buzzwords, and particularly despise the lazy little creations with version numbers. Yes, Web 2.0, you're on notice.

But if you look beyond that facade, I think you'll see the truth in Brian's statement. The past decade has seen the mercurial rise of applications on the Web. Most of the applications you use everyday have made their slow voyage to being online solutions. But Mac OS X and Windows Vista usher in an age of the resurgent desktop application. They help highlight the areas where the browser solution falls apart. I'm not for a minute suggesting that the web world cannot overcome some of the limiting factors (readability, offline applications, local storage etc.). But until a year or so ago, few would suggest that anything in the desktop world could stem the flow of applications into the web world.

With Windows Presentation Foundation (a .NET 3.0 component and part of Windows Vista), we've strived to blur the line between desktop applications and web applications. In many ways I see that as my charter and that of all my Application Model team mates. To developers, the same programming model used to develop a desktop app can be employed to develop a web app, or vice versa. To administrators, deploying the desktop app is about as simple as deploying a web app, taking the pain of installers away. To consumers, the richness and user experience one expects from the desktop world is now possible within the browser. Our work has just started though and we haven't achieved nearly enough.

Footnote: Miguel de Icaza, who has been known to be skeptical about WPF, now seems to be pleased with what we've done after he saw the New York Times Reader. Maybe we just do bad demos, and need to tone down the gratituitous use of animations, 3D and transforms. But the proof of the pudding is in the eating.



Tags: , , , , ,

Email this | Bookmark this

Tuesday, October 03, 2006

Web design patterns: Navigation

I was thinking of web design patterns that may be candidates for controls for use in Windows Presentation Foundation (WPF) apps, specifically the browser-hosted application flavors (XBAPs). I figure I should list the ones that I think are prevalent on the web first.

Bread crumb bars
This is what got me started. Hua and I were talking about this sample she started working on. Bread crumbs tell you where you are within a web application or site.
Web design patterns: Bread crumb bar navigation
Each label in this pattern is a hyperlink, making it easy to jump back to another level. This is especially suited for sites that have a structured hierarchy, usually 3 or more levels.

Bread crumbs tell users exactly how they arrived at the current location but do not tell a user where they can go from here.


Directory-based navigation
Web design patterns: Directory-based navigationIf your site or application has categories and sub-categories, this is a good way to display them to users and facilitate navigation. This gives users a broad overview of functionality offered by the app, and the ability to switch between items in the same category. Directories are not suited for sites or apps that have deep hierarchies (i.e. >2) or fragmented sub-categories.

Doormat
The Doormat is another pattern used to direct users to the appropriate section of the site. This works well if you have a small number of categories, with each having small number of sub-categories. The typical use of this pattern is on a landing page or home page.
Web design patterns: Doormat navigation


Fly-out menus
Web design patterns: fly out menu navigationThe Fly-out has an old standard at Microsoft.com. It conserves space well because menu items are generally hidden, and when exposed the fly-out menus overlay the page content. These were made popular on the web mainly with DHTML where the menu functionality could be made fast enough to not be an irritant. These fly-out menus can be horizontal or vertical.


Horizontal and Vertical navigation
This consists of a horizontal bar with hyperlinks laid side to side. Usually appears at the top of a page. Use this when you want the navigation item to be visible throughout your site or app. The current page is usually highlighted on the horizontal navigation bar. The position of this navigation bar at the top of the page can be a hindrance if your page content requires users to scroll down.
Web design patterns: Horizontal navigation

When sub-categories exist, it is not uncommon to employ the double horizontal navigation pattern. The law of diminishing returns applies with each added level.
Web design patterns: Double Horizontal navigation

Web design patterns: Vertical navigationAnother variant is the Vertical Navigation menu. These menus suffer some of the same disadvantages as their Horizontal cousins. However, their main advantage is in their scalability. Scrolling vertically is seen as less of an irritant as scrolling horizontally.


Tabbed navigation
Tabs extend the horizontal navigation menu concept further. They allow categorizing content where top level items are fairly static. They also provide visual cues that suggest ownership over a page's content. The double tabular form has two levels where the top level is static and the bottom level changes based on top level selection.
Web design patterns: Tabbed navigation


This post does not aim to be comprehensive. I hope it got you thinking about navigation paradigms. So in closing...

Questions to the WPF community:
  1. Would you consider it valuable if there were high-level, native support for these navigation patterns in WPF? If so, which ones?

  2. Would you like to create one or more controls based on these patterns? If so, drop me a comment. I'll be happy to post them to the WPF community site.

  3. Are there other important navigation paradigms that I missed? Any that you'd like to see WPF versions of?




Tags: , , , , ,

Email this | Bookmark this

Monday, October 02, 2006

How do I get the .NET Framework directory?

Let's look at several ways to slice this one:

Hard code the path
Use %WinDir%\Microsoft.NET\Framework\v2.0.50727
This method is fragile and involves knowing the several things not least the version of the Framework. If you were looking for simplicity, say in the WiX configuration file, you might go with this. Otherwise, there are much better options available.


HttpRuntime.ClrInstallDirectory
If you're in ASP.NET or otherwise already have a reference to System.Web.dll, you may want to use the HttpRuntime.ClrInstallDirectory property. Otherwise, this may not be worth loading yet another assembly.


GetCORSystemDirectory
The GetCORSystemDirectory method, in mscoree.dll, returns the fully qualified installation dir of .NET Framework loaded into the current process.

HRESULT GetCORSystemDirectory (  LPWSTR pbuffer, DWORD cchBuffer, DWORD* dwlength );

pbuffer - [out] Buffer in which the runtime returns a string containing the fully qualified name of the installation directory of the runtime

cchBuffer - [in] the size in bytes of pbuffer

dwlength - [out] The number of chars returned in pbuffer

Of course, if your managed code file needs this info, you'll need p/invoke.


RuntimeEnvironment.GetRuntimeDirectory
My personal favorite. The RuntimeEnvironment class is in the System.Runtime.InteropServices namespace. I'd use RuntimeEnvironment.GetRuntimeDirectory() simply for elegant, readable and maintable code. Plus, it is in mscorlib.dll.


This post is by no means comprehensive. If you know of a better way to do this, please drop a comment.


Tags: , ,

Email this | Bookmark this