Metro WebView Source and HTML workarounds

WebView Workarounds

In the process of writing my first Windows 8 Metro style app using C# and XAML, I came across some limitations of the current WebView control’s implementation.  The flow for the feature I was working on is fairly simple:

  1. Content for a webpage is displayed in a WebView (using the WebView’s Source property).
  2. User browses the page until they find something they want to save.
  3. User clicks a save button and the app parses the information into a readable format for saving in the app’s storage.

This is a pretty straightforward concept and I thought the implementation would be just as intuitive. Judging by the similarity of the WebView control to the Silverlight WebBrowser control, I went about implementing this functionality as I would have for Silverlight.  I set the WebView’s Source property to the initial Uri where I wanted the browsing to begin.  I wired up a test button that I thought would kick off the parsing process.  That’s when I started to run into problems.

Continue reading

Designing APIs for the 80% case

I just read a blog post by James Padolsey (Making APIs is hard).  He makes a comment that is at the core of how we design APIs in my day job.

From the post:

I am sitting here thinking about that end-user-programmer-guy. I guess this holy API should seek to provide exactly what this guy wants. The trick is knowing what he wants.

While I don’t agree with the entire blog post (in particular, there’s way more to API design than just naming), I do believe James has partially nailed the essence of what makes API design difficult.

At Infragistics, we have a design tenet that states we will optimize for the 80% case while still remaining flexible enough to accommodate the other 20%.  What this means is, in 80% of the use cases for what we are designing the developer should be able to use it without consulting product guidance.  This requires a lot of research to determine what the 80% case is, but in the end the result is a product that is easy to use most of the time.

That’s not to say that we don’t care about the other 20%.  We just don’t design for that first. The basic idea is: the more common it is, the easier it should be.  On the flip side: the less common it is, the more difficult it can be.

No Comment

Inspired in large part by Matt Gemmell’s decision to finally turn off comments, I have decided that I’m done with them too.  Frankly, I’m just tired of the spam.  Comments really don’t add much value to a blog post and there will always be ways to provide feedback to me on anything I write.

So, if you have something productive to add to the conversation, tweet at me (@brentschooley) or find me on any of the social networks listed at the top right of this site.

Design decisions, guided learning approach, and NetAdvantage Reporting

One of the products I work on at Infragistics, NetAdvantage Reporting, just launched its first version.  The team put a lot of work into making a polished product and I’m very proud of what was released.  One of the goals of the product was to make it very easy to use.  In  the process of working towards that goal, many design decisions had to be made.  I go into detail about one of those (Guided learning) here on the Infragistics blogs.

If you’re in the market for a new reporting tool or just feel like your current one could be better, you should definitely check out NetAdvantage Reporting.

It pays to be persistent with Siri

Sometimes Siri can be stubborn but if you have a hunch that it will do something, just keep trying.  I really wanted Siri to tell me a story so I kept at it.  Eventually Siri relented me and gave me a pretty good laugh in the process:

 

Steve Jobs 1955-2011

Steve Jobs passed away today at the age of 56.  As I sit here writing this post on a MacBook Pro with an iPhone in my pocket and an iPod Nano in my backpack, I can’t help but be overwhelmed by the news.  The technologies and design concepts this man helped create have literally changed the world for the better.

Thank you for everything you contributed to society, Steve.  You will be missed.

Fix for Expression Blend 4 crashing on startup

If you are among the many .NET developers who have recently installed Visual Studio 11 Developer Preview and are installing the recently released Windows Phone SDK 7.1 (Mango) RTW, you may find that Expression Blend 4 is crashing when you attempt to run it.  In fact, if you debug it you’ll find you are getting a System.ExecutionEngineException.  This is due to an issue in the .NET 4.5 version that was installed as part of VS11.  To get Blend back up and running you’ll need to run the following commands from the Command Prompt:

 %windir%\Microsoft.NET\Framework\v4.0.30319\ngen uninstall "%ProgramFiles(x86)%\Microsoft Expression\Blend 4\Microsoft.Expression.Framework.dll"
 %windir%\Microsoft.NET\Framework\v4.0.30319\ngen uninstall "%ProgramFiles(x86)%\Microsoft Expression\Blend 4\Microsoft.Expression.Blend.dll"
 %windir%\Microsoft.NET\Framework\v4.0.30319\ngen uninstall "%ProgramFiles(x86)%\Microsoft Expression\Blend 4\Microsoft.Expression.Project.dll"
 %windir%\Microsoft.NET\Framework\v4.0.30319\ngen uninstall "%ProgramFiles(x86)%\Microsoft Expression\Blend 4\Microsoft.Expression.WindowsPhone.dll"

Happy Blending!

BUILD was great, even for non-attendees

Microsoft BUILD

Microsoft’s //build/ conference this week was quite a show.  Attendees were truly the lucky ones since they all received a tablet with the Windows 8 Developer Preview loaded on it.  Clearly, this is the best way to experience the new Metro styled apps so I’m looking forward to my colleagues returning to Infragistics with theirs on Monday (until then, I’m still running Windows 8 on my Mac in Boot Camp).

That being said, the conference was still great for those of us not lucky enough to be in Anaheim this week.  Microsoft’s streaming of the keynotes both of the first 2 days was nearly flawless in crisp HD quality.  The Windows 8 Developer Preview was made available to everyone, not just attendees, Tuesday night.  All of the sessions are available in HD for streaming or download over at Channel9.  The Windows Dev Center is chock full of guides and samples already during the conference.  All of this adds up to a non-attendee conference experience that has been very enjoyable.

Thank you Microsoft for putting on a great show!

Microsoft BUILD Windows 8 Server Keynote

Intro

Day 2′s BUILD keynote shifted focus from the consumer side of Windows 8 to the server side of Windows 8.  Satya Nadella (President, Server & Tools Business, Microsoft) headlined the keynote and focused on a central theme throughout: “Connected Devices, Continuous Services”.  Some of the important topics that were elaborated on over the course of the presentation were:

  • Elastic resources – All about scaling
  • Composable services – services that are very distributed in nature
  • Hybrid infrastructure – many different devices and platforms with broad geographic distribution; commonality between Windows 8 Server and Windows Azure
This was a keynote that was very demo driven.  They wanted to let the product speak for itself.

Windows 8 on a Mac Using Boot Camp

Update #2: Check out my new post regarding the installation of Windows 8 Consumer Preview which should install even easier than this since it is meant to upgrade existing Windows installations.  I have also had total success installing Windows 8 Consumer Preview in Parallels.

Update: Post updated for alternate workaround if the setup.exe file will not run. (Thanks Chris Apland!)

A lot of people have been asking if it is possible to run Windows 8 on Mac hardware through Boot Camp.  I can definitely report at this time that it does work.  You will need the latest Boot Camp drivers from Apple and a USB mouse with a dedicated right click button.

Continue reading