Office 2007 and WPF - wpf

I've recently been using Excel and Powerpoint 2007, and it's seems clear that the shapes are using WPF.
Edit - I know the shapes have existed in Office for ever, that is not my question. Look at the fill possibilites for shapes in 2007, look at that gradient fill, look at its parameters - that's the same as WPF as far I as I can see. So back to the original question, does anyone know what Office is using to do that? I'd be pretty sure that MS didn't re-invent all that graphical niceness, 3D, rotation and so on just for Office, when they have the exact same stuff in WPF already.
Can anyone confirm that office is using WPF? If so what I'd like to do is get to those WPF items so we can use them in our own apps, effectively use Excel/Powerpoint as a WPF generator.

The shapes you see in Office 2007 have been around since long before WPF. These vector graphics could in fact have been rendered by WPF, and if Office is ported to WPF some time in the future, they probably will be.
If you are looking for an easy way to create vector graphics for your WPF app, you might want to take a look at Microsoft Expression Design.

I doubt. You can always make any effect you like without WPF it's just a matter of code
Office is old code it pre-dates .Net!

As far as I know, you could create the Office 2007 look and feel using MFC Feature Pack (See this tutorial: http://nibuthomas.com/tutorial_mfc_feature_pack1_part1 )

Related

Telerik, Infragistics, XCeed,

I'm looking for a vendor for a grid control for WPF that works nicely together with MVVM; and that allows grouping by dragging the columns. I've been looking around and at first sight it seems that my choice at the moment would be Telerik.
If there are people that have experience with one or more vendors, I would like to hear your opinion.
Thanks!
L
did you try the dataGrid included in WPF .net 4.0?
as MS finally added one, you could first try to use it and see if it suits your needs.
except of course if you are limited (having to use .net prior to v4.0 for instance...)
see there for more info:
http://msdn.microsoft.com/en-en/library/system.windows.controls.datagrid%28VS.95%29.aspx
The Xceed DataGrid for WPF does support MVVM. You can refer to their product page for more information here and you can also refer to their extensive and online documentation here.
After installation, you are also given many sample applications that are installed on your machine. You can find them here:
C:\Xceed Samples\Xceed DataGrid for WPF Professional Edition vX.X

Moving from WinForms to WPF

Well we are considering to move from WinForms to WPF, what pitfalls does WPF have? And we got component one's flexgrid is there any wpf grid that has the same functions? one nice thing with it is that you can implement your own draw method for the cells... It can merge cells print and save to many file formats..
In general, WPF development is very different from WinForms. You should expect it will take some time to learn the new technology (or you might even need to hire new developers =)).
WPF approach is in many ways better than WinForms' one: check out styles and triggers, data binding, control templating, eventing model.
I would recommend you to start exploring it, but wait for the WPF 4 (and the boring MSDN page) to start the actual migration, because it is going to be even better and close some of the very annoying gaps.
First of all, WPF works pretty different from Windows Forms and likely requires a different approach on how to structure and design the application. At least it works way better if you do it the way it was conceived.
As for single Windows Forms controls, this shouldn't be a problem. There is a WindowsFormsHost which enables you to include Windows Forms controls in WPF.
The change from winforms to WPF is not a change I'd reccommend unless you have specific requirements which WPF fulfills - WPF is not intended to be a replacement, simply an alternative which is more suited towards graphically rich applications.
If you do have a specific requirement then you also might want to consider embedding WPF controls into winforms applications, rather than converting your entire application.
The learning curve is slow to get going, but once you get the idea it all starts to make sense. We have "Pro WPF in C# 2008" book floating round the office and its been a great help. Of course most things get googled to find an answer, but to find out why something is done the way it is this book was a great hope - to me anyway.
There are some annoying features but its still WPF is still quite new. Like most things, if you come across a problem someone has likely come across it before and there is an answer out there!!
J
Take a look here for a datagrid: http://wpf.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=29117
The main hurdle with WPF is simply the huge amount of new stuff to learn (if you wish to use it properly). I'd think twice if you're on a tight schedule, but it might be worth it if you have 6 months to spare...
Speaking from just my experience, moving from Windows Forms to WPF took some re-learning. A few months into the transition most changes made total sense. WPF removes much of the frustration associated with using Windows Forms. It allows for a truly rich UI development experience especially when working in tandem with designers. I strongly recommend WPF Illustrated by Daniel Solis as a learning aid.
With reference to the grid, Syncfusion offers a WPF grid control that implements the features you have asked for. It implements true virtual mode with cell level customization, printing and export to multiple formats including Excel. Disclaimer - I work for Syncfusion.

WPF toolkit datagrid spreadsheet

I would like to add excel spreadsheet functionality to the WPF toolkit datagrid, can this be done?
I am building a wpf client-server application and I want client tohave wpf toolkit datagrid cells which would behave like excel spreadsheet cells would behave... Meaning they would have formulas and such... just like the spreadsheet would.
I am trying to accomplish this without the usage of Farpoint datagrid product that i already use for a winforms client-server application.
Thanks.
Did you have a look at Clear Office?
It is similar to farpoint but written in WPF. Very easy to use. No COM interop.
Theoretically it could be done, but it will require a fair bit of coding (I'm talking weeks to months here rather than days). You could possibly knock up a simple implementation using limited functions reasonably quickly, but you'll soon start to run into problems. If I were you, I'd look into alternatives.

Should we migrate to WPF or Winforms? [duplicate]

This question already exists:
Closed 14 years ago.
DUPE: When is Windows Forms the correct choice vs WPF?
We have to decide these days whether or not to go with WPF as a platform for building our next generation of our product.
Personally I am a little afraid of using this technology especially because of performance and because it's not mature (I am not sure about the quality of the UI editors such as Blend).
Personally, I absolutely adore WPF.
It requires a fundamental shift in thinking from Winforms. Winforms you drag and drop stuff on to a form. That gets you 80% of the way really quickly and easily, but when you need to move outside of the things that WinForms explicitly covers, you enter a world of pain.
In WPF, first thing you do is turn off the visual editor. The code for your UI goes from an ugly mess to something beautiful. Also, it is remarkably powerful and flexible, once you get the hang of it the things you can do are absolutely amazing.
The downside to WPF is that it is more heavy then WinForms, and the learning curve is relatively huge. However, it is the way of the future, and unless it is a trivial app you are making, I would choose WPF hands down.
If you don't need a very glossy UI with animations and so on, I see little reason to jump to WPF... just yet.
If you are worried about performance, you should check these MSDN pages:
Windows Presentation Foundation Performance
My guess is that WPF is even outperforming Winforms as long as there is appropriate DirectX hardware because rendering can be done by the GPU directly then.
Considering MS is building their next version of VS with a WPF based code editor, I find it hard to find support for WPF not being 'mature' or having performance issues.
I would say if you are able to migrate anyway, you might as well upgrade to increase the longevity of your code base. If your code is written properly in Winforms, it should not be very difficult to start moving this forward into WPF.
I started about 10 weeks ago teaching myself WPF, and then in the last 2 weeks I have actually written an application in WPF.
I came from ASP.NET and I love WPF. I love the XAML markup, it just makes more sense than dragging items over and making sure they are in the right place in a WinForm.
The styling is easier in WPF, you can quickly make a border with rounded corners.
Using Expression Blend you can design a really nice interface with animation.
I developed a WPF app on Vista (home), and XP (work) and they both look really nice.
I have been very pleased with WPF and would not go back to WinForms.
My sense would be that if you are happy with the look and feel of winforms, then stick with it. If you think you will be doing any visual customization, then go WPF. But then I have been working with winforms for a long time and WPF very little. If I was starting out, I would probably focus on learning WPF since it really is much more flexible

Are WPF more 'flashy-like' than winforms?

I just installed visio, and the installer almost seemed like it was built in flash.
The buttons kinda glowed when I hovered over them, and when I clicked on 'continue' the form phased out in a cool way.
I'm assuming it was built in WPF.
Anyhow, so are WPF more flash-like (visually speaking).
Do they have new properties where you can make forms phase out nicely/smoothly compared to winforms?
Disclaimer: I work for Microsoft. However, I don't work on Visio, WPF, CLR or Silverlight team. So, the following is my personal take on these technologies. If you want to quote me, don't do it implying it's the official Microsoft position. :-))
Update: Anything I say below about Flash/Flex/AIR might be wrong, as I have not worked with these technologies and what I know about them is based on what I read on the intertubes. :-) If you notice anything wrong, just shout in the comment and I'll correct it.
To the best of my knowledge, the Visio installer is not built with WPF. It's all unmanaged code; it's just people took a lot of care to make it really polished.
WPF is the new UI platform for building standalone applications for the Windows OS. It supports a declarative UI language - XAML, and related CLR types to program against. WPF is a different platform than WinForms, although it is possible to build applications that mix UI built with both. WPF supports a lot of things that WinForms does not, like bitmap effects, animations, control styling and so on and exposes them both in XAML or through code. Also, WPF relies heavily on vector graphics, as opposed to the pixel graphics in WinForms. In short, WPF is quite powerfull and allows building very snazzy UI. (Don't take my word for it, though, as I am biased; go check around for what people are saying about it or buiding with it. :-))
WPF and WinForms do not compete with Flash/Flex. WPF and WinForms are both UI frameworks for building standalone client applications. As far as I know, Flash/Flex are frameworks for building rich internet applications - RIA (though lately people started interpreting this abbreviation as rich interactive applications).
Adobe did come up with AIR about half a year (or maybe a year) ago, which allows building standalone client applications, so you could say that Adobe is trying to position Flash/Flex/AIR to compete with WPF. Of course, that's my take on it and I doubt Adobe's official positiong is anything like that.
If you want to compare particular MS technnologies with Flash/Flex, take a look at Silverlight - it's the MS RIA platform.
Silverlight is related to WPF in the sense that they share XAML and the corresponding CLR types. Silverlight supports only a subset of what WPF offers, though, as it is not targeting Windows OS only and thus is limited by the fact that it has to be portable.
Quick update to reflect the changes in the year since I've written the answer :-)
With Silverlight 3 shipped, SL and WPF are getting even closer and sharing bigger set of supported features. In addition, most of the new XAML controls are built for platform at the same time. Thus, SL/WPF are getting to a point of singularity...
Also, SL 3 supports out-of-browser applications. In that sense, SL is not only starting to compete with Flash/Flex, but it is also encroaching on AIR's turf.
And no, I still don't work on the WPF or Silverlight team. :-)
WPF is being used as a replacement for WinForms, and as a competitor to Flash in the form of Silverlight. WPF consists of an entirely new object model that sits on top of DirectX (at least the desktop version). You can create WPF windows, controls, etc, entirely using C# or another .Net language just like you can render WinForms. However, Microsoft has also created a markup language called XAML (eXensible Application Markup Language). Nodes in an XAML document (XML) map to objects in a similar fashion to the way ASP.Net maps to web controls. XAML typically exists in a .Net project alongside a code-behind style C# file (or VB.Net or whatever). The C# file interacts with the objects generated by the XAML. This is fairly consistent with the "graphics via markup, logic via code" model that Microsoft and others are pushing.
One of the overlooked features when discussing WPF is the completely awesome data-binding that Microsoft wrote for WPF. The new data binding framework is a quantum leap beyond Windows Forms 2.0 data-binding. Microsoft added a couple of new interfaces that make it much easier to make an object or collection emit data-biding events properly. They also provided a very rich set of data-binding classes. You can bind anything to just about anything else. You can bind one-way data to control, control to data, two-way control to data and back, control to control, etc.
Back on the graphics side of the house, WPF makes it fairly easy to make an existing control look like anything. WP lets you compose your own template for what a class of buttons should look like, or one button, or all buttons. Or radio buttons. Or labels. You get my drift. Imagine if CSS included the ability to define what an input button would look like using other HTML controls.
They also provide a number of layout controls. You can continue to use exact positioning like in WinForms, or you can leverage of variety of techniques to make your window act more like a web page that grows and shrinks with resizing, etc.
The downsides: It is too easy to create spectacular effects that crawl on slower machines. Some of the graphics do not take advantage of hardware of graphics cards, though Microsoft has incrementally improved support for this. I believe when 3.0 first came out drop shadows were rendered purely using software. I think 3.5 or 3.5 SP1 changed it so that WPF would utilize graphics hardware for the task. Microsoft has said they will continue to enhance WPF in this fashion.
WPF is .Net 3.0 and above, which runs on XP SP2, Vista, and Servers 03 & 08. So don't plan on deploying WPF to a customer with Win2k desktops.
Summary: If you are doing desktop programming in .Net, you should be doing it in WPF unless you are targeting Win2k. You can avoid the downsides of WPF, and there are many upsides. Microsoft will probably throw away WinForms in some future release, or at very least you will stop seeing new features, etc.
As far as Silverlight goes, the betas for SL 2.0 look good. I think that Silverlight will require some wide-spread adoption. Microsoft has already tried to get this going. The NBC Olypmics site used Silverlight, and Major League Baseball uses it for its MLB.tv product. As soon as Silverlight gets a good install base I think you will see the Microsoft side of the development world starting swinging away from Flash and to Silverlight.
Edit after using Silverlight 3 and MVVM:
I have moved away from WPF and am doing a lot of Silverlight 3 development. But I think my comments here will still apply to the WPF developer.
I have been using the MVVM pattern in my app (think MVC with a twist). The Microsoft Patterns and Practices team has released a set of libraries known as Prism that supports various aspects of MVVM. There are WPF and Silverlight versions. Take a look at MVVM and Prism if you are going to be doing WPF or Silverlight development.
You can do a lot of flash w/ Winforms, or with custom components. But if you want out-of-the-box bang-whizz availability, WPF is the way to go.
Yeah, I think the intention is to be flash-like, it seems to me that MS has set its sights on taking down Adobe.
The way I see it: WPF is to Flash as WinForms is to Flex. WPF has more emphasis on vectors and states than on programming.

Resources