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.

ak3nat0n
  • 6,060
  • 6
  • 36
  • 59

3 Answers3

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.

Tao Yue
  • 696
  • 5
  • 9
  • 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. – The Muffin Man Nov 19 '14 at 20:39
  • Not even Office Add-Ins can make use of all of the ribbon features in Office. – Chris Jun 06 '18 at 19:27
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.

Matt West
  • 2,874
  • 1
  • 19
  • 13
-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.

Blindy
  • 65,249
  • 10
  • 91
  • 131
  • 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. – ak3nat0n May 09 '11 at 19:39
  • Because they'd have to rewrite everything from scratch. Rewriting VS2010 was probably enough for a while for them... – Blindy May 09 '11 at 19:41
  • 15
    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. – Thomas Levesque May 09 '11 at 20:16
  • 2
    @Thomas, how is that a not? The window parts are win32 and the rest is com stuff, exactly like I said above. – Blindy May 09 '11 at 20:18
  • 13
    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. – Thomas Levesque May 09 '11 at 20:22
  • 2
    Actually it's all rendered on `WM_PAINT`. I still don't get what your point is. – Blindy May 09 '11 at 20:27
  • I thought WPF didn't make use of the WM_PAINT?! – ak3nat0n May 10 '11 at 06:28
  • 1
    Of course it does, it's the only way of knowing when to redraw your window in Windows. – Blindy May 10 '11 at 13:44
  • @ak3nat0n 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. – The Muffin Man Jan 16 '17 at 22:13