Tag Archive | MSDN

Danny Brown – Microsoft Student Partner (MSP)

Yesterday I received an email from Phil Cross, Academic Audience Manager at Microsoft, welcoming me to the Microsoft Student Partner scheme – which I applied to be part of a few weeks ago. But what is a Microsoft Student partner?

Blake Pender from the Microsoft UK Students Group explained it well:

The main responsibilities of an MSP are to act as a liaison between the University and Microsoft and to evangelise technology (specifically, Microsoft technologies) and to encourage and inspire students from a technological background, by method of technical demonstrations and presentations.

Essentially I’m supposed to get people in the University more interested in Technology, especially those from Microsoft. I’ll also be expected to keep up to date with the latest Microsoft technologies myself , be an active part of the online community — including monthly VoIP calls on Microsoft Lync with other MSPs and The Academic Audience Team — and liaise between Microsoft and Hull’s Department of Computer Science if need be. 🙂

In return I get access to a full MSDN subscription giving me access to over £2000 of Microsoft Products for free, as well as a chance to network with my fellow MVPs and of course attend Microsoft sponsored events. It will also look good on my CV. I look forward to joining the other 45 MVPs around the country and getting as involved with the community as possible.

Danny

Using the Tag attribute in XAML or “Where the hell can I bind this!?”

Warning: This blog post assumes some knowledge of XAML and Binding in WPF or Silverlight.

Whilst developing the Hull CS Blogs application for Windows Phone 7 I ran into the same issue several times. Some user interface items, such as Context Menu Menu Items in the Silverlight Toolkit don’t have attributes you can bind properties to in a way that makes sense. Heres an example bit of code to show what I mean

<!--A box containing a list item for the "Latest Blogs" page on the Main Panorama for the Hull CS Blogs app-->
<StackPanel Orientation="Horizontal" Margin="0,0,0,17" Tap="blogTapped">
     <StackPanel Width="411">
          <TextBlock Text="{Binding Title}" Margin="12,-6,12,0" TextWrapping="Wrap" FontSize="30" Foreground="White"/>
          <TextBlock Text="{Binding Author}" Margin="12,-6,12,0" TextWrapping="Wrap" FontSize="20" Foreground="{StaticResource PhoneAccentBrush}" />
          <TextBlock Text="{Binding Abstract, Converter={StaticResource HTMLConvertor}}"  Margin="12,-6,12,0" TextWrapping="Wrap" Style="{StaticResource PhoneTextSubtleStyle}" Foreground="#AFA7A0"/>
     </StackPanel>
</StackPanel>

In this code we can see that affixing a Tap() event to the Title Textblock, which could then work out which Item was tapped by looking at the binding and comparing it to the Titles of blogs in a linked list in memory would be rather simple. But what if we want the user to be able to touch any of the items in order to activate the Tap() event?

To do this we’re going to have to give the StackPanel a Tap() event. So now, anything inside it that is tapped will trigger that event. Thats great! But how do we work out which item was tapped? Theres nothing we can bind to on a StackPanel that can accept a text input in the same way that the Text attribute can on a Textblock.

Binding the title of the blog post to Name will cause an error whilst Initializing the page, due to how XAML works and binding the title to attributes such as Visbility, Width or AllowDrop both doesn’t work and doesn’t make sense.

Tag attribute to the rescue! According to MSDN “Tag is intended to provide a pre-existing property location where you can store some basic custom information about any FrameworkElement without requiring you to subclass an element.” In essence, Tag is a place for you to store information that doesn’t make sense elsewhere, but you need to be associated with that Element in order for it to function correctly. In our case we can bind our title to it, like so

<!-- Now we can tap our stackpanel 🙂 -->
<StackPanel Orientation="Horizontal" Margin="0,0,0,17" Tap="blogTapped" Tag="{Binding Title}">

All FrameWork Elements have a Tag attribute, so that means most, if not all items in XAML do. So, when you’re thinking “Where the hell do I bind this?!”, just think about tag!

Danny.

Evil Squash Accepted to the Windows Phone 7 Marketplace

Some of you may recall that in order to keep my Samsung Focus Flash my Evil Squash application had to be accepted onto the Windows Phone Marketplace by 23rd December (Today!). I had been somewhat worried about this happening seems as the application had already been denied twice due to relatively minor things (I’d mis-typed a link, which caused an application crash for my first rejection and I had debug information in 2 of my screenshots to be displayed on the Marketplace for my second rejection).

Fortunately I was contacted by Grace, a Microsoft Representative, informing me that I would be able to keep my device if the application was on some time soon as they could see I’d made the effort to get it in the store. I must say that Microsoft have treated me very well, and they’re a pleasure to work with.

In the end this didn’t matter because today I received an Email saying that Evil Squash had been accepted into the marketplace and would be available to the public soon (I’ll post as soon as I notice its available.)

The screenshot you can see above shows the developer dashboard at create.msdn.com which shows that my app has successfully passed all 3 stages of certification.

Thats all for now,
Danny.