Virtual Earth Wrapper for Silverlight (VIEWS)

At MIX 08, Chris Pendleton announced that the Virtual Earth team is working on a Silverlight 2 control.  The idea of being able to use managed code instead of JavaScript to build your Virtual Earth applications is very appealing to many.  I know many people are eagerly awaiting the Silverlight 2 control from the Virtual Earth team.  No, I don't have any news on when that control will be out, but I do have some good news.  There is an interim solution for those of you dying to write some managed code in the browser instead of JavaScript.  Adam Eversole, from Microsoft Research, built VIEWS precisely for this scenario.  VIEWS was originally a internal-only project at Microsoft.  When Adam shared his work, he immediately received a number of requests to make it public.  I am happy to report that Adam was gracious enough to share the love!  I worked with Adam, John Pelak, and Jared Bienz to get this out to the world.  The real credit goes to Jared though.  He did all the work of getting VIEWS ready for public consumption.  So what are you waiting for?  Hop on over to http://www.codeplex.com/views to get your hands on VIEWS.  Jared also recorded a Channel 9 screencast at https://channel9.msdn.com/posts/jbienz/Virtual-Earth-Mapping-in-Silverlight-with-VIEWS/ that gives you a quick intro.

Technorati Tags: ,
SCREENCAST: Using Virtual Earth in a WPF Application

As promised, here is the screencast for my previous post:

http://channel9.msdn.com/posts/keydet/Using-Virtual-Earth-in-a-WPF-Application/

WPF and Virtual Earth revisited

I've been pretty quite on the blogging front lately.  Every once in a while, I get the opportunity to work on something a little meatier than writing demo code.  Almost all of my time over the last month or so has been spent working on a couple such opportunities.  During this time, I worked on a more creative/reusable approach to hosting Virtual Earth in a WPF application.  If you have looked at any of my previous samples showing how to host Virtual Earth in a WPF app, you'll recall I was using the WinForms WebBrowser control to host an html page that in turn hosts Virtual Earth.  Additionally, I used the WebBrowser control's ability to enable communication between managed code and JavaScript.  One of the frustrations with this approach is that when using WinForms interop, all WinForms controls take the highest z-order in your app which means you cannot render WPF elements on top of the map.  The other thing that has always bothered me about my sample is although it showed how to implement the general approach, it did not wrap all the functionality into a reusable WPF Virtual Earth control.  Good news!  I have an updated sample.

I created the beginnings of a WPF Virtual Earth control.  That's right, one you can just reference, add to your XAML, and start programming against without having to know the dirty underbelly of how it is implemented.

image

...

image

You simply use your .NET language of choice to program against the control's API like you would with any other WPF control.  No need for JavaScript.

The control is a WPF wrapper around the Virtual Earth Map Control 6.1.  In the interest of time, I mirrored the the Virtual Earth Map Control 6.1 API.  However, there are a few deviations.  The control really should, but doesn't, follow .NET coding and naming conventions.  For the most part, it mirrors the JavaScript API.  The control is far from perfect and it is currently only a subset of the JavaScript API.  I implemented the subset of API I needed for the work I was doing.  Having said that, I think I have created a decent foundation that could be built upon to have a full WPF wrapper around the Virtual Earth Map Control 6.1.

I decided to use the new WPF WebBrowser control that is in the .NET Framework 3.5 SP1.  The WPF WebBrowser control is similar to the WinForms WebBrowser.  The WPF WebBrowser control has the same z-order as it's WinForms counterpart, but it eliminates the need for WinForms interop. 

The WPF map control allows you to create WPF UserControls and have them appear on top of the map:

,image

In the picture above, the InfoBox, which is the term Virtual Earth uses for the UI that pops up when you hover over a pushpin, is a UserControl that uses WPF databinding to show Title and Description.  I am clearly not taking advantage of the power of WPF in this example, but you get the point:).  You achieve this through the following code:

image

You set the InfoBox property of the map to an instance of your UserControl.  The map control does all the heavy lifting of positioning/showing/hiding your UserControl.  The map control also allows you to add as many UserControls as you'd like through map.AddControl.  However, you are responsible for positioning the controls yourself.  In the picture below, I have replaced the default Virtual Earth Dashboard control with a UserControl containing WPF buttons:

image

If the WPF WebBrowser control still has the z-order issue, then how am I rendering WPF content on top of the map?  I am using what I have been calling "layered window trickery" for lack of a better term.  The map control loads a transparent window with a higher z-order than the window the control is in.  The map control places the transparent window itself "covering" the area of the map control.  Since the top window is transparent, interaction with the map below behaves as if there isn't a window over the map control.  When a call is made to map.AddControl() or to set the map.InfoBox property, I actually add the UserControl to the top window.  As you can imagine there is a bit of repositioning logic for the top window & WPF UI over top of the map.  I plan on recording a Channel 9 Screencast walking through the code.  If you can't wait, then you can just download the sample here and dig through it yourself.  The control uses new features in the .NET Framework 3.5 SP1.  Make sure you install Visual Studio 2008 SP1 Beta before trying to open it.  Details here.

FOLLOW UP: RIA Dinner (Reston, VA)

Thanks to everyone who attended the RIA dinner on June 17th.  I promised to publish the deck and code James used as well as some follow up links.  Here they are:

Presentation - deck, code

Expression on microsoft.com - http://www.microsoft.com/expression/

Expression Community Site - http://expression.microsoft.com/en-us/default.aspx (lots of great resources on the "learn" tab)

Expression Design Forum - http://forums.expression.microsoft.com/en-US/design/threads/

Expression Blend Forum - http://forums.expression.microsoft.com/en-US/blend/threads/

Expression Blog - http://blogs.msdn.com/expression/

nibbles: snack tutorials for hungry designers - http://www.nibblestutorials.net/

Technorati Tags: ,,
Posted 23 June 08 08:22 by marcsc | 0 Comments   
Filed under , ,
FOLLOW UP: Public Sector Developer Conference (Nashville, TN)

Thanks to everyone who attended.  Sorry about the overflow into the hallways.  There was much less dropoff between registration and attendance than we normally see.  Some of the content isn't published yet.  Once it is, we'll make sure to update this post with the appropriate links.

Building Rich Internet Applications Using Microsoft Silverlight 2

Building WPF Applications in Visual Studio 2008 and Expression Blend - deck, code

Data Access with Language Integrated Query

Overview of the .NET Framework 3.5 SP1 & ASP.NET MVC - deck, code

We also mentioned some downloadable tools that folks were interested in using.  Here are the ones I remember:

Visual LINQ (to SQL) Query Builder

LINQPad

If I forgot one, please let me know by posting a comment and I will update the post.  Thanks!

-Marc

WPF validation with Enterprise Library 4.0

If you have not heard the announcement elsewhere, Enterprise Library 4.0 from patterns & practices is now availableMartin Bennedik just updated his WPF integration for the Validation Application Block (VAB) to work with Enterprise Library 4.0.  He has also added some very convenient features.  This is a MUST HAVE if you are looking to use VAB for validation of your business objects/entities.  The ErrorProvider from Martin makes surfacing the errors in your WPF UI so easy!

Technorati Tags: ,
FOLLOW UP: Public Sector Developer Conference (Downers Grove, IL)

Thanks to everyone who attended!  Here are the links to the decks and code for the sessions.  I don't have the content from the LINQ & VSTO sessions yet, but will update this post when I get them.  However, I did promise to have a post up this morning.

How Visual Studio Team System 2008 will benefit your organization? - deck

Language Integrated Query (LINQ)

Overview of the .NET Framework 3.5 SP1 & ASP.NET MVC - deck, resources, code (links to a post explaining how to get the code I based me demos on)

Office Development with VSTO  and Office Open XML Format

If you are interested in other content, I have a list of recorded webcasts in My Recorded Webcasts list.  There is a session similar to Joel's LINQ session that covers LINQ to SQL in a little more detail as well as other topics which might interest you.  You might want to check out My Screencasts as well. 

Did you know it is WPF Week on Channel 9?

There are a bunch of videos at http://channel9.msdn.com/Showforum.aspx?forumid=14&tagid=329 digging in to what's new for WPF in the .NET Framework 3.5 SP1.

Technorati Tags: ,
Posted 16 May 08 02:53 by marcsc | 0 Comments   
Filed under
Free training on .NET 3.5 SP1

I just came across this update to the .NET 3.5 Enhancements Training Kit from Jonathan Carter.  If you've seen my ASP.NET 3.5 Extensions Preview webcast and are looking for the code, then you will want to download the kit.  I used the kit as the starting point for my demos.  I do a few things differently here and there, but most of it is because I didn't have time to show everything in 90 minutes.  As far as I can tell, everything that was in the extensions preview is in 3.5 SP1 except ASP.NET MVC which will be shipped separately.  The training kit offers a great way to get your hands dirty with the new stuff in 3.5 SP1.  Go get it!  Oh yea, I have also updated the deck from my webcast to reflect the changes.  I have also added a couple slides about what's new in WPF & WCF.  You can download my new 3.5 SP1 deck here.

VS2008 / NETFX 3.5 SP1 Beta

If you keep up with multiple Microsoft technology bloggers, today is one of those days where you'll see everyone posting similar posts:(.  Such is the nature of blogging.  I get to say what I want, but sometimes that means everyone else is saying the same thing.  Visual Studio 2008 and the .NET Framework 3.5 Service Pack 1 Beta are out!  Here are some links to learn "what's what" about SP1:

Scott Guthrie's comprehensive post:

http://weblogs.asp.net/scottgu/archive/2008/05/12/visual-studio-2008-and-net-framework-3-5-service-pack-1-beta.aspx

WPF-specific:

http://blogs.msdn.com/tims/archive/2008/05/12/introducing-the-third-major-release-of-windows-presentation-foundation.aspx

Brad Abrams’ has lots of screenshots of various features:

http://blogs.msdn.com/brada/archive/2008/05/05/visual-studio-2008-and-net-framework-3-5-sp1-beta.aspx

Technorati Tags: ,
Microsoft TechFest - Building Rich Interactive Web Applications with Silverlight & Expression

Pete Brown just let me know about this event in Reston, VA on June 13th.  I just looked over the schedule.  It looks to be jam packed with Silverlight & Expression content.  Details on here.

Posted 12 May 08 01:24 by marcsc | 0 Comments   
Filed under
Standalone Validation Block

As I mentioned here, I have been digging into what's out there for WPF LOB applications.  It's been a long time since I've kept up with the work the patterns & practices group has produced.  One of the things I've seen a webcast/blog post or two about is the Validation Application Block.  They have put together a nice approach that allows you to define validation once on your business entities.  In addition, the block includes adapters that allow you to surface the validation in ASP.NET, Windows Forms, and the Windows Communications Framework (WCF).  In theory, the block can be used with WPF as well, but an adapter hasn't been built.  I came across two solutions.  The first one, Validation Application Block, meet WPF, I found on Tom Hollander's blog.  The other, came from one of the EntLib Contrib projects on CodePlex.  The project is called Standalone Validation Block.  It's two gems in one!  First, it allows you to use the core validation framework without having to take a dependency on the full Enterprise Library.  Second, it has a solution for surfacing the validation in your WPF UI.  Go check it out!

Technorati Tags: ,
High Performance Computing event in Reston, Va

My team is sponsoring the HPCPAL Jumpstart Event on June 18th in Reston, VA.  If you are in the DC area (or feel like traveling here) and interested in simulation software, then stop by!

You are invited to participate in our HPCPAL Jumpstart technical training series for IT Pro's and Developers. These are one-day immersion style events that can help you get the technical information you require to start deploying and developing HPC solutions leveraging Windows HPC Server 2008.  You will experience how Windows HPC Server 2008 platform is simple to deploy, operate, and integrate with existing infrastructure and tools.

1-Day Jumpstart:

Sponsors:                 Discuss clustered computing solution scenarios with Microsoft HPC technology specialists.

Roadmap:                Review the HPC platform technology roadmap for Windows HPC.

Learn About:           Microsoft Compute Cluster Pack V2 features and capabilities.

Experience:             The significant advancements coming in the area of cluster management, scalability and performance

Explore:                    HPC Development tools and techniques

Solutions:                Identify integrated solution scenarios leveraging Windows platform technologies.

Leave With:             Tools to equip your team to develop and deploy.

For more information and registration, please visit http://www.hpcpal.com/details.asp?IdEvent=55

Posted 07 May 08 10:35 by marcsc | 1 Comments   
Microsoft ESP Developer Conference

My team is sponsoring this conference on May 22nd in Reston, VA.  If you are in the DC area (or feel like traveling here) and interested in simulation software, then stop by!

About the Conference

Join us for a day of developer-oriented technical sessions featuring Microsoft® ESP™.  Microsoft® ESP™ is a visual simulation platform that brings immersive games-based technology to training and learning, decision support, and research and development modeling for government and commercial organizations. Come and learn how this all-in-one simulation platform of Microsoft ESP consisting of a simulation engine, development tools and rich content can help you quickly build affordable, extensible, high quality simulation solutions that can tie in with external solutions and integrate with industry standard input/output devices and database-driven content. You will also learn about the Microsoft ESP SDK that consists of four primary systems, some of which contain their own additional SDKs for specific topics:

  • Programming System
  • Terrain and Scenery System
  • Mission System
  • Object Modeling System

The sessions will allow you to:

  • Experience the development of richer solutions more quickly and focus on content that's specific to your solution by starting from the rich base world content that comes with ESP.
  • Design using the platform's model of planet Earth, built-in physics engine, numerous aircraft types, scenery and terrain, and a fully-configurable weather system.
  • Achieve "you are there" realism with highly-detailed terrain and seascapes in all seasons, active wildlife, real-world motion, realistic night skies, continuous time of day, accurate vector data and buildings, 5.1 multi-channel surround sound, and much more.

These sessions will target Developers, Architects, technical managers and Web designers, be very much demonstration oriented, and will be delivered by seasoned developers with experience in Government and Public Sector. Seize this opportunity to immerse yourself in this exciting new technology!

FULL ESP DEVELOPER CONFERENCE DETAILS HERE

Posted 07 May 08 10:27 by marcsc | 1 Comments   
WPF for Line of Business applications

I'm a big believer that WPF is a great UI technology for LOB applications.  Yes, there are some shortcomings in the designer experience if you compare the WPF designer to the Windows Forms designer in Visual Studio 2008.  Yes, WPF is missing some controls that people expect like a DataGrid and DatePicker, but there are solutions.  For example:

I've updated my WPF Resources list with these links and more.

Personally, I think the benefits of the WPF programming model outweigh the shortcomings of the WPF designer in Visual Studio 2008.   Some of the customers I have worked with have told me that once they get over the initial "shock" around the designer (compared to Windows Forms) and the lack of certain controls, they quickly find that they are more productive overall because they are using WPF.  This will get better as the Cider team continues to improve the WPF Designer in Visual Studio.  Remember that the Windows Forms designer has been around since the release of .NET 1.0!  They've had a little more time to get all those feature in:).

One of the things I have been chatting about with some of my teammates is that there aren't enough good samples demonstrating the use of WPF for LOB apps.  I've been doing some research to see what's out there.  One example is the WPF sample that ships with the CSLA framework from Rockford Lhotka.  I used CSLA back in the days of my life as a VB6 developer.  Over the years, Rocky has evolved his framework as the .NET Framework has evolved.  CSLA is primarily a Business Object framework, but it ships with example user interfaces (including Windows Forms, ASP.NET, and now WPF).   The latest version has a WPF sample LOB app.  I also came across Karl Shifflet.  Karl's blog has a ton of great info in it about WPF LOB apps including an 11 part series he's started on the topic:

WPF Business Application Series Part 1 of n - Application Structure, Skinning & Custom ToolBar Button Control

WPF Business Application Series Part 2 - Form Notification Control That Binds To IDataErrorInfo.Error Property

WPF Business Application Series Part 3 of n - Business Object Declarative Programming; How To Implement Object Validation & Logging

I've yet to see a sample app that does everything Karl is planning on doing plus show online/offline capability using:

  • Client Application Services for Authentication / Authorization (which supports offline scenarios)
  • Data Access via a local SQL Compact Edition database using LINQ to SQL or LINQ to Entities
  • ADO.NET Sync Services communicating across the wire using WCF to synchronizes with the server database
    • Caches lookup data and a necessary subset of the server database relative to the user in the local SQLCE database
    • Allows the user to continue working offline, syncing/reconciling changes when they reconnect

I have a bunch of samples that show many of these scenarios, but I have yet to come across a complete solution bringing all of this together in a single app.  Have you seen such an example?  Are you aware of any other work like Karl & Rocky's for building LOB WPF apps?  Please let me know in the comments section.  Thanks!

Technorati Tags: ,,,
More Posts Next page »

Search

Go

This Blog

Syndication

Page view tracker