Mike Taulty's Blog
Bits and Bytes from Microsoft UK

April 2009 - Mike Taulty's Blog

Blogs

Mike Taulty's Blog

Elsewhere

  • Silverlight 3 – System Colours

    Silverlight 3 has a new class called SystemColors and hanging off that class are a bunch of properties as below; If I write a Silverlight application today and draw a button on the screen as in; < Button Content ="Click Me" FontSize ="24" HorizontalAlignment ="Center" VerticalAlignment ="Center" /> then that displays as below; and you can see it running right next to Calculator. However…if I change my system colours in Windows to (e.g.) one of the high contrast settings; then this is what I end up with; that is – Calculator has played ball and so has FireFox but my Silverlight application isn’t really playing ball in that it has maintained its look and feel in spite of the system settings. It’d be nice if there was the possibility of the Silverlight application picking up those settings if the user/developer wants it to. Now, the SystemColors class is nice but it just has a bunch of static properties on it and nor is there any kind of change notification present when...
    Filed under: ,
  • “Getting Started with Silverlight”

    I hadn’t come across these resources; before today so I thought I’d flag them up – I haven’t watched them myself yet and I’m guessing that these are more designer focused than developer focused but I’d imagine there’s a bunch of stuff worth learning in there. Now…whether these are also at www.silverlight.net , I’m not sure – if not, then they should be as having one URL to hand out to folks is useful :-)
    Filed under:
  • Silverlight 3 – Simple “Flip Control” built on PlaneProjection

    Just sharing a very small experiment I did with building a simple control that would use the new PlaneProjection capabilities in Silverlight 3 in order to present double-sided content which was capable of being flipped over. I did a similar thing in this FlickR project but I just wanted to make it a little more general (and I’d like to make it more general still if I get a chance to spend a little more time on it). I’ve shared the control project here for download – what this provides is a control called FlipControl which has properties; IsIdle FrontContent RearContent FlipAxis (Vertical/Horizontal) Duration OffsetX OffsetY OffsetZ and then a single method; Flip() and a single event; FlipCompleted and so I can go and use it in a Silverlight app with something like; < UserControl x:Class ="SilverlightApplication5.MainPage" xmlns ="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x ="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc ="clr-namespace:MikesControls;assembly...
    Filed under: ,
  • Silverlight 3 – Simple Control for Online/Offline

    Given that Silverlight 3 can detect the online/offline status of the network, I thought I’d have a play with a simple control that displays something when the network is online and something else when the network is offline. I started with a UserControl but ended up just with a Control using the “parts and states” model that had just one group of states called OnlineOfflineStates with 2 states within it named Online and Offline . The source for the control is here and it’s just a little code ( might have bugs in it as it’s not been tried very much :-) ); namespace M i k e s C o n t r o l s { [ T e m p l a t e V i s u a l S t a t e ( N a m e = "Online" , G r o u p N a m e = "OnlineOfflineStates" ) ] [ T e m p l a t e V i s u a l S t a t e ( N a m e = "Offline" , G r o u p N a m e = "OnlineOfflineStates" ) ] [ T e m p l a t e P a r t ( N a m e = "OnlineContentRoot" , T y p e = typeof ( P a n e l ) ) ] [ T e m p l a t e P a r t ( N a m e = "OfflineContentRoot"...
    Filed under: ,
  • Silverlight 3 – Knowing When Images Are Loaded

    I’m sure there’s a lot out there on this already but one of the things that I encountered in making this little application was the need to know when an image loaded from the network is actually ready to display in Silverlight. In that application, I have 2 images on the screen. What happens is something like this. Assume I have 2 images loaded in the app; OnTimerTick() Get the URL of the next image we’re going to display from FlickR Change the back image be displaying that new image by setting its URL. Run our “spin effect” animation to spin the back image to the front image. It’s something like that, anyway. Now, when I was first doing this I hit a problem. It wasn’t one that surprised me as I’ve seen it before and kind of expect it anyway. If I just do what I described then (because Silverlight loads the image from the URL asynchronously) I can get into a situation where I’m running my “spin effect” but the back image hasn’t yet loaded so I’m transitioning to a bunch of whited-out rectangles. That’s not good...
    Filed under: ,
  • Silverlight Session in the City Today

    If you came along to my Silverlight session at “a company in the City” today then the relevant links are all here
  • Silverlight 3 – Out of Browser Applications on the Mac

    At the webdd on Saturday, a couple of people asked me about Silverlight 3 Out-Of-The-Browser applications ( or SLOOBs ) and questioned; Whether the actually work on the Mac What the experience is like for the user It occurred to me that this might be a reasonably common question for developers who are working on Windows and don’t have a Mac with OS X on it kicking around so that they can try these things out. SLOOBs do work fine on the Mac and I thought I’d make a short screencast where we build a simple SLOOB ( similar to the one that I used for demo purposes on Saturday ) and then deploy it to my iMac (running Leopard) and see what the Out-Of-The-Browser experience looks like over there. Here’s the video on Channel9 ( note – this is just a picture that jumps to the C9 page ); In discussing SLOOBs on the Mac we had a slightly more general discussion around whether there were any features that were Windows specific in Silverlight and I managed to come up with one or two e.g.; The Windowless parameter on the plug...
    Filed under: ,
  • Silverlight 3 – FlickR Client

    This was really a “just for fun” thing that I started because I was stuck in a hotel the other night ( hotel rooms are great for writing code ) and I wanted to play with using the PlaneProjection in Silverlight 3 to produce a flip effect and I ended up writing a very basic client for FlickR so I thought I’d share it here. The flip effect I was looking for was one where I had a rectangle painted with an image and then it flips over to display a different image from the back. That’s all fine and you might think that it’s achievable by just having 2 rectangles with different Z-orders or perhaps with a slightly different PlaneProjection.[Global/Local]OffsetZ and then just applying rotations around the X or Y axis but, as far as I know, that doesn’t really work and what you end up having to do is control the visibility of each rectangle as they get rotated in order that they show up at the correct time. I ended up building this application here anyway which has some of this in it; it goes off to FlickR and gets some...
    Filed under: ,
  • Videos from DevWeek: Catching up with Aaron Skonnard

    I was lucky enough to have a chance to chat with Aaron Skonnard at DevWeek last month and I captured a few videos which I thought I’d share here. Aaron (as you probably know) is a co-founder of the Pluralsight company and is a great trainer and technical presenter and was keynoting DevWeek with a talk about Cloud Computing so I manage to snag him and ask him a few questions about “the Cloud”. I’ve broken this down into a couple of sections, the first one here mostly being about timelines as we head towards Cloud; and then the second one here being more about how developers can prepare for Cloud computing; and then this last one here was really more of a “fun” question where I asked Aaron what he was currently playing with. I always find this an interesting question as I think all developers are always secretly toying with some bit of technology even if it means staying up late :-) Here’s Aaron’s answer; Enjoy!
  • Setanta Sports on Silverlight

    I got a mail from Mark over at EMC Conchango about the new Setanta Sports site that’s gone live on Silverlight. Mark also runs the Silverlight User Group in London. Here’s my first run of the Setanta app (the first image is hyperlinked to the site itself); It all looks pretty cool to me so congrats to the guys at EMC Conchango and Setanta in getting this up and running – great showcase for what Silverlight can do.
    Filed under: ,
  • Silverlight 3 – Out of Browser Applications with Cached Extensions

    Yesterday, by mistake, I tried to combine 2 features of Silverlight 3 that don’t work together. Unfortunately for me, it was in front of a bunch of people :-) I’d been briefly showing how you can decrease the size of a Silverlight 3 XAP by using the new project option in Visual Studio to reduce XAP size. The way this works is that; Microsoft assemblies that would usually be built into your XAP can be downloaded from microsoft.com This reduces the size of your XAP This benefits all applications as they don’t all end up packaging assemblies that are common So, generally, that’s all good stuff. However…it doesn’t work when you combine it with Out of the Browser applications – in the current beta when you take an application that’s using cached extensions out of the browser you’ll find that it doesn’t work ( for me, what happens is that the application doesn’t display anything when it’s taken out of the browser ). Now, I’d never actually meant to try and combine these 2 things in my demo – it was something that I...
    Filed under: ,
  • Silverlight 3 and GPU Acceleration

    I learnt something this week so I thought I’d share. I’ve heard a number of people say “Silverlight 3 has hardware acceleration” and I didn’t really know what it meant (and perhaps still don’t, fully) so I thought I’d do a bit of an experiment with it. In Silverlight 3, the hardware acceleration feature is opt-in - if you don’t switch on hardware acceleration then you’ll see no effect from it. How do you switch it on? There’s a new parameter to the Silverlight plug-in called enableGPUAcceleration which would leave you with an object tag looking like; < object data ="data:application/x-silverlight-2," type ="application/x-silverlight-2" width ="100%" height ="100%" > < param name ="enableGPUAcceleration" value ="true" /> < param name ="source" value ="ClientBin/SilverlightApplication18.xap" /> </ object > means that the slides that I produced up here; http://www.slideshare.net/ukdpe/mtaultydevweeksilverlight...
    Filed under: ,
  • Silverlight 3 – Navigation & Prettying my URI’s

    Ian saw my post with a little Silverlight navigation application and dropped me a mail saying “couldn’t you make those URI’s a little more pretty with the UriMapper?” and he’s right :-) Tim has an explanation of UriMapper up here so I just followed that and mapped a few things and so now I should be able to use URI’s like these; http://www.mtaulty.com/downloads/SLMusic/music.html#artists http://www.mtaulty.com/downloads/SLMusic/music.html#albums http://www.mtaulty.com/downloads/SLMusic/music.html#albums?artist=Bob%20Dylan http://www.mtaulty.com/downloads/SLMusic/music.html#songs http://www.mtaulty.com/downloads/SLMusic/music.html#songs?artist=Bob%20Dylan http://www.mtaulty.com/downloads/SLMusic/music.html#songs?album=Blood%20On%20The%20Tracks not sure if I can do anything to pretty them up more than that but removing the need for the URI to contain “/Pages/{XYZ}.xaml” is definitely an improvement both from the point of view of convenience and of maintenance.
    Filed under: ,
  • PropertyChangedNotification Snippets

    If I’ve written code around PropertyChanged notification in Visual Studio once then I must have done it thousands of times so I thought I’d do a quick snippet and drop it here. Snippet for a class that implements INotifyPropertyChanged; <?xml version="1.0" encoding="utf-8" ?> <CodeSnippets  xmlns=" http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet" >     <CodeSnippet Format="1.0.0">         <Header>             <Title>Class with property changed notification</Title>             <Shortcut>pcclass</Shortcut>             <Description>Code snippet for class with property changed notification</Description>             <Author>Mike Taulty<...
    Filed under: ,
  • Silverlight 3 and Navigation Applications

    I’ve had a quick experiment with Silverlight 3 and navigation applications. There are some new classes in the assembly System.Windows.Controls.Navigation.dll – specifically one called a Frame and a base class to derive from called Page along with some helpers of which the most key appears to be NavigationSource. I built a little sample out of this. I wrote some .NET code that ran around my music library on my NAS and sucked out all the MP3 file information it could find and then I bundled that into an XML file and built a Silverlight app which shows that data. You can wander into the app by doing; http://mtaulty.com/downloads/SLMusic/music.html which is the same as visiting my artists page as in; http://mtaulty.com/downloads/SLMusic/music.html#/Pages/Artists.xaml but then there’s also my albums page which you can visit with; http://mtaulty.com/downloads/SLMusic/music.html#/Pages/Albums.xaml but you can also augment that query string as in; http://mtaulty.com/downloads/SLMusic/music.html#/Pages/Albums.xaml?artist...
1 2 Next >