Mike Taulty's Blog
Bits and Bytes from Microsoft UK

May 2009 - Mike Taulty's Blog

Blogs

Mike Taulty's Blog

Elsewhere

  • DevDays Holland – Follow Up, Slides, Demos

    I’m just back from DevDays where I had a really great time and delivered a 2-part session on; What’s Coming in Silverlight 3 and another single session on; Beyond Silverlight with WPF if you came along to my sessions then thanks very much for doing that and I hope that you enjoyed them and the conference generally – I’ve been twice now and I think it’s one of the best that I’ve been to and so thanks to the organisers for inviting me back there this year and putting on such a great show. The slides for the talks can be found here   – there weren’t many slides for the Silverlight talks and a few of the slides were borrowed from Scott Guthrie’s talk at MIX09 where he talked about Silverlight Momentum. In terms of code/demos. My Silverlight talks were really ones where I built up pretty small examples as we went along. What I think I showed was as below ( please remember that these demos were meant to be simple rather than the best example of what the technology can do :-) ); Graphics and Media Perspective transforms...
    Filed under: , ,
  • Process list in XAML plus a bit of virtualisation with the .NET Client Profile

    It’s a public holiday in the UK and the weather’s turned sour but playing with XAML and WPF can still bring on a smile – I’m not claiming it’s anything new or clever but I enjoyed it ( paste into Kaxaml or XamlPad to view ); <Page    xmlns=" http://schemas.microsoft.com/winfx/2006/xaml/presentation"    xmlns:ctl="clr-namespace:System.Windows.Controls;assembly=PresentationFramework"    xmlns:env="clr-namespace:System.Diagnostics;assembly=System"    xmlns:x=" http://schemas.microsoft.com/winfx/2006/xaml" >    <Page.Resources>     <Style x:Key="styleFontFamily" TargetType="{x:Type TextBlock}">       <Setter Property="FontFamily" Value="Calibri"/>     </Style>     <Style x:Key="styleTitleFont" BasedOn="{StaticResource styleFontFamily}" TargetType="{x:Type TextBlock...
    Filed under: , ,
  • Windows 7: What’s there for Developers?

    Internally, I’ve had a number of people ask me “What’s in Windows 7 for Developers?” or “What will developers get out of Windows 7?” and so I thought I’d put together a short post with some links around places to go for information on Windows 7 and what to expect when Windows 7 ships. The first point I’d make is one that’s very important to me. Developers are users too. In fact, they’re “power-users”. And then some. They’re running the standard apps that most users run but, beyond that, they’re also running ( at a bare minimum ) a bunch of development tools and some of those might be RTM or preview along with perhaps a whole bunch of SDKs ( RTM/preview ) that they’ve grabbed off the web which may/may not be compatible with the latest version of the operating system and then they’re switching between apps like; Visual Studio(s) SQL Management Studio & Profiler Reflector :-) SysInternals and other diagnostic tools Maybe an additional design tool like Expression Web/Blend or equivalent Outlook Browser IM client...
    Filed under:
  • Experimental post to try code-formatting in Live Writer

    On advice from Twitter :-) I’m trying a new code-formatting plug-in for Live Writer. It’s this one from here . Here’s an experimental piece of code that my previous plug-in wasn’t coping with very well, let’s see if this post shows up and whether it causes my blog engine to explode :-) using System; using System.Net; using System.Windows; using System.Windows.Controls; using System.Windows.Documents; using System.Windows.Ink; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Animation; using System.Windows.Shapes; using Expression = Microsoft.Expression.Interactivity; using System.Linq; using System.Windows.Data; using System.Collections.Generic; using System.Reflection; namespace MikesDragDropBits { public class DraggableBehavior : Expression. Behavior < FrameworkElement > { public DraggableBehavior() { } public string PropertyPath { get ; set ; } protected override void OnAttached() { base .OnAttached(); this .AssociatedObject.MouseLeftButtonDown += OnMouseDown; this .AssociatedObject...
    Filed under:
  • Expression Blend 3: Trying a Drag-and-Drop Behavior (Part 2)

    Following on from this post , I wanted to try and connect my DraggableBehavior to my DropTrigger but I wasn’t quite sure how to make that work and so I just went for a pretty cheap-and-cheerful mechanism that’s a long way from perfect as it stands at the moment. I modified my DraggableBehavior a little – from the previous post it’s changed in that there’s now a simple PropertyPath and when the mouse button comes up at the end of the drag, I just use reflection to try and get the property indicated by the PropertyPath and pass that through to any DropActions that I find ( if there is no PropertyPath then I just pass the AssociatedObject from the Behavior itself ); using System; using System.Net; using System.Windows; using System.Windows.Controls; using System.Windows.Documents; using System.Windows.Ink; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Animation; using System.Windows.Shapes; using Expression = Microsoft.Expression.Interactivity; using System.Linq; using System...
    Filed under: ,
  • 13th May – Session at the SQL Servers User’s Group at Microsoft, Reading

    Just a quick plug – tomorrow evening I’m doing a session on ADO.NET Data Services (“Astoria”) at the SQL Server User’s Group at Microsoft, Reading. See here for details; http://sqlserverfaq.com/events/167/Sessions-on-Understanding-ADONET-Data-Services-Windows-7-features-indepth-and-the-usual-SQL-Nuggets-and-Networking.aspx it’d be great to see you there.
  • Expression Blend 3: Trying a drag-and-drop behavior (part 1)

    I tried to take this post a little futher by trying to build a drag-and-drop behaviour. It’s still something that I’m working on. I built a DraggableBehavior which is pretty similar to the one that’s found in the Sample Silverlight 3 Behaviors in the gallery. The difference between mine and that sample was that during a drag operation I don’t want the original UI to move. I want a copy of it to be moved. That is, if my original UI looks like this; and I make the ellipse on the left hand side draggable then when I drag it I want to see; ideally I’d also want to see a little “+” sign on it or similar but that could come later. Now, in Silverlight 3 this feels like it might be do-able in the sense that I could make a copy of whatever is being dragged by getting it to draw itself into a WriteableBitmap and then just putting that into an Image and dragging the Image around. Fine…but where do I parent that Image (I’ll call it the drag image ) as it’s dragged around? I can (maybe) assume that my top level UI is a UserControl...
    Filed under: ,
  • Expression Blend 3: More on Actions, Triggers, Behaviors

    I figured that it was time for me to try and fathom Behaviors in Expression Blend 3. I’d seen quite a bit about them, I’ve seen them used but I hadn’t sat down and tried to do anything with them myself. First off, I read some very good backgrounders over here; Blend 3 Behaviors- Interactivity Without Code Blend 3- Triggers, Actions, Behaviors Blend 3 Behaviors- A Sample Action and then I followed up with some bits over here which are equally good; A Quick Walkthrough Writing Your Own Triggers Looking at Triggers and Actions and, in terms of trying to write something original around these topics, I’m not sure that there’s much that I can add but I did want to write something down as it forces me to actually walk through it and think about it properly. Prior to Blend 3 Preview, both WPF and Silverlight have the idea of; Trigger - something that flags when an interesting thing happens like a property hitting some value or an event being fired Action – something to do like running a Storyboard, displaying a MessageBox...
    Filed under: ,
  • Windows 7 for Developers – File Dialogs from .NET

    I’m reading Yochay’s posts up at the Windows 7 for Developers blog; http://windowsteamblog.com/blogs/developers/rss.aspx It’s all great material – one of the things that I hadn’t been aware of was that if in a WPF application ( on 3.5 Service Pack 1 ) I’m using a file dialog as in; using S y s t e m ; using S y s t e m . W i n d o w s ; using w i n f o r m s D i a l o g = S y s t e m . W i n d o w s . F o r m s . O p e n F i l e D i a l o g ; namespace W p f A p p l i c a t i o n 1 { public partial class W i n d o w 1 : W i n d o w { public W i n d o w 1 ( ) { I n i t i a l i z e C o m p o n e n t ( ) ; } void O n C l i c k ( object s e n d e r , E v e n t A r g s a r g s ) { w i n f o r m s D i a l o g d i a l o g = new w i n f o r m s D i a l o g ( ) ; d i a l o g . S h o w D i a l o g ( ) ; } } } then I get this dialog; whereas if I use this code ( which is what I would naturally do in a WPF application ); using S y s t e m ; using S y s t e m . W i n d o w s ; using w i n 3 2 D i a l o g = M i c r o s o f...
    Filed under:
  • Windows 7 – How Does Task Manager Do That?

    I’ve just finished making my complete move to Windows 7. I’ve been running Windows 7 for a while on a number of machines but with the RC I thought I’d move lock-stock-and-barrel to Windows 7. One of the first things that hit me was around the UAC options. I’ve always left UAC switched on but I’ve generally configured it so that it doesn’t use the secure desktop. Now, I realise that this is slightly less secure than the default but I do it for a reason and that’s because I do a lot of demos on projectors and if you leave the secure desktop switched on then the screen tends to go dark when the UAC prompt fires up and the room goes a bit dark and the audience gets a bit of a “shock” :-) So, I usually switch off the secure desktop aspect – that is, in the local security policy I disable the middle on of these three; but then today I ran Task Manager and I asked it to “show processes from all users” and I was a bit surprised because I didn’t get a UAC prompt (I’m running as administrator on my machine but UAC is switched...
    Filed under:
  • Metadata Classes – A Force for Good or Evil? :-)

    I’ve started to experiment with the RIA Services Framework and I’ve noticed that it uses the “buddy class” pattern that I first saw in ASP.NET dynamic data. The basic idea is that you’ve got some class that is generated by a tool (pseudo-code); public partial class MyClass {   public int MyProperty { get; set; } } and you want to provide some additional metadata around those properties but you can’t just stick an attribute onto the property definitions themselves because you’ll lose them when the tool regenerates them ( assuming the tool doesn’t have its own repository for those attributes which it can use to put them back at generation time ). So, what do you do? The ASP.NET dynamic data model adds another by doing something like this; [MetadataClass(typeof(MyMetadataClass))] public partial class MyClass {   public int MyProperty { get; set; } } public class MyMetadataClass {   [Range(1,100)]   public int MyProperty{ get; set; } } that is – it introduces a companion or “buddy” class which...