Mike Taulty's Blog
Bits and Bytes from Microsoft UK

Silverlight - Mike Taulty's Blog

Mike Taulty's Blog

Mike's Badges

Follow on Twitter
View mike's profile on slideshare
Add to Technorati Favorites
CW Blog Awards
  • Speaking at MIX Essentials, Dublin, 24th June

    Just a quick plug – I’ll be doing some sessions on Silverlight 3 at MIX Essentials in Dublin on the 24th June. Click the picture above to jump to the site where you can register. It’s an all day event with 2 tracks running concurrently and I like the strap-line that says “ Completely Free” :-) Maybe see you there…
    Filed under: , ,
  • Silverlight: Product Maintenance Application ( Part 6 – Porting to WPF )

    Following on from this post . As expected, porting my Utilities library to WPF wasn’t too difficult. It was a matter of creating a WPFUtilities class library, adding the existing source from Utilities as linked code files and then referencing PresentationCore and PresentationFramework and hitting build. then again, there were only a couple of very basic classes in there so it’s not too surprising. Next, I thought I’d try and port my Security project and so created another Class Library project WPFSecurity and added the existing source files as linked files again. This project though is a bit more complex in that it has 2 sets of WCF service references in order to call the Authentication and Role services made available by ASP.NET. I need to add service references to my WPFSecurity project and try and ensure as few code changes as possible by doing that. In adding the references, I made sure to use the same proxy namespace names; and also all references in Silverlight are asynchronous and so my...
    Filed under: , ,
  • Silverlight: Product Maintenance Application ( Part 5 – Running the app and thinking about WPF )

    Following on from my previous post it’s time to run up the app ( it’s not exactly a visual feast :-) ) and experiment a little with it. I can log in as my user ursula ; and she’s presented with “the UI” ( the graph should probably be hidden for users that are not in the viewers role but I’ve left it for now ); and then she can search for some data; and get back a bunch of paged data; and then navigate through it; because she’s neither a viewer or editor that’s all she can do and the grid is read-only and the Insert button and the View button on each row of data are disabled. If I log in as veronica who’s both a user and a viewer then the view button is enabled and I can bring up the sales history chart data; and then, finally, if I log in as eric who’s both a user and an editor then the grid becomes enabled as does the Insert button and the Save Changes button (as/when we make any changes) and so I can alter data and submit changes and so on; and that...
    Filed under: , ,
  • Silverlight: Product Maintenance Application ( Part 4 – Adding some controls )

    Following up on this post I thought the first control I’d build would be a graph control so I just referenced the Silverlight Toolkit for its graphs and very quickly had; <UserControl x:Class="SilverlightApplication6.Controls.ChartDisplayControl" xmlns=" http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x=" http://schemas.microsoft.com/winfx/2006/xaml" xmlns:charts="clr-namespace:System.Windows.Controls.DataVisualization.Charting;assembly=System.Windows.Controls.DataVisualization.Toolkit" xmlns:localCtl="clr-namespace:SilverlightApplication6.Controls"> <Grid x:Name="LayoutRoot"> <Grid.RowDefinitions> <RowDefinition Height="Auto" /> <RowDefinition Height="*" /> </Grid.RowDefinitions> <StackPanel Orientation="Horizontal"> <TextBlock Text="Historical sales data for product" /> <TextBlock Margin="5,0,0,0" Text="{Binding ProductName...
    Filed under: , ,
  • Silverlight: Product Maintenance Application ( Part 3 – Getting some data )

    Following up on this previous post I wanted to start building out some classes that managed data for me “in front” of the services I’d built. I figured that I needed data for my chart, data for my products and reference data and so I sketched out a “DataModel” class; public class DataModel : PropertyChangeNotifier { public DataModel() { salesChartData = new ChartData (); referenceData = new ReferenceData (); productData = new ProductData (); } public ChartData SalesChartData { get { return (salesChartData); } } public ReferenceData ReferenceData { get { return (referenceData); } } public ProductData ProductData { get { return (productData); } } ChartData salesChartData; ReferenceData referenceData; ProductData productData; } and I want to provide this ( or pieces of it such as DataModel.SalesChartData to various controls throughout the app so that they can data-bind to it ). There seemed to be a bit of commonality in the various classes I wanted to write in that each of them does...
    Filed under: , ,
  • Silverlight: Product Maintenance Application ( Part 2 – Building some web services )

    Following up from this post , I set about building some services to power my application’s data requirements. These aren’t perfect by any means but they’re enough for a sample application to get going with. Working from the sketch of how the services need to look given at the end of the previous post , I put together a LINQ to SQL diagram; and left LINQ to SQL to do concurrency checking based on every column in the Product table ( I only plan to modify the Product table ) which is its default if I remember correctly ( and, usually, overkill but it’ll do for me here ). And I then produced a rough service interface; public class L o o k u p D a t a I t e m { public int I d { get ; set ; } public string T i t l e { get ; set ; } } public class P r o d u c t S a l e s { public string M o n t h Y e a r L a b e l { get ; set ; } public decimal T o t a l S a l e s { get ; set ; } } public class P r o d u c t S e a r c h R e s u l t { public int P a g e { get ; set ; } public int T o t a l P a...
    Filed under: , ,
  • Silverlight: Product Maintenance Application ( Part 1 – Authentication, Roles and Logging In )

    I wanted to try and follow up on this idea of the XAML Continuum and the basic example that I did with Silverlight and WPF versions of the Pong game by doing something that looked a bit more like a business application. I figured that I’d take my trusty Northwind database and build some kind of functionality that let you maintain the Products table. Specifically; Display a grid with data from the Products table allowing CRUD against that table. Well, perhaps not CRUD because I don’t think the Products table is meant to support deletes (there’s a discontinued flag) and so maybe I’ll just do CRU rather than CRUD. Allow for searching against products. Allow for paging of the product data. Display appropriate lookups for the related entities – Supplier and Category. For a particular product, display a graph showing sales of that product over time. Have user roles that allow for users to be able to [View], [Update] and [See Sales Data]. Pass all data over a secure transport to avoid prying...
    Filed under: , ,
  • Silverlight 3 Session at NxtGen Fest 09, Microsoft Research Cambridge

    I was at the NxtGen Fest 09 event in Cambrdige today talking about Silverlight 3. A truly fantastic day with a cracking start from Professor Chris Bishop of Royal Institute Christmas lectures fame;   who was talking about 3rd generation artificial intelligence technologies. There were other great sessions from Dinis Cruz, Chris Hay amongst others. By contrast to Chris’ talk, my talk was the fairly mundane topic of; I had an interesting problem with a demo where a Silverlight client was calling a web service and I was serving up that service from Cassini and the project had been left to use dynamic ports ( by mistake ) and the port changed during the demo and the client couldn’t find the server. Truly foxed me but I took the British route of; and tried to fix it with the debugger before giving up and moving on so hopefully ( if you came along ) your enjoyment was improved by seeing me wrestling with Visual Studio rather than reduced by it :-) The slides from the talk are here for download and all the demos...
  • WPF and Silverlight Difference Whitepaper

    Wintellect have published this whitepaper on CodePlex on the differences between WPF and Silverlight. I haven’t read it all myself yet as it’s reasonably meaty but from what I’ve seen it’s a very valuable resource to have to hand if you’re working with both environments. Some of the items in the paper are illustrated by demos from my “Beyond Silverlight with WPF” talk at DevDays Holland the other week – you can find the materials here . It’s a difficult time to be writing a paper like this because Silverlight 3 is in beta and so there are various places in the doc where forthcoming functionality is highlighted with text like “This is a current WPF/Silverlight difference but will change in Silverlight 3”. Hopefully people will grab the document, download it and feedback and make it an even better resource.
    Filed under: , ,
  • Building a Viewbox-like control

    I found myself reading this post today as I wanted to build a Silverlight control which is a little like Viewbox in that it has ( let’s say ) a single lump of content that it wants to display and I was struggling to find the right base class for it. Why? Because in WPF there are methods like AddLogicalChild on FrameworkElement whereas in Silverlight you don’t have this so you have to look for a control to sub-class which already has some notion of content ( like ContentControl perhaps :-) ). Anyway, it’s an interesting read to see how Viewbox had to function a particular way when implemented by the Silverlight Toolkit team and ( if you look at the beta bits for Silverlight 3 ) you’ll find that it now works as you’d expect especially when you write XAML like; <controls:Viewbox>             <TextBlock                 x:Name="xyz" />        ...
    Filed under:
  • WPF: Pong

    Following up on yesterday’s amazing breakthrough with “Silverlight:Pong” :-) I thought I’d follow a bit of this XAML Continuum myself and move my Silverlight Pong to WPF. I wanted to maintain a single code-base as much as possible. It’s fairly easy to cross-compile C# code by using conditional compilation where necessary for WPF/Silverlight ( Silverlight projects already define the SILVERLIGHT constant which is useful ) but I wanted to also try and have a single lump of XAML so that pretty much all the files in my WPF project were just linked from the Silverlight project. I started to ponder about using the C++ preprocessor in order to do some pre-processing on my XAML when Marc pointed out that Ben had already done that in an MSBuild style manner; Using the preprocessor to share incompatible XAML between SL and WPF and that also links up a little with this post from David; A custom preprocessor for sharing XAML between Silverlight and WPF although I didn’t actually use that second technique but I did use Ben...
    Filed under: , ,
  • Silverlight: Pong

    What with all the high-tech announcements around “ Project Natal ” I thought I might head the other direction and play with something a little more on the low-tech end of the spectrum; a Silverlight 3 version of Pong :-) I tried to be reasonably retro here and reproduce the original look and feel somewhat ( didn’t take me long to draw those 2 lines in Expression Blend ). You can run the application from here – not sure it really makes for a two-player game these days but I spent a few minutes playing against myself. (keys involved are left, right, up, down, space to start, N for new game, L/S for load/save UI ) A couple of interesting things drop out from this. One is that I ended up using the new Viewbox control because it is easier for me to program against a game like this using the absolute layout capabilities of a Canvas but I still want a resizable UI. So…I program against a fixed size Canvas and then just drop it into a Viewbox to get a cheap-and-cheerful form of resizable UI. The other is that I added...
    Filed under: ,
  • Silverlight and WPF: The XAML Continuum

    I saw that Karl had been busy on the plane and had written this post around sharing code between WPF and Silverlight and so I wanted to flag that up here. It links up pretty well for me in that during my “Beyond Silverlight with WPF” session at DevDays last week I talked about how people often see Silverlight and WPF as competing technologies; and that I often get asked the question of “Do I build for the browser or do I build for the client” and there’s an implicit link of the “browser” aspect of this to Silverlight and the “client” aspect of this to WPF. Now, I think there are various reasons why people build for “browser” or for “client” such as; and we even talked about it a little in the video that we made up here but I think it’s getting too complex to talk just in terms of “browser” or “client” these days in that I think those boundaries are blurring in that Silverlight ( especially V3 ) reaches out in some ways to the desktop and WPF reaches out in some ways to the browser as in; and so it becomes a more...
    Filed under: , ,
  • 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: , ,
  • 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: ,
1 2 3 4 5 Next > ... Last »
(C) Mike Taulty, 2009. All rights reserved. The information in this weblog is provided "AS IS" with no warranties, and confers no rights. This weblog does not represent the thoughts, intentions, plans or strategies of my employer. It is solely my opinion. Inappropriate comments will be deleted at the authors discretion. All code samples are provided "AS IS" without warranty of any kind, either express or implied, including but not limited to the implied warranties of merchantability and/or fitness for a particular purpose.
Powered by Community Server (Non-Commercial Edition), by Telligent Systems