WPF: One Small Step For UI; One Giant Leap Back For Data Binding?

I’ll admit it, I’m new to WPF.  But have been spending the last week or so (when I have time) to go through Hands On Labs or any other tutorials I can find to get up to speed.  And now that I’m done, I wanted to apply my new found knowledge and build something without a helping hand – something simple, WPF for display, using LINQ in the data access layer and SQL for the backend data store. 

SQL and LINQ was the easy part.  Business entities all setup, data access layer is work and then…

stopped.  WPF – ugh!  To be fair some of the issues aren’t specific to WPF.

  • Expression Blend doesn’t play nicely with Visual Studio 2008 C# Projects
  • Auto-complete for XAML files works sometimes – which is frustrating if you are trying to learn it
  • Lack of online samples (or samples that are questionable in terms of code, i.e., not using a using statement when working with a database connection) that have full CRUD 

But really, my biggest beef is with Visual Studio 2008.  What I was really hoping for was ASP.NET 2.0 data-binding in WPF – little handles over a control, wizards to setup which binding source to be used, auto-generation of SQL commands, etc, etc, etc.  Prototyping was dead easy and you could have a small data bound web application up in minutes.  Sadly this is all missing – not only making the barrier to entry to WPF that much higher.

Might just have to break down and get a book…

And if you haven’t grabed the Visual Studio 2008 and .NET Framework 3.5 Training Kit yet:

http://www.microsoft.com/downloads/details.aspx?FamilyID=8BDAA836-0BBA-4393-94DB-6C3C4A0C98A1&displaylang=en

Read more

Interop’ng with Vista (Displaying Battery Power in the Taskbar)

Well, it has been a little while since my last post.  So to get back into things, I thought I would provide some insights into how to use COM interop to display a widget in the taskbar and specifically a graphical display of the battery power for a laptop. I should take a step back and explain, Lenovo has IMHO a great litle utility (see image below) which when I got my new VAIO for Christmas sadly does not come with.

Plus I downloaded Visual Studio 2008 from MSDN and needed a little project to play around with.  So after a little google’ng I found two articles that explained pretty much what I needed and all I needed to do was put them together and presto, I too could have the utility on my new VAIO.

The first is how to use COM interop to extend Internet Explorer and Band Objects with C#

http://www.codeproject.com/KB/shell/dotnetbandobjects.aspx

and the second is regarding Power Awareness and Mobility with .NET

http://blogs.msdn.com/coding4fun/archive/2006/11/12/1066558.aspx

And with a little synergy later: 

Since the transparency is a little off (well, isn’t transparent at all), I’m going to hold off posting the code until I can find the time to get it sorted.

Ideas for future development:

http://www.codeplex.com/vistabattery

Read more