February20

Minimal Virtualized Data List for WP7

I recently gave a talk about data management on Windows Phone 7 for XapFest and I put in a slide about virtualizing your data for data bound objects.  I didn’t really think it was that big of a topic when I was putting together the talk, but it generated a lot of interest from attendees.

I am going to demonstrate the minimal virtualized data collection object you can easily create for data binding with a Listbox.

For this example I am using a simple class named FeedItemDataModel.  This represents a class that holds a single item from an RSS Feed.  In this simple implementation the values are simple and set in the constructor.

The sample application shows a UI with a collection of this object databound to the UI and lets you jump to a specific index in the list.  The red text you see is a memory watcher class that shows memory usage within your app.

More...

December09

Click back twice to exit app?

I have been adding animations to a Windows Phone 7 app that has a panorama control and ran into a problem I have seen others post online.  I figured it out, so I thought I would take a minute to explain how.

Get ready to add transitions

The Silverlight Toolkit is the way you want to go about adding quick and easy animations when a page loads and navigates away from the current page.

If you are not familiar with the basics visit the link above, or read this really good tutorial about wp7 page transitions on Windows Phone Geek.

The basics are that you have to include the toolkit, and you have to modify the root frame of your application to be a transition page instead of a normal phone page.

In a typical application you have the RootFrame declared in your App.xaml.cs like this:

    public partial class App : Application
    {
        /// <summary>
        /// Provides easy access to the root frame of the Phone Application.
        /// </summary>
        /// <returns>The root frame of the Phone Application.</returns>
        public PhoneApplicationFrame RootFrame { get; private set; }
    }

But for transitions to happen you need to change the object to a TransitionFrame when your InitializePhoneApplication is called.

            // REPLACE THE FIRST LINE WITH THE SECOND
            // RootFrame = new PhoneApplicationFrame();
            RootFrame = new TransitionFrame();

This will give you the ability to add transitions to your page.

I prefer to define my transition style at the application level, rather than the page level.  Usually I want all the pages to behave the same, so this gives a nice central point for all of them to reference it.

More...

December10

Silverlight Firestarter Dec 2010

Watching the Silverlight Firestarter event that was hosted here at Microsoft today.

http://www.silverlight.net/news/events/firestarter/ 

Highlights

Silverlight 5 Announced

  • Azure support
  • 64 bit Silverlight client is now available to run within 64 bit Internet Explorer
  • Low latency network applications
  • MVVM improvements, end to end complex types, RIA improvements, also mentioned as ported from WPF

Improved Data Binding and debugging of data binding.  It was mentioned that some of these are from WPF, that is a good cross product migration of tech.  This means you now have breakpoints within XAML files!  You don’t have to do it within just the source, you can set them within the XAML for the binding.  This would be VERY nice if added to ASP.Net as well.  When you have to write code for the data binding inline you can set a breakpoint for the code that gets executed as a part of the bind (and even view exception).

More...

April02

Compact Framework is finally dead (or is it)

Click image to view originalI think many people know that we used to produce a Compact Framework (CF) provider for VistaDB.  We didn’t do it for VistaDB 4 specifically because of a couple issues that I saw coming, and couldn’t get clear answers from anyone at Microsoft.  I think since the Windows Phone 7 announcement things are finally clearing up, but Microsoft has some confusing terminology.

Compact Framework for Visual Studio 2010

A lot of people noticed this doesn’t exist.  There is no mobile story in the Visual Studio 2010 betas at all.  There were a lot of people saying it would come later, but I had suspicions over a year ago it was going away.  There is no Compact Framework for .Net 4.  But there is a new Visual Studio for Windows Phone as a part of the tools preview.

Silverlight 4 has a compact framework

But Silverlight 4 has a “compact framework” embedded in it.  Not that this is in any way shape or form similar to the actual Compact Framework.  It is a severe subset of what was already a subset of the full .Net framework.  The Silverlight subset of .Net does not include encryption, lots of XML features, ADO.Net, etc.  The Silverlight subset of .Net is really only a few core system libraries that let you write C# / VB.Net code for Silverlight.  You don’t even bind against the desktop runtime, you must target the Silverlight 4 runtime through a special project.  You cannot have a single solution with both Silverlight 4 and .Net 4 as simple output targets (you can do through linking files, etc, but not the same as you could for CF – target).

Windows Phone 7 Silverlight and compact framework

I was recently twit’d a link to a great blog by Abhinaba Basu who works on the NETCF team for Microsoft.  In his posts he discusses the Phone 7 NETCF and how it works to a great amount of detail. 

He states that Windows Phone 7 uses Compact Framework 3.7.  What follows is the summary of his post.

More...