Welcome to MSDN Blogs Sign in | Join | Help

Windows 7 Sensor Trigger for WPF Applications

One of the cool new features of Windows 7 is a sensor platform that unifies the way that Windows 7 applications work with sensors.  For .NET developers, we’ve released a Windows API Code Pack that makes it easy to create .NET applications that use the sensor platform.  The Sensor Platform supports biometric, electrical, environmental, light, location, mechanical, motion, orientation, and scanner sensors.  The platform is also extensible to be able to sense other types of activities, so for example if you wanted to sense a Mass Effect, you could write a sensor for it.

I wanted to try out creating an easy way for Expression Blend users to design applications that use sensors, so I created a Sensor Trigger that has a custom editor.  The custom editor shows the available sensors, the status of each sensor as well as the when sensor data is reported.

I uploaded the source code and a demo project to the Expression Gallery for developers and designer to try out. I’d love any feedback on this - make sure you rate the behavior in the gallery.

SensorTriggerImage

Architect Innovation Cafe Webcast-How To Architect Killer Apps with Windows 7

webcast

February 26, 2010 at 1:00pm – 2:00pm EST

Title: How to Architect a Killer App for Windows 7

Abstract: Ever since its recent launch, Windows 7 has been enjoying rapid consumer adoption and glowing press reviews. This makes it a great platform to launch your next Killer App! In this session, we will explore how to architect an application to take advantage of several compelling Windows 7 features including multi-touch, integrated search and multi-processor improvements. We will review how others have exploited this growing "Windows 7 channel" to deliver applications ranging from enterprise line of business applications to consumer oriented, "mass appeal" applications (think Social Networking clients). As a bonus, we'll demonstrate how to quickly build Internet Explorer 8 Web Slices and Accelerators to complement your Killer App and to provide new channels to extend your reach. If you've got a great idea for a Killer App, don't miss this session. If you design, architect, and/or develop applications for fun/profit, then this fast-paced session is for you.

Event ID:  1032441748

Link to Register:  http://msevents.microsoft.com/CUI/EventDetail.aspx?EventID=1032441748&Culture=en-US

Presenter BIO

Allan da Costa Pinto

Architect Evangelist, Microsoft

Allan da Costa Pinto recently celebrated 10 years with Microsoft. In that time he has worked in several roles ranging from software consulting to support to technical evangelism. He is currently an Architect Evangelist focused on jumpstarting software projects with Microsoft’s cutting edge technologies such as Windows 7, Windows Azure and Silverlight. He lives in Hartford CT with his amazing wife, 2 kids, and 1 cat.

Stay Connected:

clip_image002 clip_image004clip_image006clip_image008 clip_image009

Posted by Michael S. Scherotter | 0 Comments
Filed under:

New Silverlight 3 Behavior for Toggling DataGrid Row Detail Visibility

I was chatting with a customer last week about how they were using Silverlight for their B2B portal.  They were having some difficulty with showing and hiding the DataGrid component’s Row Detail template programmatically.  I found a WPF-oriented solution to the problem on StackOverflow and adapted it to an Expression Blend Behavior to make the solution more modular and reusable.

I posted the behavior with a sample to the Expression Gallery.  If you try it out, please give it an appropriate rating.

image

New York Times Silverlight Kit Updated

I just pushed out an update to the New York Times Silverlight Kit to make some minor fixes and keep up with the innovation that’s happening at the New York Times Developer Network.  See the release notes here.

Scrubbing with Thumbnails with the SMF Player

image

One of the developers from one of my media customers asked me how they would implement the thumbnail preview while scrubbing in a Silverlight video player.  He was turned onto the idea from seeing that feature in the Netflix Watch Instantly Silverlight player. 

I thought that would be something that others could use, so I decided to use Silverlight Media Framework player to demonstrate it.  It turns out that Expression Encoder has the capability to create thumbnail images from a video during encoding.  You can use this capability to just create images of a video at regular intervals. 

Creating the Thumbnail Images

  1. In Expression Encoder, open the source video file and set the output format to Apply Source Encoding Settings. This will allow you to create just thumbnails.
    image
  2. In the Metadata tab, add one marker at one second and check the thumbnail checkbox.
    image
  3. Save the job as an .xej file and open it up in a text editor – I then copied the <Marker> element 29 times, incrementing the seconds for each one.  Now, it would be a trivial developer task to generate the XML here for any arbitrary length video and then use the .xej job file as a template for generating jobs for any length of file with a regular interval.  I did 1-second interval, but I could think that TV shows or movies would do 5-15 second intervals (depending on the genre and length).
    <?xml version="1.0" encoding="utf-16"?>
    <!--Created with Expression Encoder version 3.0.1332.0-->
    <JobFile
      Version="3.0">
      <Job
        OutputDirectory="C:\Users\mischero\Documents\Expression\Expression Encoder\Output"
        JobId="MISCHERO1 1-21-2010 2.28.38 PM">
        <MediaFiles>
          <MediaFile
            Source="C:\Users\Public\Videos\Sample Videos\Wildlife.wmv"
            MarkerThumbnailJpegCompression="100">
            <OutputFormat>
              <WindowsMediaOutputFormat
                AudioProfile="SourceProfile"
                VideoProfile="SourceProfile" />
            </OutputFormat>
            <Markers>
              <Marker
                Time="00:00:01"
                Value=""
                GenerateKeyFrame="True"
                GenerateThumbnail="True" />
            </Markers>
          </MediaFile>
        </MediaFiles>
      </Job>
    </JobFile>
  4. Once I had this file edited, Expression encoder created the thumbnails in less than a minute with predictable names coded to the times of the thumbnails:
    image
  5. The next step was to add the thumbnails to a player in a general, reproducible way.  I started by creating a new project in Expression Blend and adding references for the Smooth Streaming Media Element and the Silverlight Media Framework Player.  I wanted to use this as a starting point because it already had a fully skinnable design and a scrubbing slider bar.
  6. I added the Player class to the new Silverlight application and then started editing the control Template (right-click, Edit a Template…, Edit a copy…)
  7. In the template, I added a Border, a Grid, and three images to show the thumbnail images when scrubbing.  I also gave the Border and the three Images names so I could easily reference them in the code behind.
    image
  8. Initially I wanted to implement this by creating a behavior but since the events (mouse moving while scrubbing) that I wanted to handle were locked up inside the control template, I had to derive a class from Player, ThumbnailPlayer. 
  9. I also saw that the Player Control template had a Scrubber control which did have the events that I wanted to handle, ScrubStarted, ScrubCompleted, and MouseMove.
  10. In the ThumbnailPlayer control, I added two properties, ThumbnailLocation, and ThumbnailInterval which would be used to identify where the thumbnails could be found and how many seconds between image.
  11. Once the Media file opens, I could get the duration of it and then use a WebClient to download the thumbnail images.  I wanted to cache the images locally in a Dictionary<int, BitmapImage> so it would be very responsive.
  12. When the user started scrubbing, I made the thumbnails visible and hid them when the user stopped scrubbing.
  13. In the scrub head MouseMove handler, I then found the nearest images to the current play head and set the thumbnail images to those images:
            private void positionElement_MouseMove(object sender, MouseEventArgs e)
            {
                if (this.positionElement.IsDragging)
                {
                    if (this.ThumbnailInterval <= 0)
                    {
                        return;
                    }
    
                    var seconds = System.Convert.ToInt32(Math.Floor(positionElement.Value + 0.5));
    
                    var image2 = seconds - seconds % this.ThumbnailInterval;
                    var image1 = image2 - this.ThumbnailInterval;
                    var image3 = image2 + this.ThumbnailInterval;
    
                    this.SetThumbnailImage(this.thumbnail1, image1);
    
                    this.SetThumbnailImage(this.thumbnail2, image2);
    
                    this.SetThumbnailImage(this.thumbnail3, image3);
                }
            }
    
            private void SetThumbnailImage(Image image, int index)
            {
                if (image == null)
                {
                    return;
                }
    
                BitmapImage bitmap;
    
                if (this.thumbnailImages.TryGetValue(index, out bitmap))
                {
                    image.Source = bitmap;
                }
            }
  14. The last thing I had to do was replace the Player class with my ThumbnailPlayer class in the page XAML:
    <local:ThumbnailPlayer x:Name="Player" Content="Player" Margin="8" 
    Style="{StaticResource ThumbnailPlayerStyle}"
    ThumbnailLocation="Thumbnails/Wildlife" ThumbnailInterval="1"> <local:ThumbnailPlayer.MediaElement> <Microsoft_SilverlightMediaFramework_Player:CoreSmoothStreamingMediaElement Source=http://localhost:6801/ThumbnailDemoSite/ClientBin/Wildlife.wmv
    AutoPlay="False"/> </local:ThumbnailPlayer.MediaElement> </local:ThumbnailPlayer> 

The end result is a player with thumbnails.  You can download the source code here.


Updated 1/22/2010 - You can now see a demo here.

Silverlight Design Days – Free Blend Training on Tour

My colleague Adam Kinney will be taking a road trip over the next few months to spread the word about Silverlight and Blend with free training.  Take a look at his post about his tour to see the dates and locations.

Start the year out by Sharpening your Saw on Silverlight and Expression Blend!

Windows 7 Tip: Creating A Help Toolbar

When I used to run Windows Vista, I had some commonly used CHM help files as links in my task bar.  Now in Windows 7 you can’t put CHM files into the Task bar but I found a better solution: create a Help Toolbar for all of the compiled help files that you use.  Here is how you do it:

  1. Create a folder on your system named “Help”
  2. In that folder, put shortcuts to all of the help files that you use.  You might want to change the names of the shortcuts to make them easier to read.
    image
  3. Right click on the Windows 7 Task Bar and select Toolbars…New toolbar…
  4. Navigate to the folder you created it step 1 and press Select Folder.

You now have a Help toolbar in the Task bar for easy access to the Help files that you regularly use:

image

Posted by Michael S. Scherotter | 2 Comments
Filed under:

Maximum.TV Launches Spanish Language Silverlight TV Site

Maximum TV just launched an amazing Silverlight site for US-based Spanish language speakers as their prime audience.  This is an amazing ad-supported experience that uses IIS Smooth Streaming.  One thing that I really like is the live video wall that they created that uses mouse over to determine which audio to play back.  In the image below, all 12 videos are playing back simultaneously with great quality.

Maximum.TV Video Wall

Here’s what they used to create it:

  • Silverlight 3
  • Microsoft Internet Information Server
  • Microsoft SQL Server 2008
  • Microsoft Expression Encoder 3
  • Microsoft Expression Blend 3
  • Visual Studio 2008

I first met the team from Maximum TV at the NAB Show earlier this year in Las Vegas and they showed me the prototype running beautifully on a tiny netbook.  I expect to see great things from this company!

30% off Expression Web 3 and Expression Studio 3

I just wanted to pass on this limited-time deal on Expression Web and Expression Studio that’s good through January 8.  For web developers that want to preview their designs with IE6, IE7, IE8 and Firefox, both of these packages include SuperPreview.

clip_image001

  1. Expression Studio 3 – 30% off sale
  2. Expression Web 3 – 30% off sale

This offer is good through January 8, 2010 in the US only.

The MySpace Developer Challenge and BizSpark

MySpace is putting some serious cash ($50,000) behind a new developer challenge announced on their developer website.  They are challenging developers to create the next great applications on the MySpace Developer Platform

Of course, I’ve been experimenting with the platform with Silverlight (see the Silverlight Kit for MySpace) and I’m excited to see some new APIs like Photo Uploading that could mesh well with some upcoming Silverlight 4 features.

In a related development, MySpace has also partnered with Microsoft and become a BizSpark Network Partner so that they can offer Microsoft server software,  developer tools, and designer tools to the startups in their developer community at no initial cost ($100 when they leave the program).  See them in the network partner directory.

image

So now go out and build the next new MySpace application and win some great startup funding!

Posted by Michael S. Scherotter | 0 Comments
Filed under: ,

Ribbit SPAWN Event – Nov 5, 2009 in San Francisco

image Ribbit, a Microsoft Partner and division of British Telecom has been working with my team on some exciting technology integrations and is ready to show them off:

Please join us in San Francisco November 5, 2009 for an invitation only deep dive into Ribbit’s open telephony APIs — and a Sneak Peek at the unreleased Ribbit for Silverlight Controls.

Ribbit is excited to formally launch our RESTful API, and we’re looking for early adopters like you! 

Learn how you can enrich your applications with communications capabilities — and take productivity to a whole new level. 

Join us for a day of innovation and learning and an evening of coding and cocktails.

Ribbit + REST = Open Programmable Communications
Rebuilding the Ribbit Platform on top of a RESTful framework allows developers to interact with Ribbit at the server level, enabling new forms of application-to-person and application-to-application services.  REST treats users, devices, calls, messages, and other elements as resources with which developers can easily interact — and exposes Ribbit’s core communications services in a platform-agnostic format using simple and secure HTTP calls. 

Space is limited, Register by Oct. 23 - latest! http://developer.ribbit.com/blog/spawn/

Agenda

  8:00  –  9:00  Registration and continental breakfast
  9:00 – 10:00  Ribbit Platform Overview — New Features, Platform Roadmap & Pricing
10:00 – 11:00  Integrating Ribbit into Any Application, Workflow, Site or Online Campaign
11:00 – 11:30  New APIs and application showcase
11:30 – 12:00  Platform opportunities
12:00  -   1:00  Lunch

1:00 - 2:45 Afternoon Breakout Sessions

  • Flash

  • Java

  • .NET

  • PHP


3:00 – 4:45  Afternoon Breakout Sessions

  • Building Client-and Server-Side Apps

  • JavaScript

  • Silverlight

  • REST


5:00 - 9:00  Hands-On Coding with Ribbit’s API/Programming Language Experts

  • Coding for Flash, Silverlight

  • Coding for Java, JS, PHP, REST, .NET



We look forward to seeing you there!

If you cannot attend in person, please join us via webcast. Register at:  http://developer.ribbit.com/blog/spawn-webcast/


Ribbit is an open, cloud-based platform for communications innovation. By exposing our carrier-grade SmartSwitch™ though popular programming APIs, Ribbit enables the development of next generation “voiceware” applications, such as our white-labeled Ribbit for Salesforce® and Ribbit Mobile™ consumer offering.

Posted by Michael S. Scherotter | 0 Comments
Filed under:

MySpace Qizmt, a .NET MapReduce Framework

When I went to MySpace to interview Erik and Akash about their usage of the CCR, I was also able to interview Mikhael Berlyant and Daniel Rule talking about Qizmt, their new open source .NET MapReduce framework. 

Get Microsoft Silverlight
Posted by Michael S. Scherotter | 0 Comments
Filed under: ,

Robots at MySpace!

Got your attention? Not exactly robots, but software architects at MySpace have figured out a very cleaver use for the Coordination and Concurrency Runtime (CCR) that was originally released as part of the Robotic Developer Studio.  Take a look at this interview that I just did with Erik Nelson and Akash Patel at MySpace to learn what they’ve done with the CCR.

Get Microsoft Silverlight
Posted by Michael S. Scherotter | 0 Comments
Filed under: ,

Silverlight Track at Silicon Valley Code Camp Oct 3-4, 2009

So now you’re ready to learn Silverlight – you’ve seen the demos of Deep Zoom, Smooth Streaming, PhotoSynth and Business Applications, and have been awed by the dynamic prototyping capabilities of SketchFlow in Expression Blend.  There is a great opportunity to do just that at the Silicon Valley Code Camp from October 3-4 2009.  Here are the Silverlight Sessions:

  • Building Business Applications with Silverlight 3
  • Dependency Properties in WPF & Silverlight
  • Partially Connected Silverlight Applications
  • RIA Services: RAD for the Middle Tier
  • Silverlight 3 Ins & Outs

Thanks to Peter Kellner for the link.

Posted by Michael S. Scherotter | 0 Comments
Filed under:

Silverlight and Web Analytics – the Next Generation

 

Ever since I wrote about Silverlight and Web Analytics (and PDF here) with Silverlight 1, I have been meaning to update the document and guidance for Silverlight 2 and now Silverlight 3.  There are some new features in Silverlight 3 and Expression Blend 3 that really make a compelling case for taking a fresh look at how to measure engagement with RIA and media-oriented applications, especially those created with Expression Blend and presented in Silverlight 3.  Over then next 7 months, I will be working on building a new extensible framework which looks at some of the new scenarios for Web Analytics that are now possible with Silverlight 3 and beyond:

  1. How do you use web analytics with Out-of-Browser application in Silverlight 3?
  2. How do you use web analytics with offline applications in Silverlight 3?
  3. What information is valuable to track in adaptive streaming media scenarios?
  4. How do you make it easy for designers using Expression Blend to configure their application to track events?
  5. How do you use Expression Blend for designing A/B testing scenarios?
  6. How do you use Expression Blend to visualize the results of web analytics data collecting?

Vote for my PanelPicker Idea!As part of this investigation, I will be participating in the XChange conference on Web Analytics next month in San Francisco where I will be leading huddles (conversations) on Measuring RIA Applications and standardizing analytics protocols.

I have also proposed a panel at the South By Southwest (SxSW) conference in Austin next year, The Day the Page Tag Died (sung to the tune of Don McLean’s American Pie – my favorite song). If you think that this will be an interesting topic, please give it a thumbs-up (even if you’re not planning on attending) as the community feedback influences the panel selection at SxSW.

As I build this extensible framework, I will need help from the analytics vendors to insure that their services work with it.  The plan will be to release the source code via CodePlex, once we have something useable.  So, if you work for a web analytics company and want to participate in building this, please contact me.  This is going to be very cool!

More Posts Next page »
 
Page view tracker