Mike Taulty's Blog
Bits and Bytes from Microsoft UK

Silverlight - Mike Taulty's Blog

Blogs

Mike Taulty's Blog

Elsewhere

  • Silverlight 4 & MEF – Switching on functionality based on application context

    In my head, I see Silverlight 4 applications as either running; In Browser Out of Browser Out of Browser and Trusted Out of Browser and Trusted and in the presence of COM interop ( i.e. on Windows ) and you might write functionality that only works in certain of those contexts – e.g.; HTML display only works out of browser. You can only read the contents of “My Documents” when out of browser and elevated You can only run any COM interop code when in the presence of COM interop and I thought that it might be a good use of MEF as a way of only bringing in the functionality that is going to work in a particular context. So, I defined an enum; [Flags] public enum AppContextStatus { InBrowser = 1, OutOfBrowser = 2, InOrOutOfBrowser = 3, OutOfBrowserTrusted = 4, OutOfBrowserCOMInterop = 8, All = 15 } and then I wanted to be able to figure out which of these particular states my code might be running in. So, a little class; public static class AppContext { public static AppContextStatus CurrentStatus { get { AppContextStatus...
    Filed under: ,
  • MIX10

    I’m excited as it’s looking pretty likely that I’ll be able to get to my first ever MIX conference – MIX10 in March, Las Vegas. The current plan is that I’m going to pitch in and deliver the Silverlight Bootcamp;   with “Mr Silverlight TV” himself, John Papa . I’m looking forward to it – hope to catch you out at MIX if you’re heading out there. The way the agenda’s shaping up, I think I’ll be lucky in that my first MIX will hopefully be the best MIX so far :-)
    Filed under: ,
  • Silverlight Session on MEF at Silverlight User Group, 3rd February, Microsoft London

    Just a quick advert for something that I thought I’d already publicised but now I’m “not so sure” as I can’t find it on my site :-) I’ll be giving a talk about the Managed Extensibility Framework (MEF) in Silverlight down at the Silverlight User Group in London on Wednesday evening this week. This happens in the Microsoft office and you can find the details & registration by clicking the image below to jump over toe Mark’s blog which details the agenda including a session on Bing Maps from Johannes .   Hope to see you there :-)
  • Silverlight in “Advert Worth Watching” Shocker! :-)

    There’s an ad over on MSN UK for the new “Mass Effect 2” game and it’s very distinctive as it’s done in Silverlight and has some really cool aspects to it such as making use of Smooth Streaming and DeepZoom. It’s not often ( well, ever ) that I’ve linked to an ad before or suggested that someone watch one but I think this is really worth a look at to see the sort of quality that you can get from Silverlight in an ad like this. It’s also worth going full screen with it and experimenting with the navigation system. Click the image below to jump to the page ( although, of course, ads run for a duration and so I guess it may not still be there if you get to this post in a few days/weeks time ). You can find more detail on the ad from the guys at Metia ( ooh – nice Silverlight home page too :-) ) who put it together. Steve Ellis has a post over here about it and Dean Gifford has one here which spells out a little more detail about what you’re looking at. I don’t know whether it’s a “true first” for Silverlight or not...
    Filed under: ,
  • Silverlight 4 – Writing a Windows-Only Application via COM Interop?

    I was reading Tim’s post over here on “Silverlight 4 with COM can do anything – on Windows” which referenced Justin’s amazingly detailed post with a bunch of COM interop examples from Silverlight 4 . A Silverlight 4 beta application that has been explicitly installed as trusted by the user can create COM objects if they have a registered ProgId and if they implement IDispatch. As anyone who’s been around Windows for a while and especially anyone who wrote scripting code like ASP pages will know, that opens up quite a lot of code to those applications. I think that was made pretty clear at the PDC when the feature was first announced. My personal view is that the COM interop feature is something that you'd use sparingly to add additional functionality that becomes available when and where COM interop is turned on rather than writing a tonne of code that takes the COM interop route. Why’s that? Firstly, you might find your application goes into an environment where the users aren't allowed to run trusted...
    Filed under: ,
  • Silverlight in Seventy Seven Slides ( yes, I know ;-) )

    Back in the old days, I used to do a lot more in-person talks/sessions for developers and one of the things that myself and colleagues would discuss is whether a topic was well developed enough to warrant a; What Is? session or a; What’s New With? session. That is – was the technology new enough that people still needed to start from scratch or was it well enough advanced that you bore most people by explaining the core concepts yet again by doing what I’ve heard described as a; “ First the Earth cooled…” kind of session. The reality of turning up at a company or a user group or a conference is that it’s rare that someone gives you time to do both an introduction to the basics alongside coverage of recent additions to a technology. If you decide to try and do both in the space of the 45,60,75,90 minute slot that someone’s given you then you invariably end up talking at a very high level and the attendees feel that you’ve cheated them in some way by only managing to say “IIS is a web server and there’s some new...
    Filed under: ,
  • Silverlight, Bing Maps, Vectors and “Did I blog this or did I just dream it?”

    I was looking for an example of how Silverlight content is drawn with vectors that I could use in a slide-deck and it occurred to me to look at Bing Maps . I think the Bing Maps beta is pretty stunning and I was searching my blog for where I’d made reference to the beta and I realised that I don’t think that I have made reference to it; I must have just dreamt it. Or, more likely, dropped it onto Twitter. Anyway, if you haven’t seen the Bing Maps beta with Silverlight & PhotoSynth and all that goodness then read this post from Chris and then go and check it out although I warn you that it can eat quite a bit of time once you get playing with it. Anyway, back to vectors. It’s easy to see the “vector effect” on Bing Maps by just zooming the browser up to 200% or 400% where you can see the quality of the fonts and UI elements such as;   and you can very quickly see where bitmaps are used in the UI like in this weather symbol ( and the maps :-) );
    Filed under: ,
  • Silverlight 4 Beta & MEF – Experimenting with an alternative Programming Model

    One of the things that seems hard-baked into MEF if you watch the Silverlight 4 and MEF screencasts that I’ve made is that MEF relies on attributes. It’s common to see an example such as this skeleton class; public class PluginManager { public PluginManager() { PartInitializer.SatisfyImports(this); } [ImportMany] public IEnumerable<IPlugin> Plugins { get; set; } } which is using an ImportMany attribute so if it happens to be composed with these 2 types below; [Export(typeof(IPlugin))] public class PluginA : IPlugin { public string Name { get { return ("PluginA"); } } public void DoSomething() { throw new NotImplementedException(); } } [Export(typeof(IPlugin))] public class PluginB : IPlugin { public string Name { get { return ("PluginB"); } } public void DoSomething() { throw new NotImplementedException(); } } then creating a new instance of PluginManager would result in MEF composing an instance of PluginA and PluginB onto/into that property called Plugins on PluginManager. However,...
    Filed under: ,
  • Silverlight 4 – Displaying a Bunch of Files from a Zip File

    One of the things I often find when publishing blog posts is that I want to display a bunch of files. For instance – in talking about WPF or Silverlight you might be trying to show something that involves a XAML file and a couple of code files and it can be a bit painful if you have to do that with 3 separate lumps of embedded text inside of a blog post. I was thinking about that problem a bit more generally and I wondered how I could do something such that I’d have a control that I could just drop into a blog post in order to display a number of files. Almost like a mini-explorer view across a set of files. I figured that I could use Silverlight for this and then I pondered a little on how I’d want to file-set packaged in order that it’d be as little trouble as possible to create one of these plug-ins. I decided on Zip. There are a few zip libraries out there for .NET but I settled on using the DotNetZip   project from CodePlex which I brought down in source form and hacked to work with Silverlight. When...
    Filed under: ,
  • Silverlight Session at NEBytes, 20th January, Newcastle

    Just a quick plug for a session that I’m delivering at a new Microsoft User Group in Newcastle on the 20th January. The group is called “NEBytes” and you can find it and details of the sessions on the 20th by clicking their banner below; I’m delivering a session on Silverlight. The intention is to try and talk from version 1 through to version 4 with an emphasis on the later versions (3 and 4) – it should be entertaining to try and fit all of that into an hour long session so I’ll have to set a level for the talk that lets me get it in. If you’re in the area come along and support the new group & I look forward to catching you there.
  • iMeta Agility & Silverlight

    Just a little plug for a video I made just before Xmas with the guys from iMeta , a UK company that’s built a scrum tool called iMeta Agility with Silverlight. The picture’s hyperlinked to their video on Channel 9 – click to take a look and, also, try the latest version of the application .
    Filed under: ,
  • Silverlight 4 Beta – More on MEF and the PackageCatalog

    One of the things that I talked about in the screencasts that I made about Silverlight 4 and MEF was the PackageCatalog. By the way – to make any sense of this stuff you need to install Visual Studio 2010 Beta 2 and Silverlight 4 Beta . The PackageCatalog is currently part of the Silverlight 4 Toolkit . It comes with a friend called Package which can asynchronously download a XAP file to produce an instance of Package. You can then take that instance and add it to a PackageCatalog that’s being used by a MEF CompositionContainer in order to add functionality dynamically and asynchronously to an already running application It’s important to remember that the Silverlight Toolkit represents a place for innovation and is something that’s not supported in the same way as Silverlight itself so when you’re using types from there, bear that in mind ( and especially when things are in beta/preview phases ). As a simple example, imagine I’ve got an “application” that looks like this ( code deliberately shortened to the shortest...
    Filed under: ,
  • Silverlight 4 Screencasts - the Managed Extensibility Framework (MEF)

    One of the interesting things about Silverlight 4 is the inclusion of the Managed Extensibility Framework (MEF) and I think it really helps to build the case for Silverlight 4 as a great platform for business applications. Silverlight applications are rich internet applications – the deployment model is strongly angled towards web deployment as the only way to install a Silverlight application is to start on a web page and run the application - the deployment is intended to be simple, quick and secure. As developers build more and increasingly complex applications with Silverlight they can hit a tension between preserving the ethos of Silverlight deployment ( i.e. simple, quick and secure ) and building an application with the rich set of functionality that they need. They also have to contend with the usual “abilities” of software development like making sure that the application is correct, performant, available, secure, scalable, maintainable and possibly extensible whilst being productive with the code they...
    Filed under: ,
  • “Can a Mac-Only Shop do Silverlight Development?”

    Loved this; As an aside, I spent some time exploring Eclipse4SL in Eclipse on OS X the other week – I might post some thoughts on that here.
  • Silverlight 4 – WebCams.OnceMoreWithAudio()

    Ok, ok – this will be the last post about webcams and capturing video. I’ve got to stop :-) BUT…I thought I’d modify the code from the last post a little in order to try and capture audio along with the video. This opened up some “interesting questions” in that in Silverlight you derive from an AudioSink to capture audio and from a VideoSink to capture video. Now, those 2 base classes look awfully similar and if you want to capture both audio and video and try to synchronise the two then it feels a bit painful that you can’t implement some capturing interfaces rather than have to derive from base classes. Also, even though you feed both sinks into a CaptureSource, I noticed that I was getting audio samples a little before I was getting any video samples and so it looks like there a job involved to try and synchronize the two together. Silverlight does tell you where in the time sequence these various samples come from and it tells you how long they last but it could be expensive to try and analyse that information...
    Filed under: ,
1 2 3 4 5 Next > ... Last »