This tutorial showcases the wide variety of industries and applications created with WPF. It shows how to use the Snoop utility to determine what applications on your computer are built with WPF. Finally, it looks at some consumer applications based on WP
- [Instructor] One question I hear a lot when talking about WPF is who's using it and what types of applications are they building. This is a natural question from developers. It's good to know if the platform is widely accepted and whether it's robust enough to trust for your own applications. There are a lot of consumer apps made with WPF. I'll show you some in a minute. I also know that there are thousands of companies building a line of business applications, too. These are harder to show, because they are hidden behind corporate firewalls, but believe me, they are out there.
In my own consulting career, I've worked with teams creating brokerage and financial applications. I've worked on apps in the aerospace industry, for example, there was an amazing suite of control and scenario planners built for flight simulators, a key tool for training pilots. I also helped with prototypes for a production system for a jet assembly line. I've seen Point of Sale applications for large grocery chains, and inventory systems for clothing retailers, too. Then there is an interesting application used in the sign business.
You know those giant, jumbo tramscreens you see at your local sports arena? Here's a tip, their control systems, they are built in WPF. I saw a visualization system used in the oil drilling business, it'll let the operators and staff geologists see a many-layered, three dimensional underground view of the drilling site. This is just a sample of the apps I've seen in the business world. The point is, that WPF is a trusted system for building desktop applications and it permeates all corners of the line of business of the software development world.
Now let's turn our attention to some consumer applications that are written in WPF. To do that, I'll use a free utility called Snoop. To install Snoop, go to the Exercise Files folder and run this SnoopSetup.exe file. Once you go through the setup process by through a number of dialogs, you'll then have installed the application and you can run the app. So you'll have a very tiny log, you can see it here at the top of the screen. You drag it down here so you can see it, I'll just grab it from the edge here. Drag it down to the center of the screen.
The important thing for this demonstration is that Snoop interrogates all the running applications on my computer, and determines whether they have a reference to a WPF assembly. If so, it'll show it in this drop-down. Currently there's nothing listed in this drop-down because I haven't clicked the refresh button. Let's do that. Now I'll click on the drop-down and then see a list of all my current running WPF applications. I chose these apps out of the hundreds of possible choices because they're familiar names, or they show off some trade of WPF.
Here's one you might recognize, Microsoft Visual Studio, and here's also its companion application, Microsoft Blend for Visual Studio. There's some intuitive applications, Quicken 2016 Premier edition, and QuickBooks Pro 2016. This tool here called SourceTree, is a free utility for looking at source code repositories in a Windows application. It works with Mercurial and Get Repositories. Also I can see that I have Windows PowerShell ISE, that stands for Integrated Scripting Environment, so that's written in WPF, and I can see I have two instances of PowerShell ISE running.
The last one I want to point out is this one here called Spotware cTrader. This is an application that's a favorite in broker houses and financial houses, and I'll use it to show some of the live feeds and how you can represent them on the screen. Now this is a commercial application that'll cost money, but I'm looking at a demo. And speaking of cost, since most of these are commercial applications, you might need to buy some of them to experiment with the UI. The ones I'm showing today that are free or have a trial versions are Visual Studio, Blend, PowerShell ISE, the cTrader here, and also the SourceTree tool, are free.
Here's the interesting part about looking at these applications. You can be sure that any UI created for these applications is a candidate for the UI in your application, too. Use these applications for inspiration. I'll start by taking a look at Quicken. I'll close Snoop, I don't need that anymore. So as you look through this UI, think about what parts you might want to use in your application. There is menus and toolbars, there's some sort of tab better for here across the top where I can click on these and see different reports.
I can move over here and change the size of the window by dragging with my mouse. I can also click here to see this checking account, now this is a fictitious account I'm looking at here, these are not real transactions. And what I can do is see how the Intuit team created a check register, how they do things like color code their text, do things like split transactions. When I click on this button it'll pop up a dialog that I can work in, and then return back to the check register.
I can also do things like put flags on items so I can click here, click on this little button with the plus symbol on it, then mark this as flagged. And you see that Intuit or Quicken draws a little flag here on that row. Next I'll look at PowerShell. As you know, PowerShell is a console system inside Windows, but this ISE here gives you more than just a console in there. It gives you menus and toolbars and shows a list of the available commands on this side of the window here.
I'm using this one here, Microsoft PowerShell ISE, that's the application I'm using. And then I can do things like change directories, you can type part of a directory name and then press the tab key and I see they get Intellisent in this window, I get color coded text, and so on. When there's an error, then it'll show me error text in the console window, and you can see that the developer issues red text to indicate us an error. Next we'll take a look at Visual Studio.
This is our full featured development environment, and every window in here and all the tools that you're used to working with, are part of a WPF application. So things like your server explorer over here, the ability to auto-hide this by clicking on this pin button and have it snap to the side, and then bring it out again by clicking here to hover it back out over the window, and then when I click on it it'll disappear. There is the ability to work with things like the options window, and of course all your code windows and code editors are also WPF windows.
For the last demonstration I'll take a look at this tool called Spotware, this application here. Now what this is doing is it's giving me a live view of the market information that's flowing in to this application. So I can see updates here happening about once every 500 milliseconds or so. You can see it's updating, the colors are changing as we're updating, and then you can see the graphs are changing here in time. Like over here I can see this line moving up and down, I can see this item moving from right to left, and this shows you how responsive you can make an application.
I worked on some consulting jobs where we worked with a brokers house and the brokers had four or six monitors on their desktops, and they had feeds just like this and they wanted their feeds to be extremely responsive because they were making split second financial decisions and they wanted to see as much information as possible and try to get the edge on the other traders. Now you've got a good idea of the scope of the applications that are created with WPF. In the remainder of this chapter I'll look at some of the features that make WPF an interesting desktop development platform.
- Recognize the pluses of choosing Windows Presentation Foundations over other Microsoft UI frameworks.
- Evaluate the different options available with Windows Presentation Foundation project types.
- Devise a Windows Presentation Foundation project in Visual Studio.
- Break down the assemblies and parts of Windows Presentation Foundations.
- Use XAML editor and editor settings.
- Selecting data binding to present data.
- Compiling interaction code for an application.
- Use control templates, 3D parts, and effects in Windows Presentation Foundations.