mr mann's mishmash

it's just a game of give and take…

Wow again! We had a tremendous response for the February 2010 meeting of the Silverlight UK User Group. Many thanks to all that attended and especially those that had to stand during the first session. The conference room at Microsoft’s Cardinal Place normally seats 80 and had about 95 attendees in total.

We have grabbed a Twitter hashtag since many of our members have some existence on Twitter and has been gathering a pace of activity… check it out!

#sluguk

You can either follow me using the Twitter widget in the right-hand panel of this blog, or on Twitter as @mark_mann.

I’ve embedded the slide decks and the videos from both sessions by Mike Taulty and Johannes Kebeck. If you did not make it to the evening, or have not yet attended a Silverlight UK User Group evening you can join the mailing list here and we’ll keep you informed or of course, you can just check back with my blog.

I also drew note to the upcoming MIX10 conference in March at Las Vegas. If you are not one of the lucky ones holding both a conference and plane ticket, then I thoroughly recommend keeping an eye on the conference website during that time because keynotes and sessions will be streamed live… there is keen interest for any potential announcements!

Details for MIX10 can be found on their website or in my slide deck below.

 

Silverlight 3 sparked of a lot of interest with the MVVM pattern, and Silverlight 4 has picked up interest this time round with the Managed Extensibility Framework (MEF). Mike Taulty from Microsoft gave a detailed exploration into using MEF within Silverlight 4 and he did not disappoint with an engaging session with lots of demos. Check out Mike’s Blog and Channel9 videos for more instruction on MEF and Silverlight.

Johannes Kebeck from Microsoft provided the “visual stimulation” with his impressive manipulation of Bing Maps. Johannes demonstrated many different examples of mapping applications out in the real world that are already utilising the Bing Maps Silverlight Control. Two of particular note were the TwitterMap by Earthware and the EyeOnEarth by the European Environmental Agency and Microsoft. Johannes blogs here.

 

Finally, I would like to acknowledge and thank our sponsors…

Microsoft logo

for providing the beer, pizza & venue.

 


Want to join the discussion?
The event is geared to please/interest/inform both developers and designers alike, so if you are interested in coming along then please contact either myself or Michelle Flynn (here) and we will be glad to take your details.

Want to present or showcase?
We are always on the lookout for presenters for future sessions – whether it be a high or low level coding walk through, a workflow perspective or showcase demo. If you think that you have a topic/presentation that ought to be shared with the community then please contact me (here) and I’ll see if I can get you scheduled in!

Facebook
In addition to emailing us directly there is also a Facebook group for the "Silverlight UK User Group" group that we set up. Check for updates there too!

 

This was originally posted here at blog.mark-mann.co.uk because my EMC blog was compromised by hackers at the time of the event and was still down at the time of press.
I have since cross posted back to my EMC blog as its proper home.
permalink to the post on my EMC blog

I’ve been digging through a fair number of my old Silverlight demos/projects and been bashing into a fair number of “upgrade issues" when opening my older code. The two changes that have brought this problem to light is the transition from Silverlight 2 to 3 and a shift in the Silverlight SDK.

Referenced assemblies missing Silverlight?

Consider the example on the left, which is the hosting website for a ‘older’ Silverlight project. The project would have been created (probably at the same time when you created a new Silverlight project) as a ASP.NET website with a whole bunch of files and references to aid you on your way.

Of note; In older “ASP.NET with Silverlight” websites the template would have added a reference to System.Web.Silverlight, added a Silverlight.js file, and a couple of generated page examples (one as an aspx file and the other as plain HTML). An empty Default.aspx page is a hangover of the regular ASP.NET website/project template.

So, why is there a broken reference (System.Web.Silverlight) after I ran the upgrade project tool? Well, the project upgrade tool actually ran for the Silverlight project itself and not for the hosting ASP.NET website. Therefore it is up to you to sort it out! I don’t have any of the previous Silverlight runtimes, tools or SDK installed and so the System.Web.Silverlight assembly has been moved (both physically and in version number).

Basically, the latest version of Silverlight SDK removed the ASP.NET Silverlight control in favour defining the Silverlight area via a HTML object or via JavaScript embedding functions. Therefore any aspx files that declare a  <asp:Silverlight /> element will need to be revisited because the reference to System.Web.Silverlight is indeed dead now and also needs to be removed.

Even though we have lost the ability to use the ASP.NET Silverlight element in our ASP.NET pages, it is very easy to refactor our ASP.NET code by removing the offending code blocks and adding in either the HTML object notation or via JavaScript embedded functions.

For example –

In the <head> of the HTML markup:

<style type="text/css">
    #silverlightControlHost { height: 100%; }
</style>
<script type="text/javascript" src="Silverlight.js"></script>
<script type="text/javascript">
    function onSilverlightError(sender, args) {

        var appSource = "";
        if (sender != null && sender != 0) {
            appSource = sender.getHost().Source;
        }
        var errorType = args.ErrorType;
        var iErrorCode = args.ErrorCode;

        var errMsg = "Unhandled Error in Silverlight Application " +  appSource + "n" ;

        errMsg += "Code: "+ iErrorCode + "    n";
        errMsg += "Category: " + errorType + "       n";
        errMsg += "Message: " + args.ErrorMessage + "     n";

        if (errorType == "ParserError")
        {
            errMsg += "File: " + args.xamlFile + "     n";
            errMsg += "Line: " + args.lineNumber + "     n";
            errMsg += "Position: " + args.charPosition + "     n";
        }
        else if (errorType == "RuntimeError")
        {
            if (args.lineNumber != 0)
            {
                errMsg += "Line: " + args.lineNumber + "     n";
                errMsg += "Position: " +  args.charPosition + "     n";
            }
            errMsg += "MethodName: " + args.methodName + "     n";
        }

        throw new Error(errMsg);
    }
</script>

In the <body> of the HTML markup:

<!-- Runtime errors from Silverlight will be displayed here.
This will contain debugging information and should be removed or hidden when debugging is completed -->
<div id='errorLocation' style='font-size: small;color: Gray;'></div> 

<div id='silverlightControlHost'>
    <object data='data:application/x-silverlight-2,' type='application/x-silverlight-2' width='100%' height='100%'>
        <param name='source' value='ClientBin/Demo.SL.xap' />
        <param name='onerror' value='onSilverlightError' />
        <param name='background' value='white' />
        <param name='minRuntimeVersion' value='3.0.40307.0' />
        <param name='autoUpgrade' value='true' />
        <a href='http://go.microsoft.com/fwlink/?LinkID=141205' style='text-decoration: none;'>
             <img src='http://go.microsoft.com/fwlink/?LinkId=108181' alt='Get Microsoft Silverlight' style='border-style: none'/>
        </a>
    </object>
    <iframe style='visibility:hidden;height:0;width:0;border:0px'></iframe>
</div>

This is all well and good, but looking at the updated ASP.NET website, I wanted to take it one step further…. what is the bare minimum configuration required by a ASP.NET website?

Extending the solution I alluded to above – I created a new ASP.NET Web Site with the following Visual Studio template:

Adding an ASP.NET web site

This skeleton project includes a default.aspx page, but nothing else – at least it compiles! Note, that there is no References section in the Solution Explorer – that belongs to the ASP.NET Web Application template.

 Barebones ASP.NET web application

Visual Studio will allow you to link your Silverlight project to the new ASP.NET website if it is part of the solution (that’s why I extended the example solution above). To do this, open the project’s Property Pages which are accessed by right-clicking the website root and select Property Pages right at the bottom of the context menu. Select the list item option named Silverlight Applications.

 Silverlight Applications in the project property pages

Clicking the Add button will pop up the Add Silverlight Application popup which will hopefully default to the appropriate Silverlight project in the solution. I’ve highlighted that in the screen grab below. Also, ensure that Silverlight Debugging is enabled – which will modify the web.config and prove extremely useful when your application throws a spanner.

 Add Silverlight Application dialog

A wizard will run through adding all the relevant bits into the website which to no surprise, creates a couple of test pages (one HTML, the other ASP.NET) and a corresponding Silverlight.js file. The default.aspx file existed from before and remains untouched, so I usually delete it and rename the test aspx file to become the default.aspx page instead.

 The new website files

The end result is, the same as I had before though. I thought that there may have been some sort of further optimisation, but there is not. One of the main differences you might have spotted is the lack of added referenced assemblies. References are still part of the website, they just lurk in the project’s Property Pages instead.  You’ll then find that there is a list item called References such as that shown below. There are fewer referenced assemblies listed here than there are in a typical ASP.NET Web Application (as shown at the beginning of this article) but this does not necessarily impact any deployment since the .NET Framework includes all these assemblies, it is just that the ASP.NET website is not making them available to code at runtime (in a sense it is giving you a deployment buffer).

 References in the project property pages

To be honest, I would normally stick to using a ASP.NET Web Application project since it has nicer property pages and also works a bit neater with ClickOnce and publishing features of Visual Studio – but that’s just me :)

 

This is a cross post from my EMC blog, mainly for backup duplicity and to aggregate some of my past postings. My EMC blog used to be under the Conchango brand but was acquired by EMC so I’ve also retrospectively refreshed some of the old links and maybe a tweak a bit of content too.

permalink to the original post here

Snow has dominated the UK headlines recently, giving rise to the BBC News new media sound bite of Frozen Britain. I wonder if I should have cancelled my ski holiday and headed for the local hills! Hopefully you won’t be suffering from being snowed-in come February 3rd for the first meeting of the Silverlight UK User Group in 2010. I’m very pleased to announce that we have two excellent Silverlight sessions lined up.

We’re running the next meeting from the Microsoft office at Cardinal Place so I would like to thank Microsoft for generously allowing us to use their conference rooms and feeding us  as well as providing us with two speakers! I can’t wait!

Anyway, the details are below:

Date:

Wednesday 3rd February 2010

Time:

Registration @ 18:00, Kick off @18:30 – don’t be late!
Till about 9:30pm

Where:

Microsoft London (Cardinal Place)
100 Victoria Street, London SW1E 5JL

You can register here or via Michelle.
Registered attendees will be notified with the final details by Monday 1st February.

 

AGENDA

Registration @18:00

Welcome/Kick off @ 18:30

“A Guided Tour of the Managed Extensibility Framework (MEF) in Silverlight 4”
with Mike Taulty, Developer Evangelist from Microsoft

Silverlight 4 has a new framework that can help in building loosely-coupled and extensible applications – the Managed Extensibility Framework or MEF. MEF’s key ability is to flexibly compose an application out of a set of component parts that describe the functionality they expose and the functionality that they depend upon. MEF has the ability to discover components without the need for up-front registration and is extensible in many, many ways. In this session we’ll do a tour around MEF to look at what it does for you, how it does it and how you can use and extend it in your own Silverlight applications.

Breakout for refreshments kindly provided by MICROSOFT (pizza & beer & fizzies) and a bit of mingling!

"Working with the Bing Maps Silverlight Control"
with Johannes Kebeck, Bing Maps Technology Specialist from Microsoft

In this session you will have a closer look at the Bing Maps Silverlight Control. We will go through the basic steps to add multimedia content, connect to databases, create thematic maps and more. Throughout the session we will have a look at various options to measure performance and solve performance-related issues.

End.

 

Most of our user group are Tweet’ers, so if there’s anything you want to share amongst the group, then check out our Twitter hashtag or user accounts:

@mark_mann

@mark_mann

#sluguk 

#sluguk

@michelleflynn

@michelleflynn

Please register and I hope to see you there!

mark.

 

About Mike Taulty

Mike Taulty

Mike Taulty works in the Developer and Platform Group at Microsoft in the UK where he has spent the past few years helping developers understand and get the best from the Microsoft platform. Prior to this, Mike spent 3 years with Microsoft Consulting Services as a consultant on developer technologies. Before joining Microsoft, Mike spent the previous 9 years working as a software developer for a number of enterprises, consultancies and software vendors working with a variety of operating system, client, communication and server technologies.

Mike Taulty’s Blog | twitter.com/mtaulty
 

About Johannes Kebeck

Johannes Kebeck

Johannes Kebeck is a Technology Specialist for Microsoft’s Bing Maps, supporting customers and partners in Europe, the Middle East and Africa. He is currently based in Reading, UK and has over 14 years of experience in the GI/GIS market. In October 2004 Johannes joined Microsoft in Germany working within the Enterprise & Partner Group and in 2005 he joined the Bing Maps team. Before specialising on Microsoft’s geospatial products and services, he had experience with various GIS, spatial databases, relational database management systems, workflow management, collaboration products and IT security.

Johannes Kebeck’s Blog | twitter.com/JohannesKebeck

 


Want to join the discussion?
The event is geared to please/interest/inform both developers and designers alike, so if you are interested in coming along then please contact either myself or Michelle Flynn (here) and we will be glad to take your details.

Want to present or showcase?
We are always on the lookout for presenters for future sessions – whether it be a high or low level coding walk through, a workflow perspective or showcase demo. If you think that you have a topic/presentation that ought to be shared with the community then please contact me (here) and I’ll see if I can get you scheduled in!

Facebook
In addition to emailing us directly there is also a Facebook group for the "Silverlight UK User Group" group that we set up. Check for updates there too!

 

This is a cross post from my EMC blog, mainly for backup duplicity and to aggregate some of my past postings. My EMC blog used to be under the Conchango brand but was acquired by EMC so I’ve also retrospectively refreshed some of the old links and maybe a tweak a bit of content too.
permalink to the original post here
Powered by WordPress Web Design by SRS Solutions © 2010 mr mann's mishmash Design by SRS Solutions