Does Microsoft Office 2010 make use of WPF or is it plain old MFC?
Asked Answered
I

3

14

I have been using WPF for some time now and I am trying to reproduce some of the nifty UI features of their office suite. Although very easy in WPF, I am wondering how it could be done using MFC feature packs (I might have to use it instead, since my company has not yet approved the use of WPF). Since the Fluent UI was introduced with Office 2007, I am wondering if Microsoft actually uses WPF in anything else than VS2010 or Expression Blend and particularly in Office 2010. I hope that this question is not off topic.

Ixion answered 9/5, 2011 at 19:15 Comment(0)
J
5

As far as I know it does not use WPF in any way. In fact much of it is still written in C++. Really the only "big" applications Microsoft has released in WPF are Visual Studio 2010 and Expression Blend.

Jelena answered 9/5, 2011 at 19:25 Comment(0)
H
23

Office 2010 does not use WPF. In fact, it doesn't use MFC either. Office has traditionally used a custom UI toolkit, and this was true even before the Ribbon came into being. However, you only need one major first-party application to secure the viability of WPF as a UI platform. This is especially true when that application happens to be Visual Studio, since tens of thousands of Microsoft employees use Visual Studio every day.

But that doesn't mean that WPF is the best UI technology to use with the Ribbon. The Microsoft WPF Ribbon handles a lot of corner cases incorrectly, as do all the major commercial managed-code Ribbons that I've tested (WPF or Winforms). It is very hard to duplicate the Office Ribbon -- there are a lot of subtleties that are difficult to anticipate and only turn up when users run into corner cases.

The Office Ribbon took over 200 man-years of work and was exercised by tens of thousands of beta testers. (Jensen Harris estimated at UX09 that the Office UI team numbered some 15 PMs, 30 developers, 30 testers, along with half a dozen designers and UI researchers.) It's the best-tested Ribbon out there, but unfortunately it's one that developers outside Microsoft can't use.

The second most reliable ribbon framework is probably the Windows 7 ribbon, which is used by Paint and WordPad. This one is available in the Windows 7 SDK, and has been backported to Vista. Native code and GDI, so it's targeted towards C++ developers. Note that it's also not tied into MFC.

Haematinic answered 12/5, 2011 at 1:13 Comment(2)
I find it interesting that they invested so much into a control that can only be used internally. Aside from that I find it really interesting that Microsoft makes UI frameworks (Winforms, WPF), but none of the latest Office clients are built from them. It seems like it would make great business sense to write the newest cient in WPF because they may need to build custom controls (which need to be tested) and then they can offer those controls to the WPF community for free.Roddy
Not even Office Add-Ins can make use of all of the ribbon features in Office.Ebberta
J
5

As far as I know it does not use WPF in any way. In fact much of it is still written in C++. Really the only "big" applications Microsoft has released in WPF are Visual Studio 2010 and Expression Blend.

Jelena answered 9/5, 2011 at 19:25 Comment(0)
L
-3

You do realize WPF (with the .NET framework) is just a layer over win32 and com (direct2d, etc), all of which can be accessed from plain old C++, not to mention MFC. They already had all their ribbon code in C++ from 2007, so making the 2010 interface isn't hard.

To answer the question you think you're asking, no, Office doesn't use WPF. Only Visual Studio uses it.

Larina answered 9/5, 2011 at 19:26 Comment(9)
I know it is a layer over directx and win32. I guess, I am trying to understand why they wouldn't make use of WPF in successful product as a statement to convince developers to move to that technology, instead of implementing everything by themselves.Ixion
Because they'd have to rewrite everything from scratch. Rewriting VS2010 was probably enough for a while for them...Larina
WPF is definitely NOT a layer over Win32 (but it does use DirectX). Windows Forms was a layer over Win32... In WPF, the only dependencies on Win32 are the window itself (with is just one specific implementation of PresentationSource), and some system dependencies like the OpenFileDialog.Punctilious
@Thomas, how is that a not? The window parts are win32 and the rest is com stuff, exactly like I said above.Larina
The Window itself is Win32 only because it needs to be displayed in Windows; everything that is rendered in the window has nothing to do with Win32, the controls don't have a handle like in WinForms, and they're not painted by the system.Punctilious
Actually it's all rendered on WM_PAINT. I still don't get what your point is.Larina
I thought WPF didn't make use of the WM_PAINT?!Ixion
Of course it does, it's the only way of knowing when to redraw your window in Windows.Larina
@Ixion I've heard that it's because Office is an old product with a large existing code base in unmanaged code. It could also be because they use it on Mac and/or so that they have complete freedom to develop without waiting for WPF or other UI frameworks to catch up or conform to some specific use case. There is no doubt that they are spending a lot of effort maintaining a custom UI toolkit, so I imagine there's a good reason.Roddy

© 2022 - 2024 — McMap. All rights reserved.